# HG changeset patch # User nanaya # Date 1677409777 -32400 # Node ID 49658e99888a226cf1d61467674a2be57117012b # Parent dc960ef1248bbe06e5dc0c9f08d8160780ca7849 [medium] update class name and use document level styling instead diff -r dc960ef1248b -r 49658e99888a medium-popup-disable.user.js --- a/medium-popup-disable.user.js Tue Feb 07 21:51:34 2023 +0900 +++ b/medium-popup-disable.user.js Sun Feb 26 20:09:37 2023 +0900 @@ -1,24 +1,22 @@ // ==UserScript== // @name Medium popup disable // @namespace https://nanaya.net -// @version 1.0.7 +// @version 1.1.0 // @description Strip out Medium's highlighting popup "feature" // @author nanaya // @match https://medium.com/* // @match https://blog.medium.com/* // @match https://m.signalvnoise.com/* // @match https://hackernoon.com/* -// @grant none +// @grant GM_addStyle // @downloadURL https://hg.nanaya.net/ec-userscripts/raw-file/tip/medium-popup-disable.user.js // ==/UserScript== 'use strict'; -const popups = document.getElementsByClassName('highlightMenu'); -const killPopup = function (popup) { - popup.style.display = 'none'; -}; -const killPopups = function () { - Array.prototype.forEach.call(popups, killPopup); -}; -document.addEventListener('click', killPopups); +/* global GM_addStyle */ +GM_addStyle(` + [data-popper-reference-hidden] { + display: none !important; + } +`);