Skip to content

Commit

Permalink
Remove router hash workaround
Browse files Browse the repository at this point in the history
  • Loading branch information
buberdds committed Nov 2, 2022
1 parent 45d570c commit e79968f
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/utils/webextension.ts
Expand Up @@ -9,15 +9,13 @@ const getExtensionUrl = (path: string) =>
browser.runtime.getURL(`${browser.runtime.getManifest()?.browser_action?.default_popup}${path}`)

const openPopup = (path: string, dimensions: Dimensions) => {
// TODO: remove when react hash router is fixed https://github.com/remix-run/react-router/pull/9409
const fixedPath = `#${path}`
const existingPopupWindow = browser.extension.getViews().find(window => window.location.hash === fixedPath)
const existingPopupWindow = browser.extension.getViews().find(window => window.location.hash === path)

if (existingPopupWindow) {
existingPopupWindow.close()
}
browser.windows.create({
url: getExtensionUrl(fixedPath),
url: getExtensionUrl(path),
type: 'popup',
width: dimensions.width,
height: dimensions.height,
Expand Down

0 comments on commit e79968f

Please sign in to comment.