Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Result of test() method does not match Chromium implementation #129

Open
maischus opened this issue Jun 21, 2024 · 0 comments
Open

Result of test() method does not match Chromium implementation #129

maischus opened this issue Jun 21, 2024 · 0 comments

Comments

@maischus
Copy link

The result of the test() method of the URLPattern interface in the Chromium implementation does not match the result of this polyfill.

import {URLPattern as URLPatternPolyfill} from "urlpattern-polyfill";

const myPathName = "/some-test/index.html";
const url1 = new URLPattern({ pathname: myPathName });
const url2 = new URLPatternPolyfill({ pathname: myPathName });

const testPathName = "/some-test/index.html#test";
console.log("Chromium:", url1.test({pathname: testPathName}));
console.log("Polyfill:", url2.test({pathname: testPathName}));

Result:

Chromium: false
Polyfill: true

This issue brakes the possibility of using hash-based routing in the Lit-Router (issue lit/lit#3517).

@maischus maischus changed the title Result of test() method does not patch Chromium implementation Result of test() method does not match Chromium implementation Jun 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant