Index: bootstrap.js.tmpl |
=================================================================== |
--- a/bootstrap.js.tmpl |
+++ b/bootstrap.js.tmpl |
@@ -2,20 +2,23 @@ |
* 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/. */ |
const Cc = Components.classes; |
const Ci = Components.interfaces; |
const Cr = Components.results; |
const Cu = Components.utils; |
-let {Services, atob, btoa, File, TextDecoder, TextEncoder} = Cu.import("resource://gre/modules/Services.jsm", null); |
+let {Services} = Cu.import("resource://gre/modules/Services.jsm", {}); |
+ |
+Cu.importGlobalProperties(["atob", "btoa", "File", "URL", |
+ "TextDecoder", "TextEncoder"]); |
{%- if hasXMLHttpRequest %} |
-let XMLHttpRequest = Components.Constructor("@mozilla.org/xmlextras/xmlhttprequest;1", "nsIXMLHttpRequest"); |
+Cu.importGlobalProperties(["XMLHttpRequest"]); |
{%- endif %} |
let addonData = null; |
function startup(params, reason) |
{ |
addonData = params; |
@@ -137,29 +140,22 @@ function require(module) |
platformVersion: appInfo.platformVersion |
}; |
} |
else |
{ |
{%- endif %} |
let url = addonData.resourceURI.spec + "lib/" + module + ".js"; |
scopes[module] = { |
- Cc: Cc, |
- Ci: Ci, |
- Cr: Cr, |
- Cu: Cu, |
- atob: atob, |
- btoa: btoa, |
- File: File, |
- require: require, |
+ Cc, Ci, Cr, Cu, atob, btoa, File, URL, require, |
saroyanm
2016/03/18 13:25:44
Why do we need to make this change ?
Wladimir Palant
2016/03/18 13:33:47
I don't but since I am cleaning up already...
|
{% if hasShutdownHandlers %} |
- onShutdown: onShutdown, |
+ onShutdown, |
{% endif %} |
{%- if hasXMLHttpRequest %} |
- XMLHttpRequest: XMLHttpRequest, |
+ XMLHttpRequest, |
{% endif %} |
exports: {}}; |
{%- if multicompartment %} |
let principal = Cc["@mozilla.org/systemprincipal;1"].getService(Ci.nsIPrincipal); |
scopes[module] = new Cu.Sandbox(principal, { |
sandboxName: url, |
sandboxPrototype: scopes[module], |
wantXrays: false |