diff --git a/MMRA.safariextension/Icon-32.png b/MMRA.safariextension/Icon-32.png new file mode 100644 index 0000000..e719a77 Binary files /dev/null and b/MMRA.safariextension/Icon-32.png differ diff --git a/MMRA.safariextension/Icon-48.png b/MMRA.safariextension/Icon-48.png new file mode 100644 index 0000000..a63524a Binary files /dev/null and b/MMRA.safariextension/Icon-48.png differ diff --git a/MMRA.safariextension/Icon-64.png b/MMRA.safariextension/Icon-64.png new file mode 100644 index 0000000..4e71285 Binary files /dev/null and b/MMRA.safariextension/Icon-64.png differ diff --git a/MMRA.safariextension/Info.plist b/MMRA.safariextension/Info.plist new file mode 100644 index 0000000..0a5784a --- /dev/null +++ b/MMRA.safariextension/Info.plist @@ -0,0 +1,52 @@ + + + + + Author + Matt Baer + Builder Version + 12605.2.8 + CFBundleDisplayName + Make Medium Readable Again + CFBundleIdentifier + com.abunchtell.mmra + CFBundleInfoDictionaryVersion + 6.0 + CFBundleShortVersionString + 1.5 + CFBundleVersion + 1 + Content + + Scripts + + Start + + content.js + + + Stylesheets + + medium.css + + + Description + Make Medium less annoying + DeveloperIdentifier + TPPAB4YBA6 + ExtensionInfoDictionaryVersion + 1.0 + Permissions + + Website Access + + Include Secure Pages + + Level + All + + + Website + https://github.com/thebaer/MMRA + + diff --git a/MMRA.safariextension/Settings.plist b/MMRA.safariextension/Settings.plist new file mode 100644 index 0000000..5dd5da8 --- /dev/null +++ b/MMRA.safariextension/Settings.plist @@ -0,0 +1,5 @@ + + + + + diff --git a/MMRA.safariextension/content.js b/MMRA.safariextension/content.js new file mode 100644 index 0000000..d79668b --- /dev/null +++ b/MMRA.safariextension/content.js @@ -0,0 +1,107 @@ +// +// Make Medium Readable Again +// + +var makeReadable = function() { + // Un-position:fixed the top nav bar + var topNav = document.querySelector('.metabar.u-fixed'); + if (topNav) { + 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') { + browser = chrome; + } + document.head.insertAdjacentHTML('beforeend', ''); +}; + +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) { + dickbar.style.display = 'none'; + } + var footerDickbar = document.querySelector('footer > .container:first-child'); + if (footerDickbar) { + footerDickbar.style.display = 'none'; + } +}; + +var disableLazyLoading = function() { + // Get all