You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
> **Info:** Use Chrome or Firefox, use https://getindie.wiki instead :)
5
+
6
+
## How it works
7
+
8
+
Flean is a small Safari Web Extension (with native host helpers) that redirects visits to Fandom wiki pages to independent mirrors. The goal is to provide fast, privacy-friendly redirects to community-hosted wiki mirrors.
9
+
10
+
- Extension core files
11
+
- `ios/extention/Resources/manifest.json` — extension metadata and entry points.
12
+
- `ios/extention/Resources/popup.html`, `popup.js`, `popup.css` — popup UI where the user picks a mirror, toggles "ask on visit", and manages an ignore list.
13
+
- `ios/extention/Resources/content.js` / `background.js` — runtime logic that runs on visited pages and computes redirects.
14
+
- Optional mapping files (not required) — the extension can use an internal mapping or external mapping files to associate Fandom hosts with mirror destinations (destBase + destPath). If no mapping is present the extension falls back to simple heuristics to build candidate mirror URLs.
15
+
16
+
- Runtime flow
17
+
1. The content script detects the current host (for example `deltarune.fandom.com`) and either looks it up in an internal mapping (if provided) or computes candidate mirror hosts using simple heuristics.
18
+
2. If a candidate destination is determined it constructs the destination URL (base domain + path) plus the article/title from the original path.
19
+
3. Depending on settings (`askOnVisit`, ignore/allow lists), the extension either redirects immediately or prompts the user via the popup to confirm.
20
+
21
+
- Native host (macOS / iOS)
22
+
- The repository includes a tiny macOS app and an iOS WebView host that can load the same `Main.html` UI. The native host exposes a `controller` script message handler so the web UI can get/set settings and persist them to Application Support.
23
+
- On iOS the app stores settings in `Application Support/Flean/settings.json` (see `ios/Flean/iOS/SettingsStore.swift`) and pushes updates into the web UI via `CustomEvent('flean:message')`.
24
+
25
+
- Test harness
26
+
- For quick local testing I added a small PHP-based test harness at the repo root:
27
+
- `index.php` — loads the popup UI in an iframe and provides a form to test redirect generation.
28
+
- `redirect.php` — server-side endpoint that uses a small built-in mapping or simple heuristics to return a candidate redirect URL for a provided `?url=` parameter. It does not require a compiled datapack to be present.
0 commit comments