We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
window.onurlchange
Example:
// ==UserScript== // @name Test urlchange // @namespace http://tampermonkey.net/ // @version 2025-01-21 // @description try to take over the world! // @author You // @match https://example.com/* // @icon https://www.google.com/s2/favicons?sz=64&domain=example.com // @grant window.onurlchange // ==/UserScript== const div = document.querySelector("div"); div.insertAdjacentHTML("beforeend", ` <a href="/" class="link">root</a> <a href="/sub" class="link">/sub</a> <a href="#foo" class="link">#foo</a> <a href="#bar" class="link">#bar</a> <a href="#test" class="link">#test</a> <br> <textarea placeholder="logs" readonly cols=72 rows=20></textarea> `); const textarea = div.lastElementChild; window.addEventListener("click", (ev) => { if (!ev.target.classList.contains("link")) return; ev.preventDefault(); window.history.pushState(null, "", ev.target.href); }, true); window.addEventListener("urlchange", () => { textarea.value += window.location.href + "\n"; });
Go to https://example.com/ and click the links.
Each navigation is logged
Hash change isn't logged, while path change and clicking the same link is logged.
TM v5.3.3
P.S.: the issue template is gone (not supported anymore) and should be re-added via the new method
The text was updated successfully, but these errors were encountered:
Thanks a lot for reporting!
The issue should be fixed at 5.4.6225 (crx)
Please download the crx file linked above and drag and drop it to the extensions page chrome://extensions (after you've enabled 'Developer Mode').
chrome://extensions
For a quick fix please export your settings and scripts as zip or (JSON) file at the "Utilities" tab and import it back at the fixed BETA version.
Sorry, something went wrong.
No branches or pull requests
Example:
Go to https://example.com/ and click the links.
Expected
Each navigation is logged
Actual
Hash change isn't logged, while path change and clicking the same link is logged.
TM v5.3.3
P.S.: the issue template is gone (not supported anymore) and should be re-added via the new method
The text was updated successfully, but these errors were encountered: