From fb8514b1fc4b5bfc7a42a42d2b738dd0e91a644d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sof=C3=ADa=20Aritz?= Date: Sun, 22 Oct 2023 10:33:19 +0000 Subject: [PATCH] Add userscript --- userscript.js | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 userscript.js diff --git a/userscript.js b/userscript.js new file mode 100644 index 0000000..9f4ebfa --- /dev/null +++ b/userscript.js @@ -0,0 +1,22 @@ +// ==UserScript== +// @name Use native HTML color input +// @namespace http://sofiaritz.com/ +// @version 0.1 +// @description Replaces minicolors with the native HTML color input +// @author SofĂ­a Aritz +// @match https:///* +// @icon https://www.google.com/s2/favicons?sz=64&domain= +// @grant none +// ==/UserScript== + +(function() { + 'use strict'; + + Array.from(document.getElementsByClassName("minicolors-input")).forEach(v => { + v.type = "color" + v.classList = [] + }) + + Array.from(document.getElementsByClassName("minicolors-swatch")).forEach(v => v.remove()) + Array.from(document.getElementsByClassName("precolors")).forEach(v => v.remove()) +})(); \ No newline at end of file