1
0
Fork 0
mirror of https://github.com/kkapsner/CanvasBlocker synced 2025-07-04 04:26:35 +02:00

Do not intercept when the SOP is in the way.

This commit is contained in:
kkapsner 2017-07-18 16:14:03 +02:00
parent 2a3abbcec7
commit 6c47397d46
2 changed files with 20 additions and 1 deletions

View file

@ -32,7 +32,16 @@
scope.setRandomSupplyByType = setRandomSupplyByType;
function getURL(window){
if (!window.location.href || window.location.href === "about:blank"){
var href;
try {
href = window.location.href;
}
catch (e){
// unable to read location due to SOP
// since we are not able to do anything in that case we can allow everything
return "about:SOP";
}
if (!href || href === "about:blank"){
if (window !== window.parent){
return getURL(window.parent);
}