WorkerLocation is the type of self.location inside a Web Worker. It describes the URL of the worker script, similar in spirit to window.location but read-focused for workers.
Read href, pathname, search, and hash. toString() returns the full URL string. You cannot assign location.href to navigate the way a window can.
This page teaches what WorkerLocation is. Method and property guides live under this section.
Only available inside workers.
Page scripts use window.location (a Location object). Worker scripts use self.location (WorkerLocation).
WorkerLocation is the object you get from self.location inside a Web Worker. It describes the worker script’s URL with href, pathname, and related fields.
Both describe URLs, but WorkerLocation is for worker scripts and does not support the same navigation assignments a window Location does.
Yes. Use self.location.search and parse it, or pass data with postMessage from the page instead.
No. Pages use Location via window.location. WorkerLocation appears only in worker scopes.
Open toString(), then the Worker hub for creating workers and messaging.