Skip to content

Commit

Permalink
Allowlist localhost for amp-worker and extensions in localDev (amppro…
Browse files Browse the repository at this point in the history
  • Loading branch information
powerivq authored Sep 1, 2023
1 parent 4856d04 commit 1ae91e0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/service/extension-script.js
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,8 @@ export function createExtensionScript(win, extensionId, version) {
// Only allow trusted URLs
if (
regexURL.test(url) ||
(getMode().test && testRegexURL.test(new URL(url).hostname)) ||
((getMode().test || getMode().localDev) &&
testRegexURL.test(new URL(url).hostname)) ||
new URL(url).host === 'fonts.googleapis.com'
) {
return url;
Expand Down
2 changes: 1 addition & 1 deletion src/web-worker/amp-worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ class AmpWorker {
/^https:\/\/([a-zA-Z0-9_-]+\.)?cdn\.ampproject\.org(\/.*)?$/;

if (
(regexURL.test(url) || getMode().test) &&
(regexURL.test(url) || getMode().test || getMode().localDev) &&
(url.endsWith('ww.js') ||
url.endsWith('ww.min.js') ||
url.endsWith('ww.mjs') ||
Expand Down

0 comments on commit 1ae91e0

Please sign in to comment.