Content script finds textareas
This commit is contained in:
parent
20c4aaa1d7
commit
bc810fb9d0
|
|
@ -1,4 +1,19 @@
|
|||
// Example code, taken from
|
||||
// https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/Your_first_WebExtension
|
||||
// ---------------------------------
|
||||
// Content script to be run on pages
|
||||
// ---------------------------------
|
||||
|
||||
document.body.style.border = "5px solid red";
|
||||
(function() {
|
||||
// Only run this script once
|
||||
if (window.hasRun) {
|
||||
return;
|
||||
}
|
||||
window.hasRun = true;
|
||||
|
||||
// Search for all text areas
|
||||
document.querySelectorAll("textarea").forEach(function(textarea) {
|
||||
// Do something with it...
|
||||
console.log(textarea);
|
||||
textarea.style.border = "2px solid red";
|
||||
});
|
||||
|
||||
})();
|
||||
|
|
|
|||
Loading…
Reference in New Issue