| Index: templates/bootstrap.js.tmpl |
| =================================================================== |
| --- a/templates/bootstrap.js.tmpl |
| +++ b/templates/bootstrap.js.tmpl |
| @@ -5,21 +5,17 @@ |
| const Cc = Components.classes; |
| const Ci = Components.interfaces; |
| const Cr = Components.results; |
| const Cu = Components.utils; |
| let {Services} = Cu.import("resource://gre/modules/Services.jsm", {}); |
| Cu.importGlobalProperties(["atob", "btoa", "File", "URL", |
| - "TextDecoder", "TextEncoder"]); |
| - |
| -{%- if hasXMLHttpRequest %} |
| -Cu.importGlobalProperties(["XMLHttpRequest"]); |
| -{%- endif %} |
| + "TextDecoder", "TextEncoder", "XMLHttpRequest"]); |
|
Wladimir Palant
2016/10/31 10:06:42
For reference: originally there was no Cu.importGl
|
| let addonData = null; |
| function startup(params, reason) |
| { |
| addonData = params; |
| {%- if hasChromeRequires %} |
| @@ -140,23 +136,21 @@ function require(module) |
| platformVersion: appInfo.platformVersion |
| }; |
| } |
| else |
| { |
| {%- endif %} |
| let url = addonData.resourceURI.spec + "lib/" + module + ".js"; |
| scopes[module] = { |
| - Cc, Ci, Cr, Cu, atob, btoa, File, URL, require, |
| + Cc, Ci, Cr, Cu, atob, btoa, File, URL, TextDecoder, TextEncoder, |
|
Wladimir Palant
2016/10/31 10:06:42
TextDecoder and TextEncoder globals weren't declar
|
| + XMLHttpRequest, require, |
| {% if hasShutdownHandlers %} |
| onShutdown, |
| {% endif %} |
| - {%- if hasXMLHttpRequest %} |
| - 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 |
| }); |