multiple schedule suppport kinda

This commit is contained in:
Sriram Hariharan
2023-03-15 23:54:07 -05:00
parent 6d4a4307cf
commit 6afd372945
30 changed files with 224 additions and 155 deletions

View File

@@ -1,3 +1,5 @@
import { isExtensionPopup } from 'chrome-extension-toolkit';
/**
* An enum that represents the different types of pages that we support
* a given url/page can correspond to many of these enum values
@@ -7,6 +9,7 @@ export enum SiteSupport {
COURSE_CATALOG_DETAILS = 'COURSE_CATALOG_DETAILS',
UT_PLANNER = 'UT_PLANNER',
WAITLIST = 'WAITLIST',
EXTENSION_POPUP = 'EXTENSION_POPUP',
}
/**
@@ -15,6 +18,9 @@ export enum SiteSupport {
* @returns a list of page types that the current page is
*/
export default function getSiteSupport(url: string): SiteSupport | null {
if (isExtensionPopup()) {
return SiteSupport.EXTENSION_POPUP;
}
if (url.includes('utexas.collegescheduler.com')) {
return SiteSupport.UT_PLANNER;
}