diff --git a/content.js b/content.js index 7e19b6b..51e0e15 100644 --- a/content.js +++ b/content.js @@ -38,6 +38,12 @@ var disableLazyLoading = function() { } }; +var observer = new MutationObserver(function(mutations){ + mutations.forEach(makeReadable); +}); + +var config = {attributes: true}; + // Only run this on Medium sites. // Ensure that by checking for in the document var metaCheck = document.head.querySelector('meta[property="al:ios:app_name"]'); @@ -52,4 +58,6 @@ if (metaCheck != null && metaCheck.content == "Medium") { disableLazyLoading(); } }); + + observer.observe(document.querySelector('body'), config); }