Skip to content

Commit

Permalink
Issue8141/support safari extensions (#8175)
Browse files Browse the repository at this point in the history
  • Loading branch information
Kjoep committed Jun 7, 2022
1 parent 3b3b135 commit f9ac612
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/runtimes/js/src/helpers/bundle-url.js
Expand Up @@ -14,7 +14,7 @@ function getBundleURL() {
throw new Error();
} catch (err) {
var matches = ('' + err.stack).match(
/(https?|file|ftp|(chrome|moz)-extension):\/\/[^)\n]+/g,
/(https?|file|ftp|(chrome|moz|safari-web)-extension):\/\/[^)\n]+/g,
);
if (matches) {
// The first two stack frames will be this function and getBundleURLCached.
Expand All @@ -29,7 +29,7 @@ function getBundleURL() {
function getBaseURL(url) {
return (
('' + url).replace(
/^((?:https?|file|ftp|(chrome|moz)-extension):\/\/.+)\/[^/]+$/,
/^((?:https?|file|ftp|(chrome|moz|safari-web)-extension):\/\/.+)\/[^/]+$/,
'$1',
) + '/'
);
Expand All @@ -38,7 +38,7 @@ function getBaseURL(url) {
// TODO: Replace uses with `new URL(url).origin` when ie11 is no longer supported.
function getOrigin(url) {
let matches = ('' + url).match(
/(https?|file|ftp|(chrome|moz)-extension):\/\/[^/]+/,
/(https?|file|ftp|(chrome|moz|safari-web)-extension):\/\/[^/]+/,
);
if (!matches) {
throw new Error('Origin not found');
Expand Down

0 comments on commit f9ac612

Please sign in to comment.