diff options
author | Deathamns <deathamns@gmail.com> | 2015-03-01 20:21:05 +0100 |
---|---|---|
committer | Deathamns <deathamns@gmail.com> | 2015-03-01 20:21:05 +0100 |
commit | da3586adde9d19d943e64d865847ab08bb75581f (patch) | |
tree | a31aa16077217f552ad665505f3d44015b2b1f35 /platform | |
parent | 092bfbd274f7c0e868fa9f297fd08c79b8ca663b (diff) | |
download | uBlock-da3586adde9d19d943e64d865847ab08bb75581f.zip uBlock-da3586adde9d19d943e64d865847ab08bb75581f.tar.gz uBlock-da3586adde9d19d943e64d865847ab08bb75581f.tar.bz2 |
Firefox/Fennec fixes
Diffstat (limited to 'platform')
-rw-r--r-- | platform/firefox/frameModule.js | 1 | ||||
-rw-r--r-- | platform/firefox/vapi-background.js | 28 |
2 files changed, 21 insertions, 8 deletions
diff --git a/platform/firefox/frameModule.js b/platform/firefox/frameModule.js index 363f76f..3a16c70 100644 --- a/platform/firefox/frameModule.js +++ b/platform/firefox/frameModule.js @@ -53,7 +53,6 @@ const contentObserver = { MAIN_FRAME: Ci.nsIContentPolicy.TYPE_DOCUMENT, contentBaseURI: 'chrome://' + hostName + '/content/js/', cpMessageName: hostName + ':shouldLoad', - ignoredPopups: new WeakMap(), uniqueSandboxId: 1, diff --git a/platform/firefox/vapi-background.js b/platform/firefox/vapi-background.js index a35cde7..bed630b 100644 --- a/platform/firefox/vapi-background.js +++ b/platform/firefox/vapi-background.js @@ -364,10 +364,15 @@ var tabWatcher = { return; } + var loc = win.location; + /*if ( loc.protocol === 'http' || loc.protocol === 'https' ) { + return; + }*/ + vAPI.tabs.onNavigation({ frameId: 0, - tabId: getOwnerWindow(win).getTabForWindow(win).id, - url: Services.io.newURI(win.location.href, null, null).asciiSpec + tabId: getOwnerWindow(win).BrowserApp.getTabForWindow(win).id, + url: Services.io.newURI(loc.href, null, null).asciiSpec }); } }; @@ -464,7 +469,7 @@ vAPI.tabs.registerListeners = function() { } var URI = browser.currentURI; if ( URI.schemeIs('chrome') && URI.host === location.host ) { - vAPI.tabs._remove(tab, win); + vAPI.tabs._remove(tab, getTabBrowser(win)); } } } @@ -482,7 +487,7 @@ vAPI.tabs.getTabId = function(target) { for ( var win of this.getWindows() ) { var tab = win.BrowserApp.getTabForBrowser(target); - if ( tab && tab.id ) { + if ( tab && tab.id !== undefined ) { return tab.id; } } @@ -1023,6 +1028,7 @@ var httpObserver = { classDescription: 'net-channel-event-sinks for ' + location.host, classID: Components.ID('{dc8d6319-5f6e-4438-999e-53722db99e84}'), contractID: '@' + location.host + '/net-channel-event-sinks;1', + REQDATAKEY: location.host + 'reqdata', ABORT: Components.results.NS_BINDING_ABORTED, ACCEPT: Components.results.NS_SUCCEEDED, // Request types: https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIContentPolicy#Constants @@ -1185,7 +1191,7 @@ var httpObserver = { frameId, parentFrameId ]*/ - channelData = channel.getProperty(location.host + 'reqdata'); + channelData = channel.getProperty(this.REQDATAKEY); } catch (ex) { return; } @@ -1272,10 +1278,18 @@ var httpObserver = { return; } + /*if ( vAPI.fennec && lastRequest.type === this.MAIN_FRAME ) { + vAPI.tabs.onNavigation({ + frameId: 0, + tabId: lastRequest.tabId, + url: URI.asciiSpec + }); + }*/ + // If request is not handled we may use the data in on-modify-request if ( channel instanceof Ci.nsIWritablePropertyBag ) { channel.setProperty( - location.host + 'reqdata', + this.REQDATAKEY, [ lastRequest.type, lastRequest.tabId, @@ -1735,7 +1749,7 @@ vAPI.contextMenu.create = function(details, callback) { if ( gContextMenu.inFrame ) { details.tagName = 'iframe'; - // Probably won't work with e01s + // Probably won't work with e10s details.frameUrl = gContextMenu.focusedWindow.location.href; } else if ( gContextMenu.onImage ) { details.tagName = 'img'; |