Browse Source

version 1.2.1

changed it to add a class to the document root element
instead of a style tag to the head
some sites like youtube would remove the style tag or csp could block it
master
Rei 2 years ago
parent
commit
0354d802fa
4 changed files with 11 additions and 9 deletions
  1. +1
    -0
      createXPI.sh
  2. +5
    -0
      main.css
  3. +3
    -8
      main.js
  4. +2
    -1
      manifest.json

+ 1
- 0
createXPI.sh View File

@@ -3,6 +3,7 @@
zip -r -FS ../my-extension.xpi \
icons/logo-*.png \
main.js \
main.css \
manifest.json \
settings.html \
settings.js \

+ 5
- 0
main.css View File

@@ -0,0 +1,5 @@
.no-caps-addon-activated,
.no-caps-addon-activated * {
text-transform: lowercase !important;
font-variant: inherit !important;
}

+ 3
- 8
main.js View File

@@ -1,3 +1,5 @@
const classname = "no-caps-addon-activated";

function onError(error) {
console.log(`Error: ${error}`);
}
@@ -16,14 +18,7 @@ function initialize(item) {
}
}

// Create a new style element
let css = document.createElement("style");
css.type = "text/css";
// Add our CSS
css.innerHTML = `* {
text-transform: lowercase !important;
}`;
document.head.appendChild(css);
document.documentElement.classList.add(classname);

// Set the title to lowercase
document.title = document.title.toLowerCase();

+ 2
- 1
manifest.json View File

@@ -1,7 +1,7 @@
{
"manifest_version": 2,
"name": "no-caps",
"version": "1.2",
"version": "1.2.1",

"icons": {
"48": "icons/logo-48.png",
@@ -15,6 +15,7 @@
{
"matches": ["<all_urls>"],
"js": ["main.js"],
"css": ["main.css"],
"run_at": "document_start"
}
],

Loading…
Cancel
Save