Updated Injecting code into UT Pages (markdown)

2025-07-22 04:52:46 -05:00
parent 1208fa0cbe
commit cbdbc11ef2

@@ -3,7 +3,7 @@
This page documents how we inject code into supported pages across the UT Austin web ecosystem.
## Choosing a page to inject on
Current URL is obtained through `window.location.href` by calling `getSiteSupport` in `index.tsx`
Current URL is obtained through `window.location.href` by calling `getSiteSupport`
## siteSupport
Contains enum to determine what page a user is on. For example
@@ -14,7 +14,7 @@ if (url.includes('my.utexas.edu/student/student/index') || url.includes('my.utex
```
## renderComponent
Found in `index.tsx`, the `renderComponent` function is a utility used by the extension to inject React components into websites (and other supported pages). It creates a new div and appends it to the document body. It then uses Reacts createRoot to render the React component inside this container.
Found in `index.tsx` in `pages`, the `renderComponent` function is a utility used by the extension to inject React components into websites (and other supported pages). It creates a new div and appends it to the document body. It then uses Reacts createRoot to render the React component inside this container.
```ts
const renderComponent = (Component: React.ComponentType) => {