Commit 75a314a0 authored by Pierre M's avatar Pierre M
Browse files

code simplification


Signed-off-by: Pierre M's avatarPierre Mazière <pierre.maziere@gmx.com>
parent 181bf862
......@@ -17,6 +17,7 @@
//
(function() {
let userRE = new RegExp("https://linuxfr.org/users/(.*)$");
let plonkList = JSON.parse(GM_getValue("plonkList","[]"));
let plonkClosedAccounts = GM_getValue("plonkClosedAccounts",true);
......@@ -175,14 +176,10 @@
plonkList.splice(index,1);
listModified = true;
}
let re = new RegExp("https://linuxfr.org/users/(.*)$");
let matches = userLink.href.match(re);
if(matches !== null){
index = plonkList.indexOf(matches[1]);
if(index !== -1){
plonkList.splice(index,1);
listModified = true;
}
index = plonkList.indexOf(userLink.href.match(userRE)[1]);
if(index !== -1){
plonkList.splice(index,1);
listModified = true;
}
if(listModified){
GM_setValue("plonkList",JSON.stringify(plonkList));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment