From cdaa4c20a557090e7ea7a1e3a4557403412ec15a Mon Sep 17 00:00:00 2001 From: magnolia1234 <7676006-magnolia1234@users.noreply.gitlab.com> Date: Sun, 5 Jan 2020 17:41:06 +0100 Subject: [PATCH] Add Scribd (unblur text of documents) --- README.md | 1 + background.js | 2 ++ contentScript.js | 12 ++++++++++++ manifest.json | 6 ++++-- options.js | 1 + 5 files changed, 20 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 61db3e7..f9745cd 100644 --- a/README.md +++ b/README.md @@ -63,6 +63,7 @@ [Quartz](https://qz.com)\ [Quora](https://www.quora.com)\ [Scientific American](https://scientificamerican.com)\ +[Scribd](http://scribd.com)\ [Statista](https://www.statista.com)\ [SunSentinel](https://www.sun-sentinel.com)\ [Tech in Asia]:(https://www.techinasia.com)\ diff --git a/background.js b/background.js index 7d75274..c6f11f5 100644 --- a/background.js +++ b/background.js @@ -60,6 +60,7 @@ var defaultSites = { 'Quartz': 'qz.com', 'Quora': 'quora.com', 'Scientific American': 'scientificamerican.com', + 'Scribd': 'scribd.com', 'Statista': 'statista.com', 'SunSentinel': 'sun-sentinel.com', 'Tech in Asia': 'techinasia.com', @@ -142,6 +143,7 @@ const allow_cookies = [ 'quora.com', 'qz.com', 'scientificamerican.com', +'scribd.com', 'spectator.co.uk', 'telegraaf.nl', 'telegraph.co.uk', diff --git a/contentScript.js b/contentScript.js index 2a0050e..6885021 100644 --- a/contentScript.js +++ b/contentScript.js @@ -279,6 +279,18 @@ if (window.location.href.indexOf("theglobeandmail.com") !== -1) { }); } +if (window.location.href.indexOf("scribd.com") !== -1) { + const blur = document.querySelectorAll('.blurred_page'); + for (let i = 0; i < blur.length; i++) { + blur[i].classList.remove('blurred_page'); + } + const portal = document.querySelector('.between_page_portal_root'); + const page_module = document.querySelector('.between_page_module'); + const promo = document.querySelector('.auto__doc_page_webpack_doc_page_body_static_promo_study'); + const ad = document.querySelector('.auto__explain_scribd_v2_advertisement'); + removeDOMElement(portal, page_module, promo, ad); +} + function removeDOMElement(...elements) { for (let element of elements) { if (element) element.remove(); diff --git a/manifest.json b/manifest.json index ae5ecab..e9b2b5e 100644 --- a/manifest.json +++ b/manifest.json @@ -30,7 +30,8 @@ "*://*.newcastleherald.com.au/*", "*://*.thestar.com/*", "*://*.afr.com/*", - "*://*.theglobeandmail.com/*" + "*://*.theglobeandmail.com/*", + "*://*.scribd.com/*" ], "js": ["contentScript.js"] } @@ -166,7 +167,8 @@ "*://*.leparisien.fr/*", "*://*.lesechos.fr/*", "*://*.theathletic.com/*", - "*://*.techinasia.com/*" + "*://*.techinasia.com/*", + "*://*.scribd.com/*" ], "version": "1.6.3" } diff --git a/options.js b/options.js index 1287c9b..82bea48 100644 --- a/options.js +++ b/options.js @@ -58,6 +58,7 @@ var defaultSites = { 'Quartz': 'qz.com', 'Quora': 'quora.com', 'Scientific American': 'scientificamerican.com', + 'Scribd (documents only)': 'scribd.com', 'Statista': 'statista.com', 'SunSentinel': 'sun-sentinel.com', 'Tech in Asia': 'techinasia.com',