Adding Google Chrome support
| 
						 | 
					@ -1,3 +1,4 @@
 | 
				
			||||||
node_modules
 | 
					node_modules
 | 
				
			||||||
src/content-script.js
 | 
					src/content-script.js
 | 
				
			||||||
 | 
					src/popup.js
 | 
				
			||||||
dist
 | 
					dist
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -16,7 +16,8 @@
 | 
				
			||||||
        "english-verbs-helper": "3.3.1",
 | 
					        "english-verbs-helper": "3.3.1",
 | 
				
			||||||
        "english-verbs-irregular": "3.3.1",
 | 
					        "english-verbs-irregular": "3.3.1",
 | 
				
			||||||
        "rollup": "^4.27.3",
 | 
					        "rollup": "^4.27.3",
 | 
				
			||||||
        "web-ext": "^8.3.0"
 | 
					        "web-ext": "^8.3.0",
 | 
				
			||||||
 | 
					        "webextension-polyfill": "^0.12.0"
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
    "node_modules/@babel/code-frame": {
 | 
					    "node_modules/@babel/code-frame": {
 | 
				
			||||||
| 
						 | 
					@ -5277,6 +5278,13 @@
 | 
				
			||||||
        "npm": ">=8.0.0"
 | 
					        "npm": ">=8.0.0"
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
 | 
					    "node_modules/webextension-polyfill": {
 | 
				
			||||||
 | 
					      "version": "0.12.0",
 | 
				
			||||||
 | 
					      "resolved": "https://registry.npmjs.org/webextension-polyfill/-/webextension-polyfill-0.12.0.tgz",
 | 
				
			||||||
 | 
					      "integrity": "sha512-97TBmpoWJEE+3nFBQ4VocyCdLKfw54rFaJ6EVQYLBCXqCIpLSZkwGgASpv4oPt9gdKCJ80RJlcmNzNn008Ag6Q==",
 | 
				
			||||||
 | 
					      "dev": true,
 | 
				
			||||||
 | 
					      "license": "MPL-2.0"
 | 
				
			||||||
 | 
					    },
 | 
				
			||||||
    "node_modules/when": {
 | 
					    "node_modules/when": {
 | 
				
			||||||
      "version": "3.7.7",
 | 
					      "version": "3.7.7",
 | 
				
			||||||
      "resolved": "https://registry.npmjs.org/when/-/when-3.7.7.tgz",
 | 
					      "resolved": "https://registry.npmjs.org/when/-/when-3.7.7.tgz",
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -12,16 +12,17 @@
 | 
				
			||||||
  "license": "GPL-3.0-or-later",
 | 
					  "license": "GPL-3.0-or-later",
 | 
				
			||||||
  "scripts": {
 | 
					  "scripts": {
 | 
				
			||||||
    "test": "npx rollup -c && npx web-ext run -s src",
 | 
					    "test": "npx rollup -c && npx web-ext run -s src",
 | 
				
			||||||
    "build": "npx rollup -c && npx web-ext build -s src -a dist --ignore-files replace-words.js -o"
 | 
					    "build": "npx rollup -c && npx web-ext build -s src -a dist --ignore-files replace-words.js save-load-options.js icons/metamorpov.svg icons/svg-to-png.sh -o"
 | 
				
			||||||
  },
 | 
					  },
 | 
				
			||||||
  "devDependencies": {
 | 
					  "devDependencies": {
 | 
				
			||||||
    "@rollup/plugin-commonjs": "28.0.2",
 | 
					    "@rollup/plugin-commonjs": "28.0.2",
 | 
				
			||||||
 | 
					    "@rollup/plugin-json": "^6.1.0",
 | 
				
			||||||
    "@rollup/plugin-node-resolve": "15.3.0",
 | 
					    "@rollup/plugin-node-resolve": "15.3.0",
 | 
				
			||||||
    "english-verbs-gerunds": "3.3.1",
 | 
					    "english-verbs-gerunds": "3.3.1",
 | 
				
			||||||
    "english-verbs-helper": "3.3.1",
 | 
					    "english-verbs-helper": "3.3.1",
 | 
				
			||||||
    "english-verbs-irregular": "3.3.1",
 | 
					    "english-verbs-irregular": "3.3.1",
 | 
				
			||||||
    "rollup": "^4.27.3",
 | 
					    "rollup": "^4.27.3",
 | 
				
			||||||
    "web-ext": "^8.3.0",
 | 
					    "web-ext": "^8.3.0",
 | 
				
			||||||
    "@rollup/plugin-json": "^6.1.0"
 | 
					    "webextension-polyfill": "^0.12.0"
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -2,12 +2,24 @@ import resolve from '@rollup/plugin-node-resolve';
 | 
				
			||||||
import commonjs from '@rollup/plugin-commonjs';
 | 
					import commonjs from '@rollup/plugin-commonjs';
 | 
				
			||||||
import json from '@rollup/plugin-json';
 | 
					import json from '@rollup/plugin-json';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
export default {
 | 
					export default [
 | 
				
			||||||
  input: 'src/replace-words.js',
 | 
					  {
 | 
				
			||||||
  output: {
 | 
					    input: 'src/save-load-options.js',
 | 
				
			||||||
    file: 'src/content-script.js',
 | 
					    output: {
 | 
				
			||||||
    format: 'iife',
 | 
					      file: 'src/popup.js',
 | 
				
			||||||
    name: 'contentScript'
 | 
					      format: 'iife',
 | 
				
			||||||
 | 
					        name: 'popup'
 | 
				
			||||||
 | 
					    },
 | 
				
			||||||
 | 
					    plugins: [resolve(), commonjs(), json()]
 | 
				
			||||||
  },
 | 
					  },
 | 
				
			||||||
  plugins: [resolve(), commonjs(), json()]
 | 
					
 | 
				
			||||||
};
 | 
					  {
 | 
				
			||||||
 | 
					    input: 'src/replace-words.js',
 | 
				
			||||||
 | 
					    output: {
 | 
				
			||||||
 | 
					      file: 'src/content-script.js',
 | 
				
			||||||
 | 
					      format: 'iife',
 | 
				
			||||||
 | 
					        name: 'contentScript'
 | 
				
			||||||
 | 
					    },
 | 
				
			||||||
 | 
					    plugins: [resolve(), commonjs(), json()]
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					];
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
		 After Width: | Height: | Size: 15 KiB  | 
| 
		 After Width: | Height: | Size: 1022 B  | 
| 
		 After Width: | Height: | Size: 2.7 KiB  | 
| 
		 After Width: | Height: | Size: 4.6 KiB  | 
| 
		 After Width: | Height: | Size: 6.8 KiB  | 
| 
		 After Width: | Height: | Size: 11 KiB  | 
| 
		 Before Width: | Height: | Size: 6.6 KiB After Width: | Height: | Size: 6.6 KiB  | 
| 
						 | 
					@ -0,0 +1,10 @@
 | 
				
			||||||
 | 
					#!/usr/bin/env nix-shell
 | 
				
			||||||
 | 
					#!nix-shell -i bash -p inkscape
 | 
				
			||||||
 | 
					# Uses Inkscape to generate .png files from the provided input
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					inkscape -o 16x.png -w 16 $1
 | 
				
			||||||
 | 
					inkscape -o 32x.png -w 32 $1
 | 
				
			||||||
 | 
					inkscape -o 48x.png -w 48 $1
 | 
				
			||||||
 | 
					inkscape -o 64x.png -w 64 $1
 | 
				
			||||||
 | 
					inkscape -o 96x.png -w 96 $1
 | 
				
			||||||
 | 
					inkscape -o 128x.png -w 128 $1
 | 
				
			||||||
| 
						 | 
					@ -17,12 +17,12 @@
 | 
				
			||||||
  "action": {
 | 
					  "action": {
 | 
				
			||||||
    "default_title": "MetamorPOV",
 | 
					    "default_title": "MetamorPOV",
 | 
				
			||||||
    "default_icon": {
 | 
					    "default_icon": {
 | 
				
			||||||
      "16":  "metamorpov.svg",
 | 
					      "16":  "icons/16x.png",
 | 
				
			||||||
      "32":  "metamorpov.svg",
 | 
					      "32":  "icons/32x.png",
 | 
				
			||||||
      "48":  "metamorpov.svg",
 | 
					      "48":  "icons/48x.png",
 | 
				
			||||||
      "64":  "metamorpov.svg",
 | 
					      "64":  "icons/64x.png",
 | 
				
			||||||
      "96":  "metamorpov.svg",
 | 
					      "96":  "icons/96x.png",
 | 
				
			||||||
      "128": "metamorpov.svg"
 | 
					      "128": "icons/128x.png"
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
    "default_popup": "popup.html"
 | 
					    "default_popup": "popup.html"
 | 
				
			||||||
  },
 | 
					  },
 | 
				
			||||||
| 
						 | 
					@ -38,12 +38,12 @@
 | 
				
			||||||
  ],
 | 
					  ],
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  "icons": {
 | 
					  "icons": {
 | 
				
			||||||
    "16":  "metamorpov.svg",
 | 
					    "16":  "icons/16x.png",
 | 
				
			||||||
    "32":  "metamorpov.svg",
 | 
					    "32":  "icons/32x.png",
 | 
				
			||||||
    "48":  "metamorpov.svg",
 | 
					    "48":  "icons/48x.png",
 | 
				
			||||||
    "64":  "metamorpov.svg",
 | 
					    "64":  "icons/64x.png",
 | 
				
			||||||
    "96":  "metamorpov.svg",
 | 
					    "96":  "icons/96x.png",
 | 
				
			||||||
    "128": "metamorpov.svg"
 | 
					    "128": "icons/128x.png"
 | 
				
			||||||
  },
 | 
					  },
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  "content_scripts": [
 | 
					  "content_scripts": [
 | 
				
			||||||
| 
						 | 
					@ -58,9 +58,5 @@
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
  ],
 | 
					  ],
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  "background": {
 | 
					 | 
				
			||||||
    "page": "popup.html"
 | 
					 | 
				
			||||||
  },
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  "homepage_url": "https://git.viscogliosi-pate.com/jean/metamorpov"
 | 
					  "homepage_url": "https://git.viscogliosi-pate.com/jean/metamorpov"
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,3 +1,4 @@
 | 
				
			||||||
 | 
					var browser = require("webextension-polyfill");
 | 
				
			||||||
const verbsHelper = require("english-verbs-helper");
 | 
					const verbsHelper = require("english-verbs-helper");
 | 
				
			||||||
const verbsIrregular = require("english-verbs-irregular/dist/verbs.json");
 | 
					const verbsIrregular = require("english-verbs-irregular/dist/verbs.json");
 | 
				
			||||||
const verbsGerunds = require("english-verbs-gerunds/dist/gerunds.json");
 | 
					const verbsGerunds = require("english-verbs-gerunds/dist/gerunds.json");
 | 
				
			||||||
| 
						 | 
					@ -5,7 +6,8 @@ const verbsData = verbsHelper.mergeVerbsData(verbsIrregular, verbsGerunds);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* Replaces verbs, point-of-view, name, pronouns, and "also" terms */
 | 
					/* Replaces verbs, point-of-view, name, pronouns, and "also" terms */
 | 
				
			||||||
function replaceAll() {
 | 
					function replaceAll() {
 | 
				
			||||||
  browser.storage.local.get(null, (options) => {
 | 
					  let options = browser.storage.local.get();
 | 
				
			||||||
 | 
					  options.then((options) => {
 | 
				
			||||||
    const hostname = window.location.hostname;
 | 
					    const hostname = window.location.hostname;
 | 
				
			||||||
    const isEnabled = !(options.domains === undefined) && options.domains.includes(hostname);
 | 
					    const isEnabled = !(options.domains === undefined) && options.domains.includes(hostname);
 | 
				
			||||||
    if (!isEnabled) { return; }
 | 
					    if (!isEnabled) { return; }
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,3 +1,5 @@
 | 
				
			||||||
 | 
					var browser = require("webextension-polyfill");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
document.addEventListener("DOMContentLoaded", init);
 | 
					document.addEventListener("DOMContentLoaded", init);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
function init() {
 | 
					function init() {
 | 
				
			||||||
| 
						 | 
					@ -14,14 +16,15 @@ function init() {
 | 
				
			||||||
function loadDomain() {
 | 
					function loadDomain() {
 | 
				
			||||||
  let tabs = browser.tabs.query({ active: true, currentWindow: true });
 | 
					  let tabs = browser.tabs.query({ active: true, currentWindow: true });
 | 
				
			||||||
  tabs.then((tabs) => {
 | 
					  tabs.then((tabs) => {
 | 
				
			||||||
    const hostname = new URL(tabs[0].url).hostname;
 | 
					    const url = new URL(tabs[0].url);
 | 
				
			||||||
    document.querySelector("#domain").textContent = hostname;
 | 
					    const isAllowedProtocol = url.protocol == "https:" || url.protocol == "http:";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (!hostname) {
 | 
					    if (!isAllowedProtocol) {
 | 
				
			||||||
      disableToggle();
 | 
					      disableToggle();
 | 
				
			||||||
      return;
 | 
					      return;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    document.querySelector("#domain").textContent = url.hostname;
 | 
				
			||||||
    let storage = browser.storage.local.get("domains");
 | 
					    let storage = browser.storage.local.get("domains");
 | 
				
			||||||
    storage.then((storage) => {
 | 
					    storage.then((storage) => {
 | 
				
			||||||
      const hostname = document.querySelector("#domain").innerHTML;
 | 
					      const hostname = document.querySelector("#domain").innerHTML;
 | 
				
			||||||