Skip to content

Commit

Permalink
silly Firefox can't iterate iterators
Browse files Browse the repository at this point in the history
  • Loading branch information
LittleEndu committed Dec 22, 2023
1 parent 6de2c4c commit d99ae00
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
4 changes: 1 addition & 3 deletions dist/templateManager.user.js
Original file line number Diff line number Diff line change
Expand Up @@ -236,9 +236,7 @@
}
function findJSONTemplateInParams(urlString) {
const urlSearchParams = new URLSearchParams(urlString);
const params = Object.fromEntries(urlSearchParams.entries());
console.log(params);
return params.jsontemplate ? params.jsontemplate : null;
return urlSearchParams.get('jsontemplate');
}
function findJSONTemplateInURL(url) {
return findJSONTemplateInParams(url.hash.substring(1)) || findJSONTemplateInParams(url.search.substring(1));
Expand Down
4 changes: 1 addition & 3 deletions src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,7 @@ export function removeItem<T>(array: Array<T>, item: T): void {

function findJSONTemplateInParams(urlString: string): string | null {
const urlSearchParams = new URLSearchParams(urlString);
const params = Object.fromEntries(urlSearchParams.entries());
console.log(params)
return params.jsontemplate ? params.jsontemplate : null;
return urlSearchParams.get('jsontemplate');
}

export function findJSONTemplateInURL(url: URL | Location): string | null {
Expand Down

0 comments on commit d99ae00

Please sign in to comment.