Changes between Version 1 and Version 2 of Ticket #23723, comment 4


Ignore:
Timestamp:
Oct 1, 2017, 8:55:33 PM (23 months ago)
Author:
ma1
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #23723, comment 4

    v1 v2  
    99{{{
    1010{
    11 
    12   let xhr = new XMLHttpRequest();xhr.open("GET", "chrome://noscript/content/noscriptOverlayFx57.xul");try {
     11  let xhr = new XMLHttpRequest();
     12  xhr.open("GET", "chrome://noscript/content/noscriptOverlayFx57.xul");
     13  try {
    1314    // work around to resolve overlay's XML entities despite the Tor Browser
    14 
    15   let TOR_PREF = "extensions.torbutton.resource_and_chrome_uri_fingerprinting";let torPrefValue = Services.prefs.getBoolPref(TOR_PREF);let restorePref = () => Services.prefs.setBoolPref(TOR_PREF, torPrefValue);for (let e of ["progress", "loadend"]) { // restore as early as possible (almost sync)
    16     xhr.addEventListener(e, restorePref);
    17   }xhr.addEventListener("loadstart", () => {
    18     Services.prefs.setBoolPref(TOR_PREF, true);
    19   });
    20 
     15   
     16    let TOR_PREF = "extensions.torbutton.resource_and_chrome_uri_fingerprinting";
     17    let torPrefValue = Services.prefs.getBoolPref(TOR_PREF);
     18    let restorePref = () => Services.prefs.setBoolPref(TOR_PREF, torPrefValue);
     19    for (let e of ["progress", "loadend"]) { // restore as early as possible (almost sync)
     20      xhr.addEventListener(e, restorePref);
     21    }
     22    xhr.addEventListener("loadstart", () => {
     23      Services.prefs.setBoolPref(TOR_PREF, true);
     24    });
     25   
    2126  } catch (e) {
    2227    // no pref value, it doesn't seem to be a Tor Browser :)
    23   }xhr.addEventListener("load", () => {
     28  }
     29  xhr.addEventListener("load", () => {
    2430    alert(xhr.responseXML.getElementById("noscript-tbb"));
    2531  });
     32 xhr.send()
     33}
    2634
    27   xhr.send()
    28 }
    2935}}}