XGB // CONTROL SYSTEM
X GeoBlock
Geographic signal filtering for your X timeline.
X GeoBlock
Location filtering for your X timeline.
diff --git a/README.md b/README.md index bf44767..b2526c3 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ X GeoBlock is a Manifest V3 browser extension for Chromium and Firefox. While yo - Provides a searchable country and region checklist with flags, an enable switch, and optional hidden-post placeholders. - Includes opt-in debug logging for every lookup and filtering decision. - By default, stores all settings and lookup results only in browser extension storage. No data is sent to third parties unless cloud contribution is explicitly enabled. -- Uses the project Cloudflare Worker + D1 collaborative cache at `x-geoblock-cache.dariosevilla.es`, with signed opt-in contributions and three-installation consensus. +- Uses the project Cloudflare Worker + D1 collaborative cache at `x-geoblock-cache.dariosevilla.es`, with signed contributions and three-installation consensus. Contributions are enabled by default and can be disabled in settings. ## Install from source in Chromium diff --git a/background.js b/background.js index 0e30162..a4aae12 100644 --- a/background.js +++ b/background.js @@ -3,6 +3,7 @@ if (typeof XGeoConfig === "undefined") importScripts("lib/config.js", "lib/cloud const extensionApi = globalThis.browser || chrome; const CACHE_KEY = "userCache"; +const DEFAULTS_MIGRATION_KEY = "defaultsV2Applied"; const LOCAL_CACHE_TTL_MS = 30 * 24 * 60 * 60 * 1000; const activeRequests = new Map(); const pendingFrameLookups = new Map(); @@ -12,8 +13,15 @@ let lastRequestAt = 0; const MAX_CONCURRENT_REQUESTS = 3; extensionApi.runtime.onInstalled.addListener(async () => { - const current = await extensionApi.storage.sync.get(XGeoConfig.DEFAULT_SETTINGS); - await extensionApi.storage.sync.set(current); + const current = await extensionApi.storage.sync.get(null); + const local = await extensionApi.storage.local.get({ [DEFAULTS_MIGRATION_KEY]: false }); + const next = { ...XGeoConfig.DEFAULT_SETTINGS, ...current, cloudCacheEndpoint: XGeoConfig.CLOUD_CACHE_ENDPOINT }; + if (!local[DEFAULTS_MIGRATION_KEY]) { + next.showPlaceholder = true; + next.contributeCloudCache = true; + await extensionApi.storage.local.set({ [DEFAULTS_MIGRATION_KEY]: true }); + } + await extensionApi.storage.sync.set(next); }); extensionApi.runtime.onMessage.addListener((message, sender, sendResponse) => { diff --git a/docs/cloud-cache.md b/docs/cloud-cache.md index 1cc91a8..840a3e2 100644 --- a/docs/cloud-cache.md +++ b/docs/cloud-cache.md @@ -1,6 +1,6 @@ # Collaborative cloud cache -The cloud cache uses the Cloudflare Worker and D1 schema in `worker/`. Extension builds use `https://x-geoblock-cache.dariosevilla.es` for reads. Contributing observations is a separate opt-in choice. +The cloud cache uses the Cloudflare Worker and D1 schema in `worker/`. Extension builds use `https://x-geoblock-cache.dariosevilla.es` for reads. Contributing observations is enabled by default and can be disabled in settings. ## Data flow diff --git a/docs/privacy.md b/docs/privacy.md index ab4482a..58d95e3 100644 --- a/docs/privacy.md +++ b/docs/privacy.md @@ -6,4 +6,4 @@ The extension reads public account About pages from `x.com` using the X session The extension reads post author links in X timelines only to decide whether to display those posts. It does not read or store post text. -The collaborative cache at `x-geoblock-cache.dariosevilla.es` receives SHA-256 hashes of public usernames for lookups. If contribution is enabled separately, signed reports also contain the observed location, timestamp, and parser version. The service never receives following relationships, blacklist settings, post contents, or raw usernames. Public username hashes remain enumerable and must not be treated as anonymous data. +The collaborative cache at `x-geoblock-cache.dariosevilla.es` receives SHA-256 hashes of public usernames for lookups. Contributions are enabled by default and can be disabled in settings; signed reports contain the observed location, timestamp, and parser version. The service never receives following relationships, blacklist settings, post contents, or raw usernames. Public username hashes remain enumerable and must not be treated as anonymous data. diff --git a/lib/config.js b/lib/config.js index 31f5ecf..472ad3e 100644 --- a/lib/config.js +++ b/lib/config.js @@ -7,10 +7,10 @@ enabled: true, blacklist: [], skipFollowed: true, - showPlaceholder: false, + showPlaceholder: true, debugMode: false, cloudCacheEndpoint: CLOUD_CACHE_ENDPOINT, - contributeCloudCache: false + contributeCloudCache: true }); const COUNTRY_ALIASES = Object.freeze({ diff --git a/options/options.css b/options/options.css index 92ec03d..d672fea 100644 --- a/options/options.css +++ b/options/options.css @@ -1,37 +1,36 @@ -:root { color-scheme:dark; font:15px/1.5 Inter,ui-sans-serif,system-ui,sans-serif; --bg:#060a0e; --panel:#0b1218; --panel2:#0e1820; --line:#1b2b36; --line2:#28404d; --text:#e8f7fb; --muted:#78909c; --cyan:#45e6ff; --lime:#adff2f; --amber:#ffbe55; } +:root { color-scheme:dark; font:15px/1.5 Inter,ui-sans-serif,system-ui,sans-serif; --bg:#090d12; --panel:#111920; --panel2:#142029; --line:#293944; --line2:#38505e; --text:#f3f7f9; --muted:#a4b2ba; --cyan:#58ddf2; --lime:#b7f45b; --amber:#ffbe55; } * { box-sizing:border-box; } body { margin:0; min-height:100vh; background:radial-gradient(circle at 70% -20%,#102c39 0,transparent 38%),var(--bg); color:var(--text); } -body::before { content:""; position:fixed; inset:0; pointer-events:none; opacity:.22; background-image:linear-gradient(rgba(69,230,255,.055) 1px,transparent 1px),linear-gradient(90deg,rgba(69,230,255,.055) 1px,transparent 1px); background-size:32px 32px; mask-image:linear-gradient(to bottom,#000,transparent 80%); } +body::before { content:""; position:fixed; inset:0; pointer-events:none; opacity:.12; background-image:linear-gradient(rgba(69,230,255,.055) 1px,transparent 1px),linear-gradient(90deg,rgba(69,230,255,.055) 1px,transparent 1px); background-size:32px 32px; mask-image:linear-gradient(to bottom,#000,transparent 80%); } .noise { position:fixed; inset:0; pointer-events:none; opacity:.025; background-image:url("data:image/svg+xml,%3Csvg viewBox='0 0 160 160' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); } main { position:relative; width:min(920px,calc(100% - 40px)); margin:0 auto; padding:46px 0 70px; } .masthead { display:flex; align-items:center; justify-content:space-between; margin-bottom:30px; } .identity { display:flex; align-items:center; gap:17px; } .logo-shell { width:68px; height:68px; display:grid; place-items:center; border:1px solid #285064; border-radius:16px; background:linear-gradient(145deg,#132935,#081117); box-shadow:0 0 38px rgba(69,230,255,.1),inset 0 1px rgba(255,255,255,.04); } .logo-shell img { width:53px; height:53px; object-fit:contain; } -.kicker,.section-tag,.system-state,.counter,.connected,.endpoint,.actions button { font-family:"SFMono-Regular",Consolas,"Liberation Mono",monospace; letter-spacing:.1em; } +.kicker,.section-tag,.system-state,.counter,.connected,.endpoint { font-family:"SFMono-Regular",Consolas,"Liberation Mono",monospace; letter-spacing:.06em; } .kicker,.section-tag { margin:0 0 3px; color:var(--cyan); font-size:10px; font-weight:700; } h1 { margin:0; font-size:34px; line-height:1.1; letter-spacing:-.035em; } .lead { margin:5px 0 0; color:var(--muted); font-size:14px; } -.system-state { display:flex; align-items:center; gap:10px; padding:10px 13px; border:1px solid var(--line); border-radius:8px; background:rgba(8,16,21,.7); } -.system-state small,.system-state strong { display:block; font-size:9px; }.system-state small { color:var(--muted); }.system-state strong { margin-top:2px; color:var(--lime); } +.system-state { display:flex; align-items:center; gap:9px; padding:9px 12px; border:1px solid var(--line); border-radius:8px; background:rgba(15,24,30,.8); } +.system-state strong { color:var(--lime); font-size:10px; } .state-dot { width:9px; height:9px; border-radius:50%; background:var(--lime); box-shadow:0 0 13px rgba(173,255,47,.75); } form { display:grid; gap:16px; } -.panel { position:relative; padding:25px; border:1px solid var(--line); border-radius:14px; background:linear-gradient(145deg,rgba(14,24,32,.96),rgba(8,14,19,.97)); box-shadow:inset 0 1px rgba(255,255,255,.025),0 18px 50px rgba(0,0,0,.12); } +.panel { position:relative; padding:23px; border:1px solid var(--line); border-radius:14px; background:linear-gradient(145deg,rgba(19,29,37,.98),rgba(13,20,26,.98)); box-shadow:inset 0 1px rgba(255,255,255,.025),0 18px 50px rgba(0,0,0,.12); } .panel::after { content:""; position:absolute; top:-1px; left:25px; width:70px; height:1px; background:var(--cyan); box-shadow:0 0 10px var(--cyan); opacity:.65; } -.master-panel { display:grid; grid-template-columns:auto 1fr auto; align-items:center; gap:20px; } -.panel-index { color:#294450; font:700 36px/1 "SFMono-Regular",Consolas,monospace; } +.master-panel { display:grid; grid-template-columns:1fr auto; align-items:center; gap:20px; } .panel-copy h2,.section-head h2 { margin:0; font-size:20px; letter-spacing:-.015em; }.panel-copy p:last-child,.hint { margin:5px 0 0; color:var(--muted); font-size:13px; } .section-head { display:flex; align-items:flex-start; justify-content:space-between; gap:20px; margin-bottom:18px; } -.counter { flex:none; margin-top:4px; padding:6px 9px; border:1px solid var(--line2); border-radius:5px; color:#9db4bf; font-size:9px; } +.counter { flex:none; margin-top:4px; padding:6px 9px; border:1px solid var(--line2); border-radius:5px; color:#bdd0d8; font-size:10px; } .switch { display:flex; align-items:center; gap:9px; cursor:pointer; }.switch input { position:absolute; opacity:0; }.switch b { color:var(--muted); font:700 9px "SFMono-Regular",Consolas,monospace; letter-spacing:.1em; }.track { width:48px; height:26px; padding:4px; border:1px solid #2a3c46; border-radius:99px; background:#111b21; transition:.2s; }.track span { display:block; width:16px; height:16px; border-radius:50%; background:#657b86; transition:.2s; }.switch input:checked + .track { border-color:rgba(69,230,255,.7); background:rgba(69,230,255,.1); }.switch input:checked + .track span { transform:translateX(22px); background:var(--cyan); box-shadow:0 0 12px rgba(69,230,255,.75); }.switch input:checked ~ b { color:var(--cyan); } .country-tools { display:flex; align-items:center; gap:10px; margin-bottom:11px; }.search-shell { flex:1; display:flex; align-items:center; gap:10px; padding:0 13px; border:1px solid var(--line2); border-radius:8px; background:#070c10; color:var(--cyan); }.search-shell:focus-within { border-color:#3cbdd0; box-shadow:0 0 0 3px rgba(69,230,255,.07); }.search-shell input { width:100%; border:0; outline:0; padding:11px 0; background:transparent; color:var(--text); font:inherit; }.search-shell input::placeholder { color:#506872; } -button { cursor:pointer; }.ghost,.primary,.danger { border-radius:7px; padding:11px 14px; font-weight:700; }.ghost { border:1px solid var(--line2); background:transparent; color:#8da4ae; font:700 9px "SFMono-Regular",Consolas,monospace; letter-spacing:.08em; }.ghost:hover { border-color:var(--cyan); color:var(--cyan); } +button { cursor:pointer; }.ghost,.primary,.danger { border-radius:7px; padding:11px 14px; font-weight:700; }.ghost { border:1px solid var(--line2); background:transparent; color:#b6c4ca; font:700 12px Inter,ui-sans-serif,system-ui,sans-serif; }.ghost:hover { border-color:var(--cyan); color:var(--cyan); } .country-list { display:grid; grid-template-columns:repeat(auto-fill,minmax(190px,1fr)); gap:7px; max-height:420px; overflow:auto; scrollbar-color:#284550 #081016; padding:10px; border:1px solid var(--line); border-radius:10px; background:#070c10; } .country-option { display:flex; align-items:center; gap:9px; min-width:0; padding:8px 9px; border:1px solid transparent; border-radius:7px; cursor:pointer; transition:.15s; }.country-option:hover { border-color:#203844; background:#0e1a21; }.country-option:has(input:checked) { border-color:rgba(69,230,255,.32); background:rgba(69,230,255,.075); }.country-option[hidden] { display:none; }.country-option input { accent-color:var(--cyan); }.country-flag { font-size:19px; line-height:1; }.country-name { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:13px; } -.setting-grid { display:grid; grid-template-columns:repeat(2,1fr); gap:10px; }.setting-card { display:flex; align-items:flex-start; gap:11px; padding:14px; border:1px solid var(--line); border-radius:9px; background:#091017; cursor:pointer; transition:.15s; }.setting-card:hover { border-color:#2d4a58; }.setting-card input { position:absolute; opacity:0; }.checkmark { flex:0 0 auto; width:18px; height:18px; border:1px solid #34505c; border-radius:4px; background:#071015; }.setting-card input:checked + .checkmark { border-color:var(--cyan); background:var(--cyan); box-shadow:0 0 12px rgba(69,230,255,.25); }.setting-card input:checked + .checkmark::after { content:""; display:block; width:8px; height:4px; margin:4px 0 0 4px; border:solid #041014; border-width:0 0 2px 2px; transform:rotate(-45deg); }.setting-card strong,.setting-card small { display:block; }.setting-card strong { font-size:13px; }.setting-card small { margin-top:3px; color:var(--muted); font-size:11px; line-height:1.45; } -.connected { display:flex; align-items:center; gap:7px; padding:6px 9px; border:1px solid rgba(173,255,47,.22); border-radius:5px; color:var(--lime); font-size:9px; }.connected i { width:6px; height:6px; border-radius:50%; background:var(--lime); box-shadow:0 0 9px rgba(173,255,47,.75); } -.endpoint { display:grid; grid-template-columns:auto 1fr auto; align-items:center; gap:13px; margin-bottom:11px; padding:12px 13px; border:1px solid var(--line); border-radius:8px; background:#070d12; color:var(--muted); font-size:9px; }.endpoint code { overflow:hidden; color:#b8d6df; font-size:12px; letter-spacing:0; text-overflow:ellipsis; }.lock { color:#4f6873; } +.setting-grid { display:grid; grid-template-columns:repeat(2,1fr); gap:10px; }.setting-card { display:flex; align-items:flex-start; gap:11px; padding:14px; border:1px solid var(--line); border-radius:9px; background:#091017; cursor:pointer; transition:.15s; }.setting-card:hover { border-color:#2d4a58; }.setting-card input { position:absolute; opacity:0; }.checkmark { flex:0 0 auto; width:18px; height:18px; border:1px solid #34505c; border-radius:4px; background:#071015; }.setting-card input:checked + .checkmark { border-color:var(--cyan); background:var(--cyan); box-shadow:0 0 12px rgba(69,230,255,.25); }.setting-card input:checked + .checkmark::after { content:""; display:block; width:8px; height:4px; margin:4px 0 0 4px; border:solid #041014; border-width:0 0 2px 2px; transform:rotate(-45deg); }.setting-card strong,.setting-card small { display:block; }.setting-card strong { font-size:13px; }.setting-card small { margin-top:3px; color:var(--muted); font-size:12px; line-height:1.4; } +.connected { display:flex; align-items:center; gap:7px; padding:6px 9px; border:1px solid rgba(183,244,91,.28); border-radius:5px; color:var(--lime); font-size:10px; }.connected i { width:6px; height:6px; border-radius:50%; background:var(--lime); box-shadow:0 0 9px rgba(173,255,47,.75); } +.endpoint { margin-bottom:11px; padding:12px 13px; border:1px solid var(--line); border-radius:8px; background:#0c1318; }.endpoint code { overflow:hidden; color:#b8d6df; font-size:12px; letter-spacing:0; text-overflow:ellipsis; }.lock { color:#4f6873; } .contribution { max-width:none; } .actions { display:flex; align-items:center; justify-content:space-between; min-height:50px; padding:4px 1px; }.actions > div { display:flex; gap:10px; }.primary { border:1px solid #2bc7de; background:linear-gradient(90deg,rgba(23,158,180,.25),rgba(69,230,255,.1)); color:var(--cyan); }.primary:hover { background:rgba(69,230,255,.16); box-shadow:0 0 20px rgba(69,230,255,.1); }.danger { border:1px solid #44363a; background:transparent; color:#c28c94; }.danger:hover { border-color:#a45762; color:#ff9aa7; }#status { min-width:170px; margin:0; color:var(--lime); font:11px "SFMono-Regular",Consolas,monospace; text-align:right; } button:focus-visible,input:focus-visible,label:has(input:focus-visible) { outline:2px solid var(--cyan); outline-offset:2px; } -@media (max-width:680px) { main { width:min(100% - 24px,920px); padding-top:24px; }.masthead { align-items:flex-start; }.system-state { display:none; }.master-panel { grid-template-columns:auto 1fr; }.master-panel .switch { grid-column:2; }.section-head { display:block; }.counter,.connected { display:inline-flex; margin-top:10px; }.setting-grid { grid-template-columns:1fr; }.endpoint { grid-template-columns:1fr; }.endpoint span { display:none; }.actions { align-items:flex-start; gap:12px; flex-direction:column; }.actions > div { width:100%; }.actions button { flex:1; }#status { text-align:left; } } +@media (max-width:680px) { main { width:min(100% - 24px,920px); padding-top:24px; }.masthead { align-items:flex-start; }.system-state { display:none; }.master-panel { grid-template-columns:1fr; }.section-head { display:block; }.counter,.connected { display:inline-flex; margin-top:10px; }.setting-grid { grid-template-columns:1fr; }.endpoint { grid-template-columns:1fr; }.endpoint span { display:none; }.actions { align-items:flex-start; gap:12px; flex-direction:column; }.actions > div { width:100%; }.actions button { flex:1; }#status { text-align:left; } } diff --git a/options/options.html b/options/options.html index 29d48dc..fff3b3d 100644 --- a/options/options.html +++ b/options/options.html @@ -5,39 +5,38 @@
XGB // CONTROL SYSTEM
Geographic signal filtering for your X timeline.
Location filtering for your X timeline.
NETWORK FILTER
Timeline location filter