Skip to content

query string in worker URL #1175

@domdir

Description

@domdir

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

  1. Go to a page that spawns a worker
  2. Add some query string and reload the page
  3. 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:
grafik

Environment:

  • Yew version [master]

Questionnaire

  • I'm interested in fixing this myself but don't know where to start
  • I would like to fix and I have a solution
  • I don't have time to fix this right now, but maybe later

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions