diff options
author | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
---|---|---|
committer | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
commit | 5f8de423f190bbb79a62f804151bc24824fa32d8 (patch) | |
tree | 10027f336435511475e392454359edea8e25895d /dom/security/test/csp/file_referrerdirective.html | |
parent | 49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff) | |
download | UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip |
Add m-esr52 at 52.6.0
Diffstat (limited to 'dom/security/test/csp/file_referrerdirective.html')
-rw-r--r-- | dom/security/test/csp/file_referrerdirective.html | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/dom/security/test/csp/file_referrerdirective.html b/dom/security/test/csp/file_referrerdirective.html new file mode 100644 index 000000000..841ffe058 --- /dev/null +++ b/dom/security/test/csp/file_referrerdirective.html @@ -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> |