mirror of
https://github.com/mdn/webextensions-examples.git
synced 2026-04-17 14:59:12 +02:00
Added page scripts and styles
This commit is contained in:
13
page-scripts/page-script.js
Normal file
13
page-scripts/page-script.js
Normal file
@@ -0,0 +1,13 @@
|
||||
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");
|
||||
Reference in New Issue
Block a user