diff --git a/background.js b/background.js
index c10c0fe..89d8a50 100644
--- a/background.js
+++ b/background.js
@@ -20,6 +20,18 @@ var hideDickbar = function() {
document.querySelector('footer > .container:first-child').style.display = 'none';
};
+var disableLazyLoading = function() {
+ var hiddenMedia = document.querySelectorAll('.js-progressiveMedia-inner');
+ if (hiddenMedia == null) {
+ return;
+ }
+ for (var i=0; i in the document
var metaCheck = document.head.querySelector('meta[property="al:ios:app_name"]');
@@ -30,5 +42,8 @@ if (metaCheck != null && metaCheck.content == "Medium") {
if (items.hideDickbar) {
hideDickbar();
}
+ if (items.disableLazyImages) {
+ disableLazyLoading();
+ }
});
}
diff --git a/options.html b/options.html
index de09b5e..3927974 100644
--- a/options.html
+++ b/options.html
@@ -21,6 +21,10 @@
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);