From 1612d0e89c4e878d3563ed6ddfe440af145a178c Mon Sep 17 00:00:00 2001 From: magnolia1234 <7676006-magnolia1234@users.noreply.gitlab.com> Date: Sun, 21 Jun 2020 23:03:07 +0200 Subject: [PATCH] Fix-update Inkl (Dive Deeper links) --- contentScript.js | 32 +++++++++++++++++++++++++------- 1 file changed, 25 insertions(+), 7 deletions(-) diff --git a/contentScript.js b/contentScript.js index 0d30b54..22b0281 100644 --- a/contentScript.js +++ b/contentScript.js @@ -1,5 +1,5 @@ // clean local storage of sites (with an exemption for hold-list) -var arr_localstorage_hold = ['seekingalpha.com', 'sfchronicle.com']; +var arr_localstorage_hold = ['inkl.com', 'seekingalpha.com', 'sfchronicle.com']; if (!matchDomain(arr_localstorage_hold)){ window.localStorage.clear(); } @@ -690,13 +690,31 @@ else if (matchDomain('ftm.nl')) { else if (matchDomain('inkl.com')) { document.addEventListener('DOMContentLoaded', () => { - let article_container = document.querySelector('div.article-content-container'); - if (article_container) - article_container.setAttribute("style", "overflow: visible;"); - let gradient_container = document.querySelector('div.gradient-container'); - if (gradient_container) - gradient_container.setAttribute("style", "height:auto;"); + let menu_btn = document.querySelector('div.left-buttons-container button.menu-btn'); + if (!menu_btn) { + let article_container = document.querySelector('div.article-content-container'); + if (article_container) + article_container.setAttribute("style", "overflow: visible; max-height: none;"); + let gradient_container = document.querySelector('div.gradient-container'); + if (gradient_container) + gradient_container.setAttribute("style", "height:auto;"); + } }); + let dismiss_button = document.querySelector('div.dismiss-button-container button.btn'); + if (dismiss_button) + dismiss_button.click(); + let dive_deeper_summary_bodies = document.querySelectorAll('div.dive-deeper-container div.summary-body'); + if (dive_deeper_summary_bodies) { + for (summary_body of dive_deeper_summary_bodies) { + if (!summary_body.outerHTML.includes('