From 0b617420d14f98d7d1efb0baff54a0804056e7a3 Mon Sep 17 00:00:00 2001 From: tastytea Date: Sat, 6 Jul 2019 05:32:02 +0200 Subject: [PATCH] npr_text_only: Fixed regular expression. The regular expression was too specific, I made it more general. --- news/npr_text_only.user.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/news/npr_text_only.user.js b/news/npr_text_only.user.js index 133af93..b906247 100644 --- a/news/npr_text_only.user.js +++ b/news/npr_text_only.user.js @@ -2,7 +2,7 @@ // @name NPR text only // @description Redirects to the privacy respecting, text-only version of articles on npr.org and limits the text-width to 80 characters. // @description:de Leitet auf die datenschutzfreundliche, nur-text version von artikeln auf npr.org weiter und beschränkt die text-breite auf 80 zeichen. -// @version 2019.07.06.1 +// @version 2019.07.06.2 // @author tastytea // @copyright 2019, tastytea (https://tastytea.de/) // @license GPL-3.0-only @@ -30,7 +30,7 @@ function main() function redirect() { - const re = new RegExp('npr\.org/[0-9]{4}/[0-9]{2}/[0-9]{2}/([0-9]+)/'); + const re = new RegExp('/[0-9]{4}/[0-9]{2}/[0-9]{2}/([0-9]+)/'); const result = re.exec(window.location.href); if (result !== null && result.length > 1) @@ -39,7 +39,7 @@ function redirect() } else { - console.error("Could not find sId."); + console.warn("Could not find sId."); } }