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