Last active
December 12, 2015 02:19
-
-
Save klipstein/4698185 to your computer and use it in GitHub Desktop.
Webworker Bug in Opera with importScripts (1)
This file contains hidden or 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
<html> | |
<head> | |
<title>Loading an empty JS-file within worker#importScripts prevents loading following requests</title> | |
<script> | |
var worker = new Worker('worker_bug1.js'); | |
var callCount = 0; | |
worker.addEventListener('message', function() { | |
callCount++; | |
}, false); | |
setTimeout(function() { | |
console.assert(callCount == 2, 'Does not prevent executing following scripts in "importScripts", if a previous loaded JS-file was empty.'); | |
}, 1000); | |
</script> | |
</head> | |
</html> |
This file contains hidden or 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
importScripts( | |
'worker_bug1_filled.js', | |
'worker_bug1_empty.js', // just an empty file (not even a js-comment in that file!) | |
// does not execute when a previous file was empty | |
'worker_bug1_filled.js' | |
); |
This file contains hidden or 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.postMessage(''); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment