Detect-Nav

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

Penulis
GTK
Pemasangan harian
0
Total pemasangan
14
Nilai
0 0 0
Versi
0.1
Dibuat
16 Agustus 2024
Diperbarui
16 Agustus 2024
Size
3,74 KB
Lisensi
N/A
Berlaku untuk
Semua situs

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.