Closed yashaskm11 closed 6 months ago
Your alert is only working on page load. While navigating on the website, I noticed the left Browse column does not reload, so I guess the content of the main column is changed by Javascript (i.e. XMLHttpRequest), while simultanously rewriting the link in the address bar (but not actually reloading the whole page). Maybe you can detect a rewrite of the address bar and when the word "lyrics" is present, do the alert.
See #1897. TM/GM/VM and any other userscript manager doesn't and won't support script injection on soft navigation.
Sure, @match
only works on refresh.
But there must be a way of detecting a content change in the page, true?
window.onurlchange
https://github.com/Tampermonkey/tampermonkey/issues/1897#issuecomment-1813387491
also, kinda related https://github.com/Tampermonkey/tampermonkey/issues/1305#issuecomment-903281912
I tried writing a simple script to copy content of a web page on click of a button. It does work when first page loads, but on clicking / navigating to other pages (that match the
@match <url>
), the script doesn't run by default. It works only after refresh.Expected Behavior
Script runs on every link that navigated in the website, not only on the first page (or) when the page is refreshed.
Actual Behavior
Scripts runs only when the page is loaded (or) refreshed.
Specifications
Script
Ex. url : https://www.jiosaavn.com/lyrics/something-about-us-lyrics/FFwBQz19XAU