feat: UTRP v2 migration (#292)
* feat: wip add course by url * chore: update imports * feat: add useCourseFromUrl hook * chore: extract logic into async function * feat: add checkLoginStatus.ts * feat: add useCourseMigration hook * feat: working course migration * fix: active schedule bug * feat: refactor logic and add to onUpdate * feat: update ui style * feat: add changelog functionality to settings * chore: update packages * feat: migration + sentry stuffs * feat: improve migration flow * docs: add sentry jsdocs * chore: fix lint and format * chore: cleanup + fix race condition --------- Co-authored-by: Samuel Gunter <sgunter@utexas.edu> Co-authored-by: Razboy20 <razboy20@gmail.com>
This commit is contained in:
@@ -31,6 +31,22 @@ chrome.runtime.onInstalled.addListener(details => {
|
||||
}
|
||||
});
|
||||
|
||||
chrome.tabs.onUpdated.addListener(async (tabId, changeInfo, tab) => {
|
||||
console.log(changeInfo);
|
||||
if (changeInfo.url === 'https://utdirect.utexas.edu/apps/registrar/course_schedule/utrp_login/') {
|
||||
console.log('UTDirect detected');
|
||||
// close the tab, open popup
|
||||
|
||||
function openPopupAction() {
|
||||
chrome.tabs.onActivated.removeListener(openPopupAction);
|
||||
chrome.action.openPopup();
|
||||
}
|
||||
|
||||
chrome.tabs.onActivated.addListener(openPopupAction);
|
||||
await chrome.tabs.remove(tabId);
|
||||
}
|
||||
});
|
||||
|
||||
// initialize the message listener that will listen for messages from the content script
|
||||
const messageListener = new MessageListener<BACKGROUND_MESSAGES>({
|
||||
...browserActionHandler,
|
||||
|
||||
Reference in New Issue
Block a user