mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-10-26 09:07:30 +09:00
import FIREFOX_52_6_0esr_RELEASE from mozilla-esr52 hg repo
This commit is contained in:
commit
dcd9973243
150858 changed files with 23884658 additions and 0 deletions
55
dom/security/test/csp/file_referrerdirective.html
Normal file
55
dom/security/test/csp/file_referrerdirective.html
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<title>Subframe test for bug 965727</title>
|
||||
|
||||
<script type="text/javascript">
|
||||
// we can get the ID out of the querystring.
|
||||
var args = document.location.search.substring(1).split('&');
|
||||
var id = "unknown";
|
||||
for (var i=0; i < args.length; i++) {
|
||||
var arg = unescape(args[i]);
|
||||
if (arg.indexOf('=') > 0 && arg.indexOf('id') == 0) {
|
||||
id = arg.split('=')[1].trim();
|
||||
}
|
||||
}
|
||||
|
||||
var results = {
|
||||
'id': id,
|
||||
'referrer': document.location.href,
|
||||
'results': {
|
||||
'sameorigin': false,
|
||||
'crossorigin': false,
|
||||
'downgrade': false
|
||||
}
|
||||
};
|
||||
|
||||
// this is called back by each script load.
|
||||
var postResult = function(loadType, referrerLevel, referrer) {
|
||||
results.results[loadType] = referrerLevel;
|
||||
|
||||
// and then check if all three have loaded.
|
||||
for (var id in results.results) {
|
||||
if (!results.results[id]) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
//finished if we don't return early
|
||||
window.parent.postMessage(JSON.stringify(results), "*");
|
||||
console.log(JSON.stringify(results));
|
||||
}
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
Testing ...
|
||||
|
||||
<script src="https://example.com/tests/dom/security/test/csp/referrerdirective.sjs?type=sameorigin&"
|
||||
onerror="postResult('sameorigin', 'error');"></script>
|
||||
<script src="https://test2.example.com/tests/dom/security/test/csp/referrerdirective.sjs?type=crossorigin&"
|
||||
onerror="postResult('crossorigin', 'error');"></script>
|
||||
<script src="http://example.com/tests/dom/security/test/csp/referrerdirective.sjs?type=downgrade&"
|
||||
onerror="postResult('downgrade', 'error');"></script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
Loading…
Add table
Add a link
Reference in a new issue