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