From 3581f659f7994093efdcb6c944d2fbdfe3360ac4 Mon Sep 17 00:00:00 2001 From: Matt Baer Date: Tue, 10 Apr 2018 11:58:44 -0400 Subject: [PATCH 1/2] 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; +} From 37a9b56d2e479a1b9845e52d22e4d33002064878 Mon Sep 17 00:00:00 2001 From: Matt Baer Date: Tue, 10 Apr 2018 12:04:55 -0400 Subject: [PATCH 2/2] Add intro comment to medium.css --- medium.css | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/medium.css b/medium.css index 05ebd1b..62d8d3a 100644 --- a/medium.css +++ b/medium.css @@ -1,3 +1,7 @@ +/** + * medium.css + * Contains default styles to inject into Medium publications. + */ .postMeterBar { display: none; }