Hello,
I am currently making a game that requires a lot of bots. I plan to use Web Workers to offload tasks from the main thread.
However, for my game to work, I need to read the URL parameters.
I have always been using the Browser plugin to execute JavaScript with "window.location.href". However, when using a Web Worker, window is no longer defined.
I have tried using JavaScript with the following code to get the result but still failed:
globalThis.location.href
document.location.href
Example: The return from globalThis.location.href is preview.construct.net/previewworker.js
But the actual Base URL should be preview.construct.net/local.html
I hope someone can help me with this. Thanks!