const reloadButton = document.querySelector("#reload-button");
reloadButton.addEventListener("click", () => {
browser.devtools.inspectedWindow.reload({
injectedScript: "alert(navigator.userAgent);",
userAgent: "Not a real UA",
});
});devtools.inspectedWindow.reload() / notebook
devtools.inspectedWindow.reload()
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.