1
0
mirror of https://github.com/thebaer/MMRA synced 2024-11-13 10:11:01 +00:00

Add basic MMRA Chrome extension

This commit is contained in:
Matt Baer 2017-08-27 20:17:08 -04:00
parent 132c1555e9
commit fe18384ee0
2 changed files with 40 additions and 0 deletions

23
background.js Normal file
View File

@ -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 <meta property="al:ios:app_name" content="Medium"> in the document <head />
var metaCheck = document.head.querySelector('meta[property="al:ios:app_name"]');
if (metaCheck != null && metaCheck.content == "Medium") {
makeReadable();
}

17
manifest.json Normal file
View File

@ -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"]
}
]
}