Skip to content

Commit 1b247a8

Browse files
committed
Remove same-origin check that used deprecated (now removed) API
1 parent 94bcd2c commit 1b247a8

File tree

1 file changed

+0
-31
lines changed

1 file changed

+0
-31
lines changed

content-script.js

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -40,34 +40,6 @@ const _ = function() {
4040
const getFirstSnapshot = (doc, node, query) =>
4141
doc.evaluate(query, node, null, 7, null).snapshotItem(0);
4242

43-
const checkSameOrigin = (node, tryLoadUri) => {
44-
try {
45-
if (!(tryLoadUri instanceof Ci.nsIURI)) {
46-
tryLoadUri = Services.io.newURI(tryLoadUri, null, null);
47-
}
48-
if (tryLoadUri.schemeIs("data")) {
49-
return true;
50-
}
51-
let pr = node.nodePrincipal;
52-
pr = Cc["@mozilla.org/scriptsecuritymanager;1"].
53-
getService(Ci.nsIScriptSecurityManager).
54-
getAppCodebasePrincipal(pr.URI,
55-
pr.appId,
56-
pr.isInBrowserElement);
57-
if (pr.checkMayLoad.length == 3) {
58-
pr.checkMayLoad(tryLoadUri, false, false);
59-
}
60-
else {
61-
pr.checkMayLoad(tryLoadUri, false);
62-
}
63-
return true;
64-
}
65-
catch (ex) {
66-
log(LOG_DEBUG, "denied load of " + (tryLoadUri.spec || tryLoadUri), ex);
67-
return false;
68-
}
69-
};
70-
7143
const createFrame = (window, src, allowScripts, loadFun) => {
7244
log(LOG_INFO, "creating frame for " + src);
7345
let frame = window.document.createElement("iframe");
@@ -416,9 +388,6 @@ Repaginator.prototype = {
416388
}
417389

418390
var doc = element.contentDocument;
419-
if (!checkSameOrigin(ownerDoc, doc.defaultView.location)) {
420-
throw new Error("not in the same origin anymore");
421-
}
422391
this.pageCount++;
423392

424393
// Remove scripts from frame

0 commit comments

Comments
 (0)