From 3581f659f7994093efdcb6c944d2fbdfe3360ac4 Mon Sep 17 00:00:00 2001 From: Matt Baer Date: Tue, 10 Apr 2018 11:58:44 -0400 Subject: [PATCH] Hide postMeterBar & do it with CSS instead of JS This hides the `postMeterBar` (closing #19) and, since it wasn't possible with JS, includes the style with an injected stylesheet (closing #8). --- content.js | 7 +++++++ manifest.json | 3 +++ medium.css | 3 +++ 3 files changed, 13 insertions(+) create mode 100644 medium.css diff --git a/content.js b/content.js index a9d807e..3bce012 100644 --- a/content.js +++ b/content.js @@ -13,6 +13,13 @@ var makeReadable = function() { if (getUpdatesBar) { getUpdatesBar.style.display = 'none'; } + + // Load remaining styles + // This check makes sure the extension works on Chrome and Firefox. + if (typeof browser === 'undefined') { + browser = chrome; + } + document.head.insertAdjacentHTML('beforeend', ''); }; var hideHighlightMenu = function() { diff --git a/manifest.json b/manifest.json index 1c2d4f9..cf2273b 100644 --- a/manifest.json +++ b/manifest.json @@ -29,5 +29,8 @@ "matches": ["https://*/*"], "js": ["content.js"] } + ], + "web_accessible_resources": [ + "medium.css" ] } diff --git a/medium.css b/medium.css new file mode 100644 index 0000000..05ebd1b --- /dev/null +++ b/medium.css @@ -0,0 +1,3 @@ +.postMeterBar { + display: none; +}