Content script finds textareas

This commit is contained in:
Lexi / Zoe 2018-10-16 23:03:04 +02:00
parent 20c4aaa1d7
commit bc810fb9d0
1 changed files with 18 additions and 3 deletions

View File

@ -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";
});
})();