Bug 1213975 - filter out from WebExtension tabs.onUpdated events any location changes related to iframes. r=billm
authorLuca Greco <luca.greco@alcacoop.it>
Mon, 26 Oct 2015 04:55:00 +0100
changeset 304905 b3a33728ece55fea9dc343a7ef59f58e1c80133c
parent 304904 144c402556a89651f800ed3be4850efb378cd82e
child 304906 148a40aae385d23a8a5ab6ee55bd89777f559c34
push id1001
push userraliiev@mozilla.com
push dateMon, 18 Jan 2016 19:06:03 +0000
treeherdermozilla-release@8b89261f3ac4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbillm
bugs1213975
milestone44.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1213975 - filter out from WebExtension tabs.onUpdated events any location changes related to iframes. r=billm
browser/components/extensions/ext-tabs.js
--- a/browser/components/extensions/ext-tabs.js
+++ b/browser/components/extensions/ext-tabs.js
@@ -194,16 +194,19 @@ extensions.registerAPI((extension, conte
             let gBrowser = browser.ownerDocument.defaultView.gBrowser;
             let tab = gBrowser.getTabForBrowser(browser);
             let tabId = TabManager.getId(tab);
             let [needed, changeInfo] = sanitize(extension, {status});
             fire(tabId, changeInfo, TabManager.convert(extension, tab));
           },
 
           onLocationChange(browser, webProgress, request, locationURI, flags) {
+            if (!webProgress.isTopLevel) {
+              return;
+            }
             let gBrowser = browser.ownerDocument.defaultView.gBrowser;
             let tab = gBrowser.getTabForBrowser(browser);
             let tabId = TabManager.getId(tab);
             let [needed, changeInfo] = sanitize(extension, {
               status: webProgress.isLoadingDocument ? "loading" : "complete",
               url: locationURI.spec
             });
             if (needed) {