|
@@ -2,7 +2,7 @@
|
|
|
|
|
|
### The problem with userscripts and SPAs:
|
|
|
YTM is an SPA (single page application), meaning navigating to a different part of the site doesn't trigger the website, and by extension userscripts, to entirely reload like traditional redirects on MPAs (multi-page applications).
|
|
|
-This means userscripts like BetterYTM rely on detecting changes in the DOM using something like the [MutationObserver API](https://developer.mozilla.org/en-US/docs/Web/API/MutationObserver) (see `initSiteEvents()` in [`src/siteEvents.ts`](../siteEvents.ts)) and [the SelectorObserver class of my library UserUtils.](https://github.com/Sv443-Network/UserUtils#selectorobserver)
|
|
|
+This means userscripts like BetterYTM rely on detecting changes in the DOM using something like the [MutationObserver API](https://developer.mozilla.org/en-US/docs/Web/API/MutationObserver) (see the file [`src/observers.ts`](../observers.ts)) and [the SelectorObserver documentation.](https://github.com/Sv443-Network/UserUtils#selectorobserver)
|
|
|
This causes a LOT of headaches (race conditions, detecting navigation, state consistency, performance impacts and more) but it's the only option as far as I'm aware.
|
|
|
|
|
|
<br>
|