Skip to content

Commit

Permalink
fix: stronger pattern binding (could be bad?)
Browse files Browse the repository at this point in the history
  • Loading branch information
nobkd committed Mar 26, 2023
1 parent fd65e8e commit 56fef8f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
"permissions": [
"webRequest",
"webRequestBlocking",
"http://*/maps/embed*",
"https://*/maps/embed*",
"http://*/maps*output=embed*",
"https://*/maps*output=embed*"
"http://*/maps/embed?*",
"https://*/maps/embed?*",
"http://*/maps?*output=embed*",
"https://*/maps?*output=embed*"
],
"background": {
"scripts": [
Expand Down
10 changes: 5 additions & 5 deletions replace.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
"use strict";

const patterns = [
'http://*/maps/embed*',
'https://*/maps/embed*',
'http://*/maps*output=embed*',
'https://*/maps*output=embed*'
'http://*/maps/embed?*',
'https://*/maps/embed?*',
'http://*/maps?*output=embed*',
'https://*/maps?*output=embed*'
];

const gLocales = ['com', 'de']; // TODO: collect more locales
const matcher = new RegExp(
`^(https?:\/\/)?(maps\.google\.(${gLocales.join('|')})\/maps\/?\?.*output=embed|(www\.)?google\.(${gLocales.join('|')})\/maps\/embed\/?\?)`
`^(https?:\/\/)?(maps\.google\.(${gLocales.join('|')})\/maps\?.*output=embed|(www\.)?google\.(${gLocales.join('|')})\/maps\/embed\?)`
);


Expand Down

0 comments on commit 56fef8f

Please sign in to comment.