diff --git a/background.js b/background.js index 85d2654..c10c0fe 100644 --- a/background.js +++ b/background.js @@ -15,9 +15,20 @@ var makeReadable = function() { } }; +var hideDickbar = function() { + document.querySelector('.js-postShareWidget').style.display = 'none'; + document.querySelector('footer > .container:first-child').style.display = 'none'; +}; + // 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"]'); if (metaCheck != null && metaCheck.content == "Medium") { makeReadable(); + + chrome.storage.sync.get(null, function(items) { + if (items.hideDickbar) { + hideDickbar(); + } + }); } diff --git a/manifest.json b/manifest.json index 61995d0..b24d1cd 100644 --- a/manifest.json +++ b/manifest.json @@ -5,6 +5,10 @@ "description": "Neutralizes annoying parts of the Medium reading experience so it's more enjoyable to read things.", "version": "1.0", + "options_ui": { + "page": "options.html", + "chrome_style": true + }, "icons": { "128": "icon.png" }, @@ -12,7 +16,7 @@ "default_icon": "icon.png" }, "permissions": [ - "https://*/*" + "storage", "https://*/*" ], "content_scripts": [ { diff --git a/options.html b/options.html new file mode 100644 index 0000000..de09b5e --- /dev/null +++ b/options.html @@ -0,0 +1,45 @@ + + +
+
+ + +