Can javascript detect presence of firefox electrolysis? - javascript

My question is similar to the one here How to know loaded window is Firefox Electrolysis Window
Except I'm not writing an add-on, just a script to execute on a page, so I don't think I can use the solution there.
I'd really just like to know if asynchronous scrolling is active or not. Is it possible?

Related

Monitoring JavaScript stack trace [duplicate]

Is it possible to view JavaScript function calls in the browser's JavaScript console? I know you can view XHR, but can you view function calls?
For example, I hover my mouse over some element on a page and a div pops up. I know there was a JavaScript function that was called to show the popup so it would be nice to be able to view this call in the console so I can see what function was called.
Am I missing something or is this not possible?
So basically you want to view JS calls in real-time?
The Firebug extension on Firefox offers that (http://getfirebug.com/javascript).
Basically, what you want to do is find your function within your code, then set a breakpoint on it. You should then be able to step through execution on it, just like a normal debugger. It shouldn't be hard to find the JS function associated with a and a particular event (e.g. mouseover) on that - is this page in question using straight JS or a framework? And if so, which one?
Google Chrome's built-in developer tools offer a smaller subset - depending on what you want, the Profile tab on it might be useful?
What exactly do you need to trace this JS function for? We might be able to recommend a better tool for you based on your particular need.
Check into the Firebug Profiler you can use it to see a break down of what's going on without having to manually add in console.log statements.
To use the profiler, just go to the Console tab and click the "Profile" button. Then use your app for a bit or reload the page and then click the "Profile" button again. You'll then see a detailed report that shows what functions were called and how much time each one took.
http://michaelsync.net/2007/09/10/firebug-tutorial-logging-profiling-and-commandline-part-ii
Understanding Firebug profiler output
Not unless you explicitly attach that information to the DOM.
You can, however, set breakpoints in the developers tools for some browsers, such as Safari, Chrome and Firebug for Firefox.

Execute Javascript onWindowClose in IE11

I am trying to call a JavaScript function when an IE11 tab and/or window Closes.
I am trying to do it using this code:
window.onbeforeunload = function(e) {//code to execute when forced close};
This code is triggered on window update and on navigation which for me is desirable and something I base my logic on. However, it seems as though it doesn't have time to execute when tab/window is forcefully closed.
I'm in the "fortunate" situation of only needing to support IE11 on this project so microsoft hacks are ok, though of course not a preferred choice as things as always might change in the future.

detect refresh browser for unload/beforeunload when browser closed

This is actually continuation of my last question. I still face problem since when i refresh browser, either unload or beforeunload also fired which I only want them when browser closed. Just crossed on my mind to use window.outerHeight or window.innerHeight but still can't figure out how to do this. Any suggestion/snippet? Thanks in advance.
As far as I know it is impossible to detect a browser close separately from a browser refresh, because the browser does not provide the webpage (window) with that information. As far as your page and its Javascript code are concerned, the two are one and the same.
Since it's browser info that you need, the only way to get it is to use something that has access to that info, ie. a browser plug-in. But then you'll need to make a plug-in for each browser, and get every user to install it. Since I highly doubt you'll find this worthwhile, the real answer to your question (as frustrating as it may be) is: stop trying to detect refreshes vs. closes and move on.

Chrome API - Check if Chrome has Focus

I'm creating an extension where I'd like to be able to figure out whether Chrome (as an application) has the user's focus, i.e. is it not minimized or in the background?
I believe there are javascript functions that check if a tab has focus, would injecting that code into every tab and seeing if any of the tabs return false work? That sounds like terrible peformance though, maybe just inject it into the "active" window using chrome.tabs.onUpdated?
Or would this be do-able relatively easily using NPAPI? Would it require different code for different OSes?
Thanks!

Popup window always on top

Am looking at whatever hacks that are possible to keep a window always on top (apart from window.focus()). Maybe a hidden textbox to which I can set focus etc.
I see this happening in LivePerson (support) whenever a new message arrives. I have legitimate use of this and not to annoy users with ads or anything.
Any hacks for any browsers will do. I am not looking at a complete cross-browser solution. I think window.focus would work for Internet Explorer, though I am yet to test it.
This JavaScript code will place the popup window on top of all other open browser windows until the viewer closes the window containing this little JavaScript code:
<body onblur="self.focus();">

Categories