Skip to content

Instantly share code, notes, and snippets.

@xabolcs
Created June 24, 2011 14:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xabolcs/1044942 to your computer and use it in GitHub Desktop.
Save xabolcs/1044942 to your computer and use it in GitHub Desktop.
BarTabWebProgressListener.onStateChange vs browser.webNavigation._pauseLoadURI is not a function
/*
* Progress listener that stops the loading of tabs that are opened in
* the background and whose contents is loaded by C++ code. This
* occurs for instance when the 'browser.tabs.loadDivertedInBackground'
* preference is enabled (because links are always opened by docshell code).
*/
function BarTabWebProgressListener () {}
BarTabWebProgressListener.prototype = {
...
/*** nsIWebProgressListener ***/
onStateChange: function (aWebProgress, aRequest, aStateFlags, aStatus) {
...
// panorama switch
if (this._tab._tabViewTabItem &&
this._tab._tabViewTabItem.parent &&
this._tab._tabViewTabItem.parent._activeTab.tab &&
this._tab._tabViewTabItem.parent._activeTab.tab == this._tab
) {
this._tab.removeAttribute("ontab");
// webNavigation.unhook() will call our unhook.
browser.webNavigation.unhook();
return;
}
...
}
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment