Mercurial > ec-userscripts
comparison medium-popup-disable.user.js @ 109:ef21ef445fc6
Cleanups
- wrap everything in function and call them last
- fix namespace and update url
author | nanaya <me@nanaya.net> |
---|---|
date | Sun, 15 Jan 2023 23:33:41 +0900 |
parents | 2c4470b73ad9 |
children | d9dc190bccaf |
comparison
equal
deleted
inserted
replaced
108:2c4470b73ad9 | 109:ef21ef445fc6 |
---|---|
1 // ==UserScript== | 1 // ==UserScript== |
2 // @name Medium popup disable | 2 // @name Medium popup disable |
3 // @namespace https://myconan.net | 3 // @namespace https://nanaya.net |
4 // @version 1.0.7 | 4 // @version 1.0.7 |
5 // @description Strip out Medium's highlighting popup "feature" | 5 // @description Strip out Medium's highlighting popup "feature" |
6 // @author nanaya | 6 // @author nanaya |
7 // @match https://medium.com/* | 7 // @match https://medium.com/* |
8 // @match https://blog.medium.com/* | 8 // @match https://blog.medium.com/* |
9 // @match https://m.signalvnoise.com/* | 9 // @match https://m.signalvnoise.com/* |
10 // @match https://hackernoon.com/* | 10 // @match https://hackernoon.com/* |
11 // @grant none | 11 // @grant none |
12 // @downloadURL https://hg.myconan.net/ec-userscripts/raw-file/tip/medium-popup-disable.user.js | 12 // @downloadURL https://hg.nanaya.net/ec-userscripts/raw-file/tip/medium-popup-disable.user.js |
13 // ==/UserScript== | 13 // ==/UserScript== |
14 | 14 |
15 (function () { | 15 'use strict'; |
16 'use strict'; | 16 |
17 function removeHighlightPopup () { | |
17 const popups = document.getElementsByClassName('highlightMenu'); | 18 const popups = document.getElementsByClassName('highlightMenu'); |
18 const killPopup = function (popup) { | 19 const killPopup = function (popup) { |
19 popup.style.display = 'none'; | 20 popup.style.display = 'none'; |
20 }; | 21 }; |
21 const killPopups = function () { | 22 const killPopups = function () { |
22 Array.prototype.forEach.call(popups, killPopup); | 23 Array.prototype.forEach.call(popups, killPopup); |
23 }; | 24 }; |
24 document.addEventListener('click', killPopups); | 25 document.addEventListener('click', killPopups); |
25 }).call(); | 26 } |
27 | |
28 removeHighlightPopup(); |