From deea787c2efbb9c89caec8d9efc023ffafe75613 Mon Sep 17 00:00:00 2001 From: "Matt A. Tobin" Date: Sat, 10 Feb 2018 04:00:58 -0500 Subject: Import Tycho's Add-on Manager --- .../test/addons/bootstrap_globals/bootstrap.js | 29 ++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 toolkit/mozapps/extensions/test/addons/bootstrap_globals/bootstrap.js (limited to 'toolkit/mozapps/extensions/test/addons/bootstrap_globals/bootstrap.js') diff --git a/toolkit/mozapps/extensions/test/addons/bootstrap_globals/bootstrap.js b/toolkit/mozapps/extensions/test/addons/bootstrap_globals/bootstrap.js new file mode 100644 index 000000000..f8a62bcaa --- /dev/null +++ b/toolkit/mozapps/extensions/test/addons/bootstrap_globals/bootstrap.js @@ -0,0 +1,29 @@ +Components.utils.import("resource://gre/modules/Services.jsm"); + +let seenGlobals = new Set(); +let scope = this; +function checkGlobal(name, type) { + if (scope[name] && typeof(scope[name]) == type) + seenGlobals.add(name); +} + +let wrapped = {}; +Services.obs.notifyObservers({ wrappedJSObject: wrapped }, "bootstrap-request-globals", null); +for (let [name, type] of wrapped.expectedGlobals) { + checkGlobal(name, type); +} + +function install(data, reason) { +} + +function startup(data, reason) { + Services.obs.notifyObservers({ + wrappedJSObject: seenGlobals + }, "bootstrap-seen-globals", null); +} + +function shutdown(data, reason) { +} + +function uninstall(data, reason) { +} -- cgit v1.2.3