nexushoratio / userscripts

Random userscripts for browsers.
GNU General Public License v3.0
2 stars 0 forks source link

rename `href` event. #74

Closed nexushoratio closed 1 year ago

nexushoratio commented 1 year ago

To urlchange.

Tampermonkey provides this feature natively, so this will need some extra testing and compatibility.

https://www.tampermonkey.net/documentation.php#api:window.onurlchange has:

if (window.onurlchange === null) {
    // feature is supported
    window.addEventListener('urlchange', (info) => ...);
}

We can use that approach to decide if we want install the monitor we use now with a MutationObserver.