Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: lib/ui.js

Issue 11239001: Use XMLHttpRequest constructor in JS modules (Closed)
Patch Set: Created July 25, 2013, 12:36 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « lib/synchronizer.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/ui.js
===================================================================
--- a/lib/ui.js
+++ b/lib/ui.js
@@ -155,17 +155,17 @@ let optionsObserver =
addCommandHandler("adblockplus-showinaddonbar", handler);
addCommandHandler("adblockplus-showintoolbar", handler);
}
let list = doc.getElementById("adblockplus-subscription-list");
if (list)
{
// Load subscriptions data
- let request = Cc["@mozilla.org/xmlextras/xmlhttprequest;1"].createInstance(Ci.nsIXMLHttpRequest);
+ let request = new XMLHttpRequest();
request.mozBackgroundRequest = true;
request.open("GET", "chrome://adblockplus/content/ui/subscriptions.xml");
request.addEventListener("load", function()
{
if (onShutdown.done)
return;
let currentSubscription = FilterStorage.subscriptions.filter(
@@ -279,17 +279,17 @@ let UI = exports.UI =
init: function()
{
// We should call initDone once both overlay and filters are loaded
let overlayLoaded = false;
let filtersLoaded = false;
let sessionRestored = false;
// Start loading overlay
- let request = Cc["@mozilla.org/xmlextras/xmlhttprequest;1"].createInstance(Ci.nsIJSXMLHttpRequest);
+ let request = new XMLHttpRequest();
request.mozBackgroundRequest = true;
request.open("GET", "chrome://adblockplus/content/ui/overlay.xul");
request.addEventListener("load", function(event)
{
if (onShutdown.done)
return;
this.processOverlay(request.responseXML.documentElement);
@@ -789,17 +789,17 @@ let UI = exports.UI =
"data:application/vnd.mozilla.xul+xml," + encodeURIComponent(dialogSource),
"_blank", "chrome,centerscreen,resizable,dialog=no", null);
}
}
if (addSubscription)
{
// Load subscriptions data
- let request = Cc["@mozilla.org/xmlextras/xmlhttprequest;1"].createInstance(Ci.nsIXMLHttpRequest);
+ let request = new XMLHttpRequest();
request.mozBackgroundRequest = true;
request.open("GET", "chrome://adblockplus/content/ui/subscriptions.xml");
request.addEventListener("load", function()
{
if (onShutdown.done)
return;
let node = Utils.chooseFilterSubscription(request.responseXML.getElementsByTagName("subscription"));
« no previous file with comments | « lib/synchronizer.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld