Skip to content

Instantly share code, notes, and snippets.

@3rd-Eden
Last active August 29, 2015 14:08
Show Gist options
  • Save 3rd-Eden/27a04a80dcf77ca180cd to your computer and use it in GitHub Desktop.
Save 3rd-Eden/27a04a80dcf77ca180cd to your computer and use it in GitHub Desktop.
URL generation inside WebWorker which is generated through a blob.
var x = new Blob(['var loc = location; if (location.protocol === "blob:") loc = new URL(unescape(loc.pathname)); console.log(new URL("/foo", loc)); '], { type: 'text/javascript' })
, y = URL.createObjectURL(x)
, w = new Worker(y);
var x = new Blob(['console.log(location);console.log(new URL("/foo", location))'], { type: 'text/javascript' })
, y = URL.createObjectURL(x)
, w = new Worker(y);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment