mirror of
https://github.com/mdn/webextensions-examples.git
synced 2026-04-16 06:18:35 +02:00
14 lines
423 B
JavaScript
14 lines
423 B
JavaScript
var p = document.createElement("p");
|
|
p.textContent = "This paragraph was added by a page script.";
|
|
p.setAttribute("id", "page-script-para");
|
|
document.body.appendChild(p);
|
|
|
|
window.foo = "This global variable was added by a page script";
|
|
|
|
window.confirm = function() {
|
|
alert("The page script has also redefined 'confirm'");
|
|
}
|
|
|
|
// add controls
|
|
insertControls(document.getElementById("left-column"), "Page script controls");
|