mirror of
https://github.com/Dasemu/X-GeoBlock.git
synced 2026-11-26 15:26:09 +00:00
feat: redesign controls and configure cloud cache
This commit is contained in:
1 parent
070e07845c
commit
e12164c312
15 files changed
+178
-78
No files matched your search
+9
-2
@@ -1,12 +1,15 @@
|
||||
(function (root) {
|
||||
"use strict";
|
||||
|
||||
const CLOUD_CACHE_ENDPOINT = "https://x-geoblock-cache.dariosevilla.es";
|
||||
|
||||
const DEFAULT_SETTINGS = Object.freeze({
|
||||
enabled: true,
|
||||
blacklist: [],
|
||||
skipFollowed: true,
|
||||
showPlaceholder: false,
|
||||
debugMode: false,
|
||||
cloudCacheEndpoint: "",
|
||||
cloudCacheEndpoint: CLOUD_CACHE_ENDPOINT,
|
||||
contributeCloudCache: false
|
||||
});
|
||||
|
||||
@@ -52,7 +55,11 @@
|
||||
);
|
||||
}
|
||||
|
||||
const api = { DEFAULT_SETTINGS, normalizeCountry, isBlacklisted };
|
||||
function shouldBlock(country, blacklist, following, skipFollowed = true) {
|
||||
return !(skipFollowed && following === true) && isBlacklisted(country, blacklist);
|
||||
}
|
||||
|
||||
const api = { CLOUD_CACHE_ENDPOINT, DEFAULT_SETTINGS, normalizeCountry, isBlacklisted, shouldBlock };
|
||||
root.XGeoConfig = api;
|
||||
if (typeof module !== "undefined") module.exports = api;
|
||||
})(typeof globalThis !== "undefined" ? globalThis : this);
|
||||
Reference in new issue
Block a user