Source code
Revision control
Copy as Markdown
Other Tools
<!DOCTYPE HTML>
<html>
<head>
</head>
<body>
<script type="text/javascript">
var page_id = window.location.hash.substring(1);
var shared_worker = "onconnect = function(e) { " +
"var port = e.ports[0];" +
"port.addEventListener('message'," +
"function(e) { port.postMessage('success'); });" +
"port.start(); }";
try {
var worker = new SharedWorker('data:application/javascript;charset=UTF-8,'+
escape(shared_worker), page_id);
worker.port.start();
worker.onerror = function(evt) {
evt.preventDefault();
}
worker.port.onmessage = function(ev) {
};
worker.port.postMessage('foo');
}
catch (e) {
}
</script>
</body>
</html>