mirror of
https://gitlab.com/KevinRoebert/ClearUrls
synced 2025-12-16 06:05:37 +07:00
Version 1.2.2.18
+ Correct the "es" language file + Automatic change from github rules to gitlab rules
This commit is contained in:
20
clearurls.js
20
clearurls.js
@@ -739,6 +739,10 @@ function setData(key, value)
|
||||
case "log":
|
||||
storage[key] = JSON.parse(value);
|
||||
break;
|
||||
case "hashURL":
|
||||
case "ruleURL":
|
||||
storage[key] = replaceOldGithubURLs(value);
|
||||
break;
|
||||
default:
|
||||
storage[key] = value;
|
||||
}
|
||||
@@ -806,6 +810,22 @@ function reload()
|
||||
browser.runtime.reload();
|
||||
}
|
||||
|
||||
/**
|
||||
* Replace the old GitHub URLs with the
|
||||
* new GitLab URLs.
|
||||
*/
|
||||
function replaceOldGithubURLs(url)
|
||||
{
|
||||
switch (url) {
|
||||
case "https://raw.githubusercontent.com/KevinRoebert/ClearUrls/master/data/rules.hash?flush_cache=true":
|
||||
return "https://gitlab.com/KevinRoebert/ClearUrls/raw/master/data/rules.hash";
|
||||
case "https://raw.githubusercontent.com/KevinRoebert/ClearUrls/master/data/data.json?flush_cache=true":
|
||||
return "https://gitlab.com/KevinRoebert/ClearUrls/raw/master/data/data.json";
|
||||
default:
|
||||
return url;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if an object is empty.
|
||||
* @param {Object} obj
|
||||
|
||||
Reference in New Issue
Block a user