diff --git a/src/background/background.ts b/src/background/background.ts index 7fe57c78..a2a6abb9 100644 --- a/src/background/background.ts +++ b/src/background/background.ts @@ -1,7 +1,6 @@ import { MessageListener } from 'chrome-extension-toolkit'; import { BACKGROUND_MESSAGES } from 'src/shared/messages'; import { generateRandomId } from 'src/shared/util/random'; -import onHistoryStateUpdated from './events/onHistoryStateUpdated'; import onInstall from './events/onInstall'; import onNewChromeSession from './events/onNewChromeSession'; import onServiceWorkerAlive from './events/onServiceWorkerAlive'; @@ -30,9 +29,6 @@ chrome.runtime.onInstalled.addListener(details => { } }); -// This event is fired when any tab's url changes. -chrome.webNavigation.onHistoryStateUpdated.addListener(onHistoryStateUpdated); - // initialize the message listener that will listen for messages from the content script const messageListener = new MessageListener({ ...browserActionHandler, diff --git a/src/background/events/onHistoryStateUpdated.ts b/src/background/events/onHistoryStateUpdated.ts deleted file mode 100644 index d6864230..00000000 --- a/src/background/events/onHistoryStateUpdated.ts +++ /dev/null @@ -1,11 +0,0 @@ -/** - * This event is fired when any tab's url changes. - * This is useful for content scripts to know when SPA navigations occur. - * @param details - */ -export default function onHistoryStateUpdated( - details: chrome.webNavigation.WebNavigationTransitionCallbackDetails -): void { - const { tabId, url } = details; - // TODO: send a message to tab with tabId to reanalyze the page -} diff --git a/webpack/manifest.config.ts b/webpack/manifest.config.ts index 04cc25af..04a7ff2d 100644 --- a/webpack/manifest.config.ts +++ b/webpack/manifest.config.ts @@ -10,6 +10,10 @@ const HOST_PERMISSIONS: string[] = [ '*://*.login.utexas.edu/login/*', ]; +if (process.env.NODE_ENV === 'development') { + HOST_PERMISSIONS.push('http://localhost:9090/*'); +} + /** * Creates a chrome extension manifest from the given version, mode, and * @param mode the build mode (development or production) @@ -41,7 +45,7 @@ export function getManifest(mode: Environment, version: string): chrome.runtime. web_accessible_resources: [ { resources: ['static/media/*', '*'], - matches: HOST_PERMISSIONS, + matches: [''], }, ], icons: {