Skip to content

Commit

Permalink
Add support for Firefox's 'moz-extension://' protocol, to bundle-url.…
Browse files Browse the repository at this point in the history
…js (#2465)
  • Loading branch information
viktorstrate authored and devongovett committed Dec 31, 2018
1 parent 8322e47 commit d04192b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/core/parcel-bundler/src/builtins/bundle-url.js
Expand Up @@ -12,7 +12,7 @@ function getBundleURL() {
try {
throw new Error;
} catch (err) {
var matches = ('' + err.stack).match(/(https?|file|ftp|chrome-extension):\/\/[^)\n]+/g);
var matches = ('' + err.stack).match(/(https?|file|ftp|chrome-extension|moz-extension):\/\/[^)\n]+/g);
if (matches) {
return getBaseURL(matches[0]);
}
Expand All @@ -22,7 +22,7 @@ function getBundleURL() {
}

function getBaseURL(url) {
return ('' + url).replace(/^((?:https?|file|ftp|chrome-extension):\/\/.+)\/[^/]+$/, '$1') + '/';
return ('' + url).replace(/^((?:https?|file|ftp|chrome-extension|moz-extension):\/\/.+)\/[^/]+$/, '$1') + '/';
}

exports.getBundleURL = getBundleURLCached;
Expand Down

0 comments on commit d04192b

Please sign in to comment.