Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue8141/support safari extensions #8175

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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,
101arrowz marked this conversation as resolved.
Show resolved Hide resolved
);
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