diff options
Diffstat (limited to 'HutchSafariExtension')
| -rw-r--r-- | HutchSafariExtension/Resources/background.js | 3 | ||||
| -rw-r--r-- | HutchSafariExtension/Resources/content.js | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/HutchSafariExtension/Resources/background.js b/HutchSafariExtension/Resources/background.js index 81bf8b6..0147de0 100644 --- a/HutchSafariExtension/Resources/background.js +++ b/HutchSafariExtension/Resources/background.js @@ -68,7 +68,8 @@ function hutchDeepLinkFor(rawURL) { const path = deepLinkPath(url.hostname, normalizedPath(url.pathname)); const service = deepLinkService(url.hostname, path); - return `hutch://${service}${path ? `/${path}` : ""}${url.search}${url.hash}`; + const pathSegment = path ? `/${path}` : ""; + return `hutch://${service}${pathSegment}${url.search}${url.hash}`; } function showUnsupportedMessage(tabId) { diff --git a/HutchSafariExtension/Resources/content.js b/HutchSafariExtension/Resources/content.js index dba7c5d..e5cb087 100644 --- a/HutchSafariExtension/Resources/content.js +++ b/HutchSafariExtension/Resources/content.js @@ -63,7 +63,8 @@ function hutchDeepLinkForLocation() { const path = hutchDeepLinkPath(location.hostname, hutchNormalizedPath(location.pathname)); const service = hutchDeepLinkService(location.hostname, path); - return `hutch://${service}${path ? `/${path}` : ""}${location.search}${location.hash}`; + const pathSegment = path ? `/${path}` : ""; + return `hutch://${service}${pathSegment}${location.search}${location.hash}`; } function storageGet(defaults) { |
