Skip to content

Commit

Permalink
fix: ext refresh error on Windows Chrome (#3623)
Browse files Browse the repository at this point in the history
  • Loading branch information
sidmorizon authored Oct 11, 2023
1 parent f669323 commit 19872aa
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
7 changes: 6 additions & 1 deletion packages/ext/src/entry/background.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,13 @@ if (!platformEnv.isManifestV3) {
if (parsedUrl.pathname.includes('.')) return;
let indexHtml = getExtensionIndexHtml();
indexHtml = 'ui-expand-tab.html';
/*
check chrome.webRequest.onBeforeRequest
/ui-expand-tab.html/#/ not working for Windows Chrome
/ui-expand-tab.html#/ works fine
*/
const newUrl = chrome.runtime.getURL(
`/${indexHtml}/#${parsedUrl.pathname}${parsedUrl.query}`,
`/${indexHtml}#${parsedUrl.pathname}${parsedUrl.query}`,
);

return { redirectUrl: newUrl };
Expand Down
7 changes: 6 additions & 1 deletion packages/kit/src/routes/linking.ts
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,12 @@ const buildLinking = (): LinkingOptions<any> => {
}
// keep manifest v3 url with html file
if (platformEnv.isExtChrome && platformEnv.isManifestV3) {
return `${extHtmlFileUrl}/#${newPath}`;
/*
check chrome.webRequest.onBeforeRequest
/ui-expand-tab.html/#/ not working for Windows Chrome
/ui-expand-tab.html#/ works fine
*/
return `${extHtmlFileUrl}#${newPath}`;
}
return newPath;
},
Expand Down

0 comments on commit 19872aa

Please sign in to comment.