From 8f8e09ef90337090be113143ccbf134c28903031 Mon Sep 17 00:00:00 2001 From: Jorge Gonzalez Date: Tue, 17 Apr 2018 18:36:36 -0400 Subject: [PATCH 1/4] Hide some annoyances This hides the "Pardon the Interruption" message and the "Do not track" banners. --- medium.css | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/medium.css b/medium.css index a6c28ff..209e0b0 100644 --- a/medium.css +++ b/medium.css @@ -5,6 +5,8 @@ .postMeterBar, .openInAppButton, .js-stickyFooter, -.js-upgradeMembershipAction { +.js-upgradeMembershipAction, +.butterBar--privacy, +.overlay--lighter { display: none; } From 05a971878f35189fa8e27c794f337383364086ab Mon Sep 17 00:00:00 2001 From: Jorge Gonzalez Date: Tue, 17 Apr 2018 18:51:34 -0400 Subject: [PATCH 2/4] Update medium.css --- medium.css | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/medium.css b/medium.css index 209e0b0..9dcde2d 100644 --- a/medium.css +++ b/medium.css @@ -7,6 +7,11 @@ .js-stickyFooter, .js-upgradeMembershipAction, .butterBar--privacy, +.overlay, .overlay--lighter { display: none; } + +.u-overflowHidden { + overflow: scroll !important; +} From 9d4599f554a5b487bb2b2bf099550bbcbecd0bd5 Mon Sep 17 00:00:00 2001 From: Matt Baer Date: Wed, 25 Apr 2018 20:39:10 -0400 Subject: [PATCH 3/4] Fix scrolling after hiding "pardon the interruption" popup --- medium.css | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/medium.css b/medium.css index 9dcde2d..f3aa7e7 100644 --- a/medium.css +++ b/medium.css @@ -12,6 +12,7 @@ display: none; } -.u-overflowHidden { - overflow: scroll !important; +/* Makes the page scrollable after hiding "Pardon the interruption" popup */ +html.u-overflowHidden { + overflow-y: scroll !important; } From 159e44a19d5cd3cc08d486c3f6bdbbca1f732f1b Mon Sep 17 00:00:00 2001 From: Matt Baer Date: Wed, 25 Apr 2018 22:39:17 -0400 Subject: [PATCH 4/4] Block "Pardon the interruption" popup This blocks the annoying "Pardon the interruption" dialog without preventing other parts of the UI from working correctly (basically. see comments). --- content.js | 13 +++++++++++++ medium.css | 4 +--- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/content.js b/content.js index 3d324e2..d79668b 100644 --- a/content.js +++ b/content.js @@ -9,6 +9,19 @@ var makeReadable = function() { topNav.classList.remove('u-fixed'); } + // Remove the "Pardon the interruption" popup. + // We do this with JS because the .overlay.overlay--lighter element is used + // for interactions we consent to, like the sign up / log in dialogs, so we + // don't want to obliterate them too. + // FIXME: prevent this from breaking signup/login dialogs when the popup + // is removed (it works after changing pages). + var headings = document.evaluate("//h1[contains(., 'Pardon the interruption.')]", document, null, XPathResult.ANY_TYPE, null ); + var thisHeading = headings.iterateNext(); + if (thisHeading != null) { + var $overlay = thisHeading.parentNode.parentNode.parentNode.parentNode; + $overlay.parentNode.removeChild($overlay); + } + // Inject remaining styles // This check makes sure the extension works on Chrome and Firefox. if (typeof browser === 'undefined') { diff --git a/medium.css b/medium.css index f3aa7e7..2c8f601 100644 --- a/medium.css +++ b/medium.css @@ -6,9 +6,7 @@ .openInAppButton, .js-stickyFooter, .js-upgradeMembershipAction, -.butterBar--privacy, -.overlay, -.overlay--lighter { +.butterBar--privacy { display: none; }