From 8512fa5f2506456b05f73b741aee9746a7130b2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20F=2E=20Sch=C3=B6nitzer?= Date: Sun, 8 Apr 2018 13:11:03 +0200 Subject: [PATCH] Add feature: disable highlight menu --- content.js | 10 ++++++++++ manifest.json | 2 +- options.html | 4 ++++ options.js | 8 ++++++-- 4 files changed, 21 insertions(+), 3 deletions(-) diff --git a/content.js b/content.js index 7f2c08e..a9d807e 100644 --- a/content.js +++ b/content.js @@ -15,6 +15,13 @@ var makeReadable = function() { } }; +var hideHighlightMenu = function() { + var bar = document.querySelector('.highlightMenu'); + if (bar) { + bar.style.display = 'none'; + } +}; + var hideDickbar = function() { var dickbar = document.querySelector('.js-postShareWidget'); if (dickbar) { @@ -76,6 +83,9 @@ if (document.querySelector('head meta[property="al:ios:app_name"][content="mediu if (items.disableLazyImages) { disableLazyLoading(); } + if (items.hideHighlightMenu) { + hideHighlightMenu(); + } }); observer.observe(document.body, config); diff --git a/manifest.json b/manifest.json index c634d03..1c2d4f9 100644 --- a/manifest.json +++ b/manifest.json @@ -3,7 +3,7 @@ "name": "Make Medium Readable Again", "description": "Neutralizes annoying parts of the Medium reading experience and lets you read again.", - "version": "1.3.1", + "version": "1.4.0", "applications": { "gecko": { diff --git a/options.html b/options.html index f1ed022..95b4549 100644 --- a/options.html +++ b/options.html @@ -25,6 +25,10 @@ Disable lazy image loading + +

Default Features

diff --git a/options.js b/options.js index 6d9a95e..17fc11d 100644 --- a/options.js +++ b/options.js @@ -2,9 +2,11 @@ function save_options() { var hideDickbar = document.getElementById('dickbar').checked; var disableLazyImages = document.getElementById('images').checked; + var hideHighlightMenu = document.getElementById('highlight').checked; chrome.storage.sync.set({ hideDickbar: hideDickbar, - disableLazyImages: disableLazyImages + disableLazyImages: disableLazyImages, + hideHighlightMenu: hideHighlightMenu }, function() { // Update status to let user know options were saved. var status = document.getElementById('status'); @@ -20,10 +22,12 @@ function save_options() { function restore_options() { chrome.storage.sync.get({ hideDickbar: false, - disableLazyImages: false + disableLazyImages: false, + hideHighlightMenu: false }, function(items) { document.getElementById('dickbar').checked = items.hideDickbar; document.getElementById('images').checked = items.disableLazyImages; + document.getElementById('highlight').checked = items.hideHighlightMenu; }); } document.addEventListener('DOMContentLoaded', restore_options);