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

Merge pull request #10 from panckreous/ridiculous-header

Add option to resize ridiculous massive headers
This commit is contained in:
Matt Baer 2017-09-05 21:06:15 -04:00 committed by GitHub
commit 92cd527e93
2 changed files with 17 additions and 1 deletions

View File

@ -38,8 +38,19 @@ var disableLazyLoading = function() {
}
};
var shrinkHeaderImages = function() {
var ridiculousHeaderImage = document.querySelector('figure.graf--layoutFillWidth');
if (ridiculousHeaderImage != null) {
ridiculousHeaderImage.style.maxWidth = '700px';
ridiculousHeaderImage.style.margin = '0 auto';
}
}
var observer = new MutationObserver(function(mutations){
mutations.forEach(makeReadable);
mutations.forEach(function(){
makeReadable();
shrinkHeaderImages();
});
});
var config = {attributes: true};
@ -49,6 +60,7 @@ var config = {attributes: true};
var metaCheck = document.head.querySelector('meta[property="al:ios:app_name"]');
if (metaCheck != null && metaCheck.content == "Medium") {
makeReadable();
shrinkHeaderImages();
chrome.storage.sync.get(null, function(items) {
if (items.hideDickbar) {

View File

@ -37,6 +37,10 @@
<input type="checkbox" checked="checked" disabled="disabled"> Hide bottom <em>Get Updates</em> bar
</label>
<label>
<input type="checkbox" checked="checked" disabled="disabled"> Make massive header images less ridiculous
</label>
<hr />
<p id="status"></p>