-
-
Notifications
You must be signed in to change notification settings - Fork 121
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
removeQueryParameters
fails in Firefox content scripts: Error URLSearchParams.keys()
is not a method
#167
Comments
This has nothing to do specifically with this package. It's either a TS config issue or a Firefox issue. |
Thanks for the update! Do you think it doesn't make sense to use
I can make a PR to fix it. It can be something like this: if (Array.isArray(removeQueryParameters)) {
const keysToDelete: string[] = []
urlObject.searchParams.forEach((_value: string, key: string) => {
if (testParameter(key, removeQueryParameters)) {
keysToDelete.push(key)
}
})
keysToDelete.forEach((key: string) => urlObject.searchParams.delete(key))
} What do you think @sindresorhus ? |
I'm not interested in using |
Sure, thanks for the information then! |
The option
removeQueryParameters
ofnormalizeUrl
with a list ofRegExp
s raises an error of "Error: o.searchParams.keys() is not iterable" only in Firefox content scripts.I compile code from TypeScript, the code snipet with usage of
normalizeUrl
is following:Version:
7.0.3
tsconfig.compilerOptions
:lib
:["ES2020","dom","dom.iterable"]
target
:es6
module
:ES2020
moduleResolution
:node
allowJs
:true
Update: if rewrite related code to use
urlObject.searchParams.forEach
it works just fine.The text was updated successfully, but these errors were encountered: