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 |