This commit is contained in:
Sriram Hariharan
2023-09-17 15:25:14 -05:00
parent 864afd8dcb
commit 9658697d96
3 changed files with 6 additions and 5 deletions

View File

@@ -7,6 +7,7 @@ import getSiteSupport, { SiteSupport } from './lib/getSiteSupport';
import PopupMain from './components/PopupMain'; import PopupMain from './components/PopupMain';
const support = getSiteSupport(window.location.href); const support = getSiteSupport(window.location.href);
console.log('support:', support);
if (!support) { if (!support) {
throw new Error('UT Registration Plus does not support this page, even though it should...'); throw new Error('UT Registration Plus does not support this page, even though it should...');

View File

@@ -22,7 +22,7 @@ export default function getSiteSupport(url: string): SiteSupport | null {
if (isExtensionPopup()) { if (isExtensionPopup()) {
return SiteSupport.EXTENSION_POPUP; return SiteSupport.EXTENSION_POPUP;
} }
if (isExtensionPage('MyCalendar.html')) { if (isExtensionPage('my_calendar.html')) {
return SiteSupport.MY_CALENDAR; return SiteSupport.MY_CALENDAR;
} }
if (url.includes('utexas.collegescheduler.com')) { if (url.includes('utexas.collegescheduler.com')) {

View File

@@ -9,7 +9,7 @@ export interface Entries {
content: string[]; content: string[];
background: string[]; background: string[];
popup: string[]; popup: string[];
myCalendar: string[]; my_calendar: string[];
// only used in development // only used in development
debug?: string[]; debug?: string[];
} }
@@ -29,12 +29,12 @@ export default function config(mode: Environment, manifest: chrome.runtime.Manif
const entry: Entries = { const entry: Entries = {
content: [path.resolve('src', 'views')], content: [path.resolve('src', 'views')],
popup: [path.resolve('src', 'views')], popup: [path.resolve('src', 'views')],
myCalendar: [path.resolve('src', 'views')], my_calendar: [path.resolve('src', 'views')],
background: [path.resolve('src', 'background', 'background')], background: [path.resolve('src', 'background', 'background')],
}; };
// the entries that need an html file to be generated // the entries that need an html file to be generated
const htmlEntries: EntryId[] = ['popup', 'myCalendar']; const htmlEntries: EntryId[] = ['popup', 'my_calendar'];
if (mode === 'development') { if (mode === 'development') {
// create an html file for the debug entry // create an html file for the debug entry
@@ -45,7 +45,7 @@ export default function config(mode: Environment, manifest: chrome.runtime.Manif
// we need to import react-devtools before the react code in development so that it can hook into react // we need to import react-devtools before the react code in development so that it can hook into react
entry.content = [path.resolve('src', 'debug', 'reactDevtools'), ...entry.content]; entry.content = [path.resolve('src', 'debug', 'reactDevtools'), ...entry.content];
entry.popup = [path.resolve('src', 'debug', 'reactDevtools'), ...entry.popup]; entry.popup = [path.resolve('src', 'debug', 'reactDevtools'), ...entry.popup];
entry.myCalendar = [path.resolve('src', 'debug', 'reactDevtools'), ...entry.myCalendar]; entry.my_calendar = [path.resolve('src', 'debug', 'reactDevtools'), ...entry.my_calendar];
} }
/** @see https://webpack.js.org/configuration for documentation */ /** @see https://webpack.js.org/configuration for documentation */