From 9b5c3a23e599c5b1019e4729b25c60820eacb49f Mon Sep 17 00:00:00 2001 From: Matt Baer Date: Fri, 29 Jun 2018 17:16:22 -0400 Subject: [PATCH] Add basic safari support --- MMRA.safariextension/Icon-32.png | Bin 0 -> 1220 bytes MMRA.safariextension/Icon-48.png | Bin 0 -> 2181 bytes MMRA.safariextension/Icon-64.png | Bin 0 -> 2069 bytes MMRA.safariextension/Info.plist | 52 ++++++++++++++ MMRA.safariextension/Settings.plist | 5 ++ MMRA.safariextension/content.js | 107 ++++++++++++++++++++++++++++ MMRA.safariextension/medium.css | 16 +++++ 7 files changed, 180 insertions(+) create mode 100644 MMRA.safariextension/Icon-32.png create mode 100644 MMRA.safariextension/Icon-48.png create mode 100644 MMRA.safariextension/Icon-64.png create mode 100644 MMRA.safariextension/Info.plist create mode 100644 MMRA.safariextension/Settings.plist create mode 100644 MMRA.safariextension/content.js create mode 100644 MMRA.safariextension/medium.css diff --git a/MMRA.safariextension/Icon-32.png b/MMRA.safariextension/Icon-32.png new file mode 100644 index 0000000000000000000000000000000000000000..e719a77098516445394bb08158fa5ecfcfec75aa GIT binary patch literal 1220 zcmV;#1UvhQP)+521W`#u zK~z}7?UqYyRAm&$f8Tc>Go5>9TB51xLaDS^65SY+BG8hS5)dVrKnN639<7jAd6ktU z63apo2v`Ln4nZDTfwW06C9tp&ijX!WO-xyo5Gj!bNF$c%bYAz->tf2p0@aRz5F>Z{ zo%`M2J?DSU`HS9xKRlk`BYDElQ-Fs9cpd@6zzl^RdhGN2F@r&b5GbmO84RNPd=JD4 zAuvNB{C!AzPH zi8xDFt>U`_2M|I4kV>VOX=r`%VQdJz=CYYPcU?h?O zaBPQVwY7Y`cQ2Z*BZQzS9HzRa27$;xWd)Fk$59l8m34K5Kif@CAVAB}qby#r0>d;J zj6@J3eYxv6Je!}->*eK~YHlVc5a9N$TLes#U?@1MG~)+|#nAnJib_f-EH0+=+&OwL zU#76QIFkV>B|=DC*Tu3dYBp@(tKGZl?C4_&?AgR)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ow6}cch3E13e8hB}+$D?qI-``r z_RGD^j z%8QHX^7{#NcXRCEK~~J2%Qw@~s3%!aBeezR#)-))gmWl;A5nx;`+RK(70 z+nAT1&)R|lq?A}J7NXGzi)ZK1diE^y7A@kX4I8d|lIu=LVCsYkv|YMH&Hnw2N=X?S z9w4PeN{Ld6#H1u*u^37zbX`XXjSZVO6Vr97%gVUXDgN;zhv{f<$K`hO_RgJX7R%5x z!Fcn0{KSbwqfr3Px3e|KmP@qrm?5C7VS1KJ?^?yK=19mloGGkcU>=e zx3-p9x$~Gke?Ij7{z?EicIXfehl5cmDU2AI9JkKih6bk2nuXnFW8T6=M8aWe%F7Ki zL&E_GA+Xu)w70df=_du~y3WSJLV|(7HFX_MCv_DS%w4z;UDru{IGu;bj-}<)DgJT# z^w0qygy2N;ao#R3r*z8}US7PIX&D&|PfDbsv5~PE8FAZP`s_1WPMsoa>QtcT&Ck62 zd>jr(uNi7XCjxXmMrTI{4OLYfKXQb^vNCG+?zjCQ-(F5MH}h^?J=12*yk_nH z!|$tkVZj2{tY6=AF``u8RB^go{AJHOoc{P@&a|}f!06F;Zv@Ee%j8Z8@C=?x4`tIp9i#Fgx zr#<%^ld`e^cy-l^0S}=5SXW0ZKR>98mq;^h4cTR)8E0ul`DHLMPspR9z`JpmoHxA8`;@R%FZ6J zV;qcata&wNo(Y-&OaLYT6MzZ81YiQVSId6^I!220qSTwo00000NkvXXu0mjf9c${? literal 0 HcmV?d00001 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