fixing some compiler issues
This commit is contained in:
@@ -1,7 +1,6 @@
|
|||||||
import { MessageListener } from 'chrome-extension-toolkit';
|
import { MessageListener } from 'chrome-extension-toolkit';
|
||||||
import { BACKGROUND_MESSAGES } from 'src/shared/messages';
|
import { BACKGROUND_MESSAGES } from 'src/shared/messages';
|
||||||
import { generateRandomId } from 'src/shared/util/random';
|
import { generateRandomId } from 'src/shared/util/random';
|
||||||
import onHistoryStateUpdated from './events/onHistoryStateUpdated';
|
|
||||||
import onInstall from './events/onInstall';
|
import onInstall from './events/onInstall';
|
||||||
import onNewChromeSession from './events/onNewChromeSession';
|
import onNewChromeSession from './events/onNewChromeSession';
|
||||||
import onServiceWorkerAlive from './events/onServiceWorkerAlive';
|
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
|
// initialize the message listener that will listen for messages from the content script
|
||||||
const messageListener = new MessageListener<BACKGROUND_MESSAGES>({
|
const messageListener = new MessageListener<BACKGROUND_MESSAGES>({
|
||||||
...browserActionHandler,
|
...browserActionHandler,
|
||||||
|
|||||||
@@ -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
|
|
||||||
}
|
|
||||||
@@ -10,6 +10,10 @@ const HOST_PERMISSIONS: string[] = [
|
|||||||
'*://*.login.utexas.edu/login/*',
|
'*://*.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
|
* Creates a chrome extension manifest from the given version, mode, and
|
||||||
* @param mode the build mode (development or production)
|
* @param mode the build mode (development or production)
|
||||||
@@ -41,7 +45,7 @@ export function getManifest(mode: Environment, version: string): chrome.runtime.
|
|||||||
web_accessible_resources: [
|
web_accessible_resources: [
|
||||||
{
|
{
|
||||||
resources: ['static/media/*', '*'],
|
resources: ['static/media/*', '*'],
|
||||||
matches: HOST_PERMISSIONS,
|
matches: ['<all_urls>'],
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
icons: {
|
icons: {
|
||||||
|
|||||||
Reference in New Issue
Block a user