Detect-Nav

Detect url change on Chrome/Firefox (Greasemonkey, Firemonkey, Violentmonkey, Tampermonkey)

ئاپتورى
GTK
بۈگۈن قاچىلانغىنى
0
جەمئىي قاچىلانغىنى
14
باھا نومۇرى
0 0 0
نەشرى
0.1
قۇرۇلغان ۋاقتى
2024-08-16
يېڭىلانغان ۋاقتى
2024-08-16
Size
3.7 KB
ئىجازەتنامىسى
يوق
قوللايدىغىنى
بارلىق بېكەتلەر

A cross browser (Chrome/Firefox) script to detect url change on SPAs. Works on Greasemonkey, Firemonkey, Violentmonkey, Tampermonkey.

Usage:

  • This script works when installed or imported (@require).
  • A CustomEvent detectnavigate will be dispatched after the navigation (navigatesuccess).
  • Other scripts can listen for the detectnavigate event. eg: window.addEventListener("detectnavigate", e => console.log(e.detail))

detectnavigate event detail:

method : the method used to navigate/detect the navigation.
   oldUrl : the URL before navigation.
 newUrl : the URL after navigation.