Skip to content

Switch URL parameter parsing from vtk.js URLExtract to URLSearchParams #831

@PaulHax

Description

@PaulHax

Proposal

Replace vtk.js's extractURLParameters() with standard URLSearchParams for cleaner, more predictable URL parsing.

  • Standard browser API with predictable behavior
  • Native support for repeated parameters via getAll()
  • Remove custom bracket notation [url1,url2] parsing

Files to change

  • src/utils/urlParams.ts - Add extractUrlParams() using URLSearchParams, simplify normalizeUrlParams()
  • src/components/App.vue - Use new extraction function
  • src/utils/token.ts - Use URLSearchParams directly
  • src/utils/urlParams.test.ts - Update tests

Supported formats after change

Format Example
Single value ?urls=/api/manifest
Repeated params ?urls=/a&urls=/b
URL with commas in query ?urls=/api?items=1,2,3
Encoded url params in urls ?urls=%2Fapi%3Fid%3D1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions