const filter = {
url: [{ hostContains: "example.com" }, { hostPrefix: "developer" }],
};
function logOnReferenceFragmentUpdated(details) {
console.log(`onReferenceFragmentUpdated: ${details.url}`);
console.log(`Transition type: ${details.transitionType}`);
console.log(`Transition qualifiers: ${details.transitionQualifiers}`);
}
browser.webNavigation.onReferenceFragmentUpdated.addListener(
logOnReferenceFragmentUpdated,
filter,
);webNavigation.onReferenceFragmentUpdated / notebook
webNavigation.onReferenceFragmentUpdated
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.