-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
308e837
commit 1963543
Showing
9 changed files
with
98 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
import { MessageHandler } from 'chrome-extension-toolkit'; | ||
import { CESMessage } from 'src/shared/messages/CESMessage'; | ||
This comment has been minimized.
Sorry, something went wrong. |
||
import openNewTab from '../util/openNewTab'; | ||
|
||
const CESHandler: MessageHandler<CESMessage> = { | ||
openCESPage({ data, sendResponse }) { | ||
const { instructorFirstName, instructorLastName } = data; | ||
console.log('openCESPage', instructorFirstName, instructorLastName); | ||
const CESFall2023Url = | ||
'https://utexas.bluera.com/utexas/rpvl.aspx?rid=d3db767b-049f-46c5-9a67-29c21c29c580®l=en-US'; | ||
|
||
openNewTab(CESFall2023Url).then(sendResponse); | ||
}, | ||
}; | ||
|
||
export default CESHandler; | ||
|
||
// openNewTab(CESFall2023Url).then(tab => { | ||
// const checkTabUpdatedAndComplete = (tabId: number, changeInfo: chrome.tabs.TabChangeInfo) => { | ||
// if (tabId === tab.id && changeInfo.status === 'complete') { | ||
// chrome.tabs.executeScript( | ||
// tab.id, | ||
// { | ||
// code: ` | ||
// const inputElement = document.getElementById("ctl00_ContentPlaceHolder1_ViewList_tbxValue"); | ||
// if(inputElement) { | ||
// inputElement.value = '${instructorFirstName} ${instructorLastName}'; | ||
// inputElement.focus(); | ||
// const enterKeyEvent = new KeyboardEvent('keydown', {key: 'Enter', code: 'Enter', keyCode: 13, which: 13, bubbles: true}); | ||
// inputElement.dispatchEvent(enterKeyEvent); | ||
// } | ||
// `, | ||
// }, | ||
// () => { | ||
// if (chrome.runtime.lastError) { | ||
// console.error(chrome.runtime.lastError.message); | ||
// sendResponse(null); | ||
// } else { | ||
// sendResponse(tab); | ||
// } | ||
// } | ||
// ); | ||
|
||
// chrome.tabs.onUpdated.removeListener(checkTabUpdatedAndComplete); | ||
// } | ||
// }; | ||
|
||
// chrome.tabs.onUpdated.addListener(checkTabUpdatedAndComplete); | ||
// }); | ||
// }, | ||
// }; | ||
|
||
// export default CESHandler; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
export interface CESMessage { | ||
/** | ||
* Opens the CES page for the specified instructor | ||
* | ||
* @param data first and last name of the instructor | ||
*/ | ||
openCESPage: (data: { instructorFirstName: string; instructorLastName: string }) => chrome.tabs.Tab; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { CESMessage } from '@shared/messages/CESMessage';