mirror of
https://github.com/kkapsner/CanvasBlocker
synced 2025-07-04 20:46:39 +02:00
Added protection for window.name and window.opener
As requested by #231. But this protection is disabled by default.
This commit is contained in:
parent
fd7c4fabbd
commit
83efac5e49
13 changed files with 195 additions and 2 deletions
|
@ -118,6 +118,14 @@ addTest("function code", function(log){
|
|||
history.__lookupGetter__("length"),
|
||||
"get length"
|
||||
) || codeDetected;
|
||||
codeDetected = checkFunctionCode(
|
||||
window.__lookupGetter__("name"),
|
||||
"get name"
|
||||
) || codeDetected;
|
||||
codeDetected = checkFunctionCode(
|
||||
window.__lookupSetter__("name"),
|
||||
"set name"
|
||||
) || codeDetected;
|
||||
return codeDetected;
|
||||
});
|
||||
addTest("toString modified", function(log){
|
||||
|
@ -395,4 +403,20 @@ addTest("readout - in - out test", function(log){
|
|||
}
|
||||
}
|
||||
return false;
|
||||
});
|
||||
|
||||
addTest("window name change", function(log){
|
||||
"use strict";
|
||||
|
||||
var oldName = window.name;
|
||||
log("old name:", oldName);
|
||||
var newName = oldName + " added";
|
||||
log("new name:", newName);
|
||||
window.name = newName;
|
||||
|
||||
if (window.name !== newName){
|
||||
log("window name not set:", window.name);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue