Created
October 13, 2010 23:36
-
-
Save erikvold/625195 to your computer and use it in GitHub Desktop.
This file contains 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
onmessage = function(event) { | |
postMessage(event.data); | |
onCancel(); // causes "onCancel is not defined" error | |
} |
This file contains 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
// ==UserScript== | |
// @name GM_woker test 4 | |
// @namespace gWorkerTest | |
// @include * | |
// @version 0.1 | |
// @author Erik Vergobbi Vold | |
// @license GPL version 3 or any later version; http://www.gnu.org/copyleft/gpl.html | |
// @resource worker http://gist.github.com/raw/625195/worker.js | |
// @description A GM worker test. | |
// ==/UserScript== | |
alert('making worker'); | |
var worker = GM_worker("worker"); | |
worker.onerror=function(event) { | |
alert(event.message); | |
}; | |
alert('posting msg'); | |
worker.postMessage('hello world!'); | |
alert('done'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment