Skip to content

Commit

Permalink
Add support for chrome-extension:// protocol to bundle-url.js (#2434)
Browse files Browse the repository at this point in the history
  • Loading branch information
rhurstdialpad authored and DeMoorJasper committed Dec 21, 2018
1 parent 4189dcb commit 449a48e
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):\/\/[^)\n]+/g);
var matches = ('' + err.stack).match(/(https?|file|ftp|chrome-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):\/\/.+)\/[^/]+$/, '$1') + '/';
return ('' + url).replace(/^((?:https?|file|ftp|chrome-extension):\/\/.+)\/[^/]+$/, '$1') + '/';
}

exports.getBundleURL = getBundleURLCached;
Expand Down

0 comments on commit 449a48e

Please sign in to comment.