Problem
When trying to create a worker agent on a document location that has a non empty query string, the query string is included in the resource URL of the worker. This leads to a resource URL that cannot be found.
Steps To Reproduce
- Go to a page that spawns a worker
- Add some query string and reload the page
- Worker resource URL cannot be found
Expected behavior
Query string is not included in the worker's resource URL.
Screenshots
Error in console with query string ?homescreen:

Environment:
Questionnaire
The issue is in
|
let href = utils::document().location().unwrap().href().unwrap(); |
The
href should be replaced with either:
- page origin
or
- page origin + pathname
While page origin + pathname is closer to the way it behaves currently, I think the correct solution, however, is to only use the page origin. This way the resource URL is independent of the current path. But I am happy to implement either one: maintainer's choice!
Problem
When trying to create a worker agent on a document location that has a non empty query string, the query string is included in the resource URL of the worker. This leads to a resource URL that cannot be found.
Steps To Reproduce
Expected behavior
Query string is not included in the worker's resource URL.
Screenshots

Error in console with query string
?homescreen:Environment:
master]Questionnaire
The issue is in
yew/yew/src/agent.rs
Line 1017 in af5bbf8
The
hrefshould be replaced with either:or
While page origin + pathname is closer to the way it behaves currently, I think the correct solution, however, is to only use the page origin. This way the resource URL is independent of the current path. But I am happy to implement either one: maintainer's choice!