From 804ebbbf49306ac7fd19c1af1feb94382f0800d7 Mon Sep 17 00:00:00 2001 From: magnolia1234 <7676006-magnolia1234@users.noreply.gitlab.com> Date: Thu, 30 Apr 2020 20:49:35 +0200 Subject: [PATCH] Fix-update Faz.net (layout) --- README.md | 18 ++++++++++-------- contentScript.js | 2 +- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 7575edf..79258a9 100644 --- a/README.md +++ b/README.md @@ -259,17 +259,19 @@ When coming across a paywall click the cookie icon to remove the cookies then re _*May not always succeed_ ### New site requests -You can submit a request for a new website [here](https://bitbucket.org/magnolia1234/bypass-paywalls-firefox-clean/issues?status=new&status=open). Please read the following instructions and share your results for a quicker process. Remember to check the [previous requests](https://bitbucket.org/magnolia1234/bypass-paywalls-firefox-clean/issues) before asking for a new website. -1. Visit an article on the site you want to bypass the paywall for and copy the article title. -2. Open up a new incognito window (Ctrl+Shift+N) and paste the article title into Google. -3. Click on the same article from the Google search results page. Or you can: -4. Disable javascript on the website by clicking the button right icon on the uBlock panel. +You can submit a request for a new website [here](https://bitbucket.org/magnolia1234/bypass-paywalls-firefox-clean/issues?status=new&status=open). +Please read the following instructions and share your results for a quicker process. +Remember to check the [previous requests](https://bitbucket.org/magnolia1234/bypass-paywalls-firefox-clean/issues) before asking for a new website. +1. Visit an article on the site you want to bypass the paywall for and copy the article title. +2. Open up a new incognito window (Ctrl+Shift+N) and paste the article title into Google. +3. Click on the same article from the Google search results page. Or you can: +4. Disable javascript on the website by clicking the button right icon on the uBlock panel. 5. Refresh the page. ### Add custom site -Add your own custom site (also for testing). -Check 'Options'-link in popup-menu and go to custom sites. -By default sites' cookies are removed after page loads (to bypass article limit). +Add your own custom site (also for testing). +Check 'Options'-link in popup-menu and go to custom sites. +By default sites' cookies are removed after page loads (to bypass article limit). Also you can enable Googlebot user-agent or disable Javascript for (sub)domain(s). ### Troubleshooting diff --git a/contentScript.js b/contentScript.js index 9a94abe..456bcf1 100644 --- a/contentScript.js +++ b/contentScript.js @@ -536,7 +536,7 @@ else if (matchDomain('faz.net')) { const breakText = (str) => { str = str.replace(/(?:^|[\w\"\“])(\.|\?|!)(?=[A-Za-zÀ-ÿ\„]{2,})/gm, "$&\n\n"); - str = str.replace(/([a-z\"\“])(?=[A-Z])/gm, "$&\n\n"); + str = str.replace(/([a-z\"\“])(?=[A-Z](?=[A-Za-zÀ-ÿ]+))/gm, "$&\n\n"); // exceptions: names with alternating lower/uppercase (no general fix) str = str.replace(/Glaxo\n\nSmith\n\nKline/g, "GlaxoSmithKline"); str = str.replace(/If\n\nSG/g, "IfSG");