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 a6c28ff..2c8f601 100644 --- a/medium.css +++ b/medium.css @@ -5,6 +5,12 @@ .postMeterBar, .openInAppButton, .js-stickyFooter, -.js-upgradeMembershipAction { +.js-upgradeMembershipAction, +.butterBar--privacy { display: none; } + +/* Makes the page scrollable after hiding "Pardon the interruption" popup */ +html.u-overflowHidden { + overflow-y: scroll !important; +}