mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-21 07:47:32 +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
30
dom/security/test/csp/file_child-src_service_worker.html
Normal file
30
dom/security/test/csp/file_child-src_service_worker.html
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<title>Bug 1045891</title>
|
||||
</head>
|
||||
<body>
|
||||
<script type="text/javascript">
|
||||
page_id = window.location.hash.substring(1);
|
||||
try {
|
||||
if ('serviceWorker' in navigator) {
|
||||
navigator.serviceWorker.register(
|
||||
'file_child-src_service_worker.js',
|
||||
{ scope: './' + page_id + '/' }
|
||||
).then(function(reg)
|
||||
{
|
||||
// registration worked
|
||||
reg.unregister().then(function() {
|
||||
window.parent.postMessage({id:page_id, message:"allowed"}, 'http://mochi.test:8888');
|
||||
});
|
||||
}).catch(function(error) {
|
||||
// registration failed
|
||||
window.parent.postMessage({id:page_id, message:"blocked"}, 'http://mochi.test:8888');
|
||||
});
|
||||
};
|
||||
} catch(ex) {
|
||||
window.parent.postMessage({id:page_id, message:"exception"}, 'http://mochi.test:8888');
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
Loading…
Add table
Add a link
Reference in a new issue