diff --git a/bootstrap.js b/bootstrap.js index 6da7acf..87fb943 100644 --- a/bootstrap.js +++ b/bootstrap.js @@ -295,7 +295,14 @@ function Factory(component) { let httpObserver = { observe: function(subject, topic, data) { - if (topic == "http-on-examine-response" || topic == "http-on-examine-cached-response") { + if (topic == "http-on-modify-request") { + subject.QueryInterface(Ci.nsIHttpChannel); + if (subject.URI.host == "web.archive.org") { + if (/^\/web\/.+?\/(addons\.mozilla\.org\/.+?\/more|addons\.cdn\.mozilla\.net\/.+?\/loading-more\.gif.*?|addons-amo\.cdn\.mozilla\.net\/amo-.+?\.js)$/.test(subject.URI.path)) { + subject.cancel(Cr.NS_BINDING_ABORTED); + } + } + } else if (topic == "http-on-examine-response" || topic == "http-on-examine-cached-response") { subject.QueryInterface(Ci.nsIHttpChannel); if (subject.URI.host == storageHost) { if (/origin=caa&action=install$/.test(subject.URI.path)) { @@ -321,10 +328,12 @@ let httpObserver = { } }, register: function() { + Services.obs.addObserver(this, "http-on-modify-request", false); Services.obs.addObserver(this, "http-on-examine-response", false); Services.obs.addObserver(this, "http-on-examine-cached-response", false); }, unregister: function() { + Services.obs.removeObserver(this, "http-on-modify-request"); Services.obs.removeObserver(this, "http-on-examine-response"); Services.obs.removeObserver(this, "http-on-examine-cached-response"); } diff --git a/content/addon.js b/content/addon.js index 6868c29..907aa5e 100644 --- a/content/addon.js +++ b/content/addon.js @@ -48,7 +48,7 @@ let Addon = { data.name = dbQuery.row.name; data.slug = dbQuery.row.slug; data.amo = "https://addons.mozilla.org/addon/" + data.slug + "/"; - data.wbm = "http://web.archive.org/web/*/https://addons.mozilla.org/en-US/firefox/addon/" + data.slug + "/"; + data.wbm = "https://web.archive.org/web/*/https://addons.mozilla.org/en-US/firefox/addon/" + data.slug + "/"; data.summary = dbQuery.row.summary.replace(/(?:\r\n|\r|\n)/g, "
").replace("$", "$"); if (dbQuery.row.homepage) { data.homepage = '
  • Add-on home page
  • ';