This repository has been archived by the owner on Dec 11, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 973
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
block access to child frames' contentWindow, contentDocument, place g…
…uard in blocking proxy to prevent an infinite loop, issue #11683
- Loading branch information
Showing
3 changed files
with
100 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
test/fixtures/fingerprinting-blocking-from-child-frames.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<html> | ||
<head> | ||
</head> | ||
<body> | ||
<div id="target"> | ||
proxy blocking being tested | ||
</div> | ||
<script> | ||
(function () { | ||
|
||
let parentFrameMethod = window.HTMLCanvasElement.prototype.toDataURL | ||
|
||
let iframe = document.createElement("iframe") | ||
iframe.src = "https://example.com/" | ||
document.body.appendChild(iframe) | ||
|
||
// Not blocked | ||
let childFrameMethod = iframe.contentWindow.HTMLCanvasElement.prototype.toDataURL | ||
|
||
if (parentFrameMethod() === childFrameMethod()) { | ||
// If an exception is thrown in the above code, the below line will never | ||
// run, and the text in the div will never be changed (ie test fails). | ||
document.getElementById('target').innerHTML = 'proxy blocking works' | ||
} | ||
}()) | ||
</script> | ||
</body> | ||
</html> |