Getting document.URL

This should work:

Object.assign(document.createElement("a"), {href: ""}).hash

Edit: actually it won’t because we don’t pass the hash down to the worker. So, you’ll need to use the query string, at least for now.