Updated Injecting code into UT Pages (markdown)
@@ -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 React’s 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 React’s createRoot to render the React component inside this container.
|
||||
|
||||
```ts
|
||||
const renderComponent = (Component: React.ComponentType) => {
|
||||
|
||||
Reference in New Issue
Block a user