diff options
author | Rogan Creswick <creswick@gmail.com> | 2013-01-02 15:31:43 -0800 |
---|---|---|
committer | Rogan Creswick <creswick@gmail.com> | 2013-01-02 15:31:43 -0800 |
commit | 91c8d16838b39c7726f6c0a0fb333f5ba38d2494 (patch) | |
tree | 136df17525e5e62f3ddc5b7a6dc71ffd31e2aa42 /tools/addon-sdk-1.7/packages/addon-kit/lib/addon-page.js | |
parent | f7b228c479bac8828e521a2826d7f57f150da877 (diff) |
updated addon-sdk to 1.12
Diffstat (limited to 'tools/addon-sdk-1.7/packages/addon-kit/lib/addon-page.js')
-rw-r--r-- | tools/addon-sdk-1.7/packages/addon-kit/lib/addon-page.js | 33 |
1 files changed, 0 insertions, 33 deletions
diff --git a/tools/addon-sdk-1.7/packages/addon-kit/lib/addon-page.js b/tools/addon-sdk-1.7/packages/addon-kit/lib/addon-page.js deleted file mode 100644 index eeb5461..0000000 --- a/tools/addon-sdk-1.7/packages/addon-kit/lib/addon-page.js +++ /dev/null @@ -1,33 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -'use strict'; - -const { uriPrefix, name } = require('@packaging'); -const { WindowTracker, isBrowser } = require('api-utils/window-utils'); -const { add, remove } = require('api-utils/array'); -const { getTabs, closeTab } = require('api-utils/tabs/utils'); - -// Note: This is an URL that will be returned by calling -// `require('self').data.url('index.html')` from the add-on modules. -// We could not use this expression as in this module it would have -// returned "addon-kit/data/index.html" instead. -const addonURL = uriPrefix + name + '/data/index.html'; - -WindowTracker({ - onTrack: function onTrack(window) { - if (isBrowser(window)) - add(window.XULBrowserWindow.inContentWhitelist, addonURL); - }, - onUntrack: function onUntrack(window) { - getTabs(window). - filter(function(tab) tab.linkedBrowser.currentURI.spec === addonURL). - forEach(function(tab) { - // Note: `onUntrack` will be called for all windows on add-on unloads, - // so we want to clean them up from these URLs. - remove(window.XULBrowserWindow.inContentWhitelist, addonURL); - closeTab(tab); - }); - } -}); |