test_importScripts_mixedcontent.html (1418B)
1 <!-- 2 Any copyright is dedicated to the Public Domain. 3 http://creativecommons.org/publicdomain/zero/1.0/ 4 --> 5 <!DOCTYPE HTML> 6 <html> 7 <head> 8 <title>Bug 1198078 - test that we respect mixed content blocking in importScript() inside workers</title> 9 <script src="/tests/SimpleTest/SimpleTest.js"></script> 10 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" /> 11 </head> 12 <body> 13 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1198078">DOM Worker Threads Bug 1198078</a> 14 <iframe></iframe> 15 <p id="display"></p> 16 <div id="content" style="display: none"> 17 18 </div> 19 <pre id="test"> 20 <script class="testbody" type="text/javascript"> 21 22 onmessage = function(event) { 23 switch (event.data.status) { 24 case "done": 25 SimpleTest.finish(); 26 break; 27 case "ok": 28 ok(event.data.data, event.data.msg); 29 break; 30 default: 31 ok(false, "Unexpected message:" + event.data); 32 SimpleTest.finish(); 33 } 34 }; 35 36 SimpleTest.waitForExplicitFinish(); 37 onload = function() { 38 SpecialPowers.pushPrefEnv({"set": [ 39 ["dom.workers.sharedWorkers.enabled", true], 40 ["security.mixed_content.block_active_content", false], 41 ]}, function() { 42 var iframe = document.querySelector("iframe"); 43 iframe.src = "https://example.com/tests/dom/workers/test/importScripts_mixedcontent.html"; 44 }); 45 }; 46 47 </script> 48 </pre> 49 </body> 50 </html>