I'm trying to get the URL changed event on same tab, occurred on link click by the user.
I tried with followings in content script, but having some issues with them.
01-
document.addEventListener('DOMContentLoaded',
function () {
// My code here..
});
02-
window.addEventListener('load', function () {
// My code here..
});
03-
function nodeInsertedCallback(event) {
alert('NICE');
};
document.addEventListener
('DOMNodeInserted',nodeInsertedCallback);
01 and 02 are works fine on first URL navigation and page refresh, but not raises on link click by the user, and page navigates to another URL.
03 Fires many times per page load, and many times on user link click.
I'm looking for event which triggers only once when the tab changes it's URL by user action, or page refresh.
Is there any better solution than these? Any help would be appreciated.