Logs the target URLs and extra transition information for onReferenceFragmentUpdated, if the target URL's hostname contains "example.com" or starts with "developer".
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);