Bug 1280404 - Implement chrome.webNavigation.onTabReplaced, r=aswan
authorBob Silverberg <bsilverberg@mozilla.com>
Wed, 14 Sep 2016 15:57:21 -0400
changeset 314539 bd305c9791cb77da37c0ec6705f4bbec42129c5d
parent 314538 cfc2be1d3b51854e87f754f55f58842ea4fbcf1b
child 314540 e6b3befb87a25f71c6406457613b1761b31d71d1
push id32422
push userryanvm@gmail.com
push dateWed, 21 Sep 2016 01:56:29 +0000
treeherderautoland@bd305c9791cb [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersaswan
bugs1280404
milestone52.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 1280404 - Implement chrome.webNavigation.onTabReplaced, r=aswan MozReview-Commit-ID: 6K167oHyqz2
toolkit/components/extensions/ext-webNavigation.js
toolkit/components/extensions/schemas/web_navigation.json
toolkit/components/extensions/test/mochitest/test_ext_webnavigation.html
--- a/toolkit/components/extensions/ext-webNavigation.js
+++ b/toolkit/components/extensions/ext-webNavigation.js
@@ -156,16 +156,17 @@ function convertGetFrameResult(tabId, da
     frameId: ExtensionManagement.getFrameId(data.windowId),
     parentFrameId: ExtensionManagement.getParentFrameId(data.parentWindowId, data.windowId),
   };
 }
 
 extensions.registerSchemaAPI("webNavigation", "addon_parent", context => {
   return {
     webNavigation: {
+      onTabReplaced: ignoreEvent(context, "webNavigation.onTabReplaced"),
       onBeforeNavigate: new WebNavigationEventManager(context, "onBeforeNavigate").api(),
       onCommitted: new WebNavigationEventManager(context, "onCommitted").api(),
       onDOMContentLoaded: new WebNavigationEventManager(context, "onDOMContentLoaded").api(),
       onCompleted: new WebNavigationEventManager(context, "onCompleted").api(),
       onErrorOccurred: new WebNavigationEventManager(context, "onErrorOccurred").api(),
       onReferenceFragmentUpdated: new WebNavigationEventManager(context, "onReferenceFragmentUpdated").api(),
       onHistoryStateUpdated: new WebNavigationEventManager(context, "onHistoryStateUpdated").api(),
       onCreatedNavigationTarget: ignoreEvent(context, "webNavigation.onCreatedNavigationTarget"),
--- a/toolkit/components/extensions/schemas/web_navigation.json
+++ b/toolkit/components/extensions/schemas/web_navigation.json
@@ -335,17 +335,16 @@
             "optional": true,
             "$ref": "EventUrlFilters",
             "description": "Conditions that the URL being navigated to must satisfy. The 'schemes' and 'ports' fields of UrlFilter are ignored for this event."
           }
         ]
       },
       {
         "name": "onTabReplaced",
-        "unsupported": true,
         "type": "function",
         "description": "Fired when the contents of the tab is replaced by a different (usually previously pre-rendered) tab.",
         "parameters": [
           {
             "type": "object",
             "name": "details",
             "properties": {
               "replacedTabId": {"type": "integer", "description": "The ID of the tab that was replaced."},
--- a/toolkit/components/extensions/test/mochitest/test_ext_webnavigation.html
+++ b/toolkit/components/extensions/test/mochitest/test_ext_webnavigation.html
@@ -16,16 +16,17 @@
 
 /* globals sendMouseEvent */
 
 function backgroundScript() {
   const BASE = "http://mochi.test:8888/tests/toolkit/components/extensions/test/mochitest";
   const URL = BASE + "/file_WebNavigation_page1.html";
 
   const EVENTS = [
+    "onTabReplaced",
     "onBeforeNavigate",
     "onCommitted",
     "onDOMContentLoaded",
     "onCompleted",
     "onErrorOccurred",
     "onReferenceFragmentUpdated",
     "onHistoryStateUpdated",
   ];