[Pkg-mozext-commits] [adblock-plus] 44/87: Issue 3834 - Expose URL constructor to modules

David Prévot taffit at moszumanska.debian.org
Sat Apr 30 17:59:06 UTC 2016


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository adblock-plus.

commit b7a5099b52c8ecb97f1332962d5769aad5a732b2
Author: Wladimir Palant <trev at adblockplus.org>
Date:   Fri Mar 18 13:11:20 2016 +0100

    Issue 3834 - Expose URL constructor to modules
---
 bootstrap.js.tmpl | 20 ++++++++------------
 1 file changed, 8 insertions(+), 12 deletions(-)

diff --git a/bootstrap.js.tmpl b/bootstrap.js.tmpl
index 165b831..a33d758 100644
--- a/bootstrap.js.tmpl
+++ b/bootstrap.js.tmpl
@@ -7,10 +7,13 @@ 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;
@@ -142,19 +145,12 @@ function require(module)
     {%- 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,
         {% if hasShutdownHandlers %}
-        onShutdown: onShutdown,
+        onShutdown,
         {% endif %}
         {%- if hasXMLHttpRequest %}
-        XMLHttpRequest: XMLHttpRequest,
+        XMLHttpRequest,
         {% endif %}
         exports: {}};
       {%- if multicompartment %}

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/adblock-plus.git



More information about the Pkg-mozext-commits mailing list