From fe18384ee0612944851dc8e9a090b851469bcb7b Mon Sep 17 00:00:00 2001 From: Matt Baer Date: Sun, 27 Aug 2017 20:17:08 -0400 Subject: [PATCH] Add basic MMRA Chrome extension --- background.js | 23 +++++++++++++++++++++++ manifest.json | 17 +++++++++++++++++ 2 files changed, 40 insertions(+) create mode 100644 background.js create mode 100644 manifest.json diff --git a/background.js b/background.js new file mode 100644 index 0000000..85d2654 --- /dev/null +++ b/background.js @@ -0,0 +1,23 @@ +// +// Make Medium Readable Again +// + +var makeReadable = function() { + // Un-position:fixed the top nav bar + var topNav = document.querySelector('.metabar.u-fixed'); + if (topNav != null) { + topNav.classList.remove('u-fixed'); + } + // Remove the footer + var getUpdatesBar = document.querySelector('.js-stickyFooter'); + if (getUpdatesBar != null) { + getUpdatesBar.style.display = 'none'; + } +}; + +// Only run this on Medium sites. +// Ensure that by checking for in the document +var metaCheck = document.head.querySelector('meta[property="al:ios:app_name"]'); +if (metaCheck != null && metaCheck.content == "Medium") { + makeReadable(); +} diff --git a/manifest.json b/manifest.json new file mode 100644 index 0000000..68c498c --- /dev/null +++ b/manifest.json @@ -0,0 +1,17 @@ +{ + "manifest_version": 2, + + "name": "Make Medium Readable Again", + "description": "Neutralizes annoying parts of the Medium reading experience so it's more enjoyable to read things.", + "version": "1.0", + + "permissions": [ + "https://*/*" + ], + "content_scripts": [ + { + "matches": ["https://*/*"], + "js": ["background.js"] + } + ] +}