From 679d4fcd379022076c2651d479ddce2dfa8287a4 Mon Sep 17 00:00:00 2001 From: Bob Silverberg Date: Wed, 14 Sep 2016 15:57:21 -0400 Subject: [PATCH] Bug 1280404 - Implement chrome.webNavigation.onTabReplaced, r=aswan MozReview-Commit-ID: 6K167oHyqz2 --HG-- extra : rebase_source : 9b5b4caf61de22a94018d6d2a4a11f75f18ff207 --- toolkit/components/extensions/ext-webNavigation.js | 1 + toolkit/components/extensions/schemas/web_navigation.json | 1 - .../extensions/test/mochitest/test_ext_webnavigation.html | 1 + 3 files changed, 2 insertions(+), 1 deletion(-) diff --git a/toolkit/components/extensions/ext-webNavigation.js b/toolkit/components/extensions/ext-webNavigation.js index d1a6ae820b93..4136a7f460f4 100644 --- a/toolkit/components/extensions/ext-webNavigation.js +++ b/toolkit/components/extensions/ext-webNavigation.js @@ -161,6 +161,7 @@ function convertGetFrameResult(tabId, data) { 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(), diff --git a/toolkit/components/extensions/schemas/web_navigation.json b/toolkit/components/extensions/schemas/web_navigation.json index 3bf7adeb39d0..1e13b181ace6 100644 --- a/toolkit/components/extensions/schemas/web_navigation.json +++ b/toolkit/components/extensions/schemas/web_navigation.json @@ -340,7 +340,6 @@ }, { "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": [ diff --git a/toolkit/components/extensions/test/mochitest/test_ext_webnavigation.html b/toolkit/components/extensions/test/mochitest/test_ext_webnavigation.html index 32c55f295417..2287fd9b153a 100644 --- a/toolkit/components/extensions/test/mochitest/test_ext_webnavigation.html +++ b/toolkit/components/extensions/test/mochitest/test_ext_webnavigation.html @@ -21,6 +21,7 @@ function backgroundScript() { const URL = BASE + "/file_WebNavigation_page1.html"; const EVENTS = [ + "onTabReplaced", "onBeforeNavigate", "onCommitted", "onDOMContentLoaded",