diff --git a/README.md b/README.md index 1c160c1..cd4a383 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,7 @@ This is that Chrome extension. [Install it here](https://chrome.google.com/webst * Keeping the top navigation bar from sticking around * Hiding the bottom "Get Updates" bar completely * (Optionally) hiding the clap / share bar +* (Optionally) loading all post images up front, instead of lazy loading as you scroll ### Preview diff --git a/background.js b/background.js index 7747678..065c2b9 100644 --- a/background.js +++ b/background.js @@ -16,8 +16,26 @@ var makeReadable = function() { }; var hideDickbar = function() { - document.querySelector('.js-postShareWidget').style.display = 'none'; - document.querySelector('footer > .container:first-child').style.display = 'none'; + var dickbar = document.querySelector('.js-postShareWidget'); + if (dickbar != null) { + dickbar.style.display = 'none'; + } + var footerDickbar = document.querySelector('footer > .container:first-child'); + if (footerDickbar != null) { + footerDickbar.style.display = 'none'; + } +}; + +var disableLazyLoading = function() { + var hiddenMedia = document.querySelectorAll('.js-progressiveMedia-inner'); + if (hiddenMedia == null) { + return; + } + for (var i=0; i Hide sharing dickbar + +

Defaults

diff --git a/options.js b/options.js index 27de99d..6d9a95e 100644 --- a/options.js +++ b/options.js @@ -1,8 +1,10 @@ // Saves options to chrome.storage function save_options() { var hideDickbar = document.getElementById('dickbar').checked; + var disableLazyImages = document.getElementById('images').checked; chrome.storage.sync.set({ - hideDickbar: hideDickbar + hideDickbar: hideDickbar, + disableLazyImages: disableLazyImages }, function() { // Update status to let user know options were saved. var status = document.getElementById('status'); @@ -17,9 +19,11 @@ function save_options() { // stored in chrome.storage. function restore_options() { chrome.storage.sync.get({ - hideDickbar: false + hideDickbar: false, + disableLazyImages: false }, function(items) { document.getElementById('dickbar').checked = items.hideDickbar; + document.getElementById('images').checked = items.disableLazyImages; }); } document.addEventListener('DOMContentLoaded', restore_options);