feat: add built-in Moon I2P start page to Firefox and Android
- Firefox extension: add start.html/css/js as homepage and new-tab page (manifest bumped to 0.1.5, .xpi rebuilt). Shows router readiness, tunnel/NetDB/DHT tiles, torrents, and a .i2p/magnet address bar. - openManager message now accepts an optional hash and reuses any open manager tab. - Android: default page is file:///android_asset/start.html, backed by a MoonI2pStart JS bridge (status, torrents, open URL, diagnostics, copy .b32). Blocks file: navigation from the WebView. - RouterService: add fetchLocalApiJsonOrNull for bounded local API reads. - Built-in .i2p destinations reordered (NotBob, Postman first); README updated to match.
This commit is contained in:
1 parent
9d3df6e100
commit
7139a64544
11 files changed
+1355
-37
No files matched your search
+19
-18
@@ -5,7 +5,7 @@ Bundles:
|
||||
- Official Mozilla Firefox ESR (x86_64)
|
||||
- Native moon-i2p router (--public, HTTP proxy, BitTorrent + I2P DHT API)
|
||||
- Pre-installed moon-i2p-torrent@local Firefox WebExtension & Native Messaging host
|
||||
- Pre-configured homepage http://insulaocculta.i2p/, I2P PAC routing, and HTTPS-First disabled for .i2p
|
||||
- Pre-configured Moon I2P Start Page, I2P PAC routing, and HTTPS-First disabled for .i2p
|
||||
"""
|
||||
|
||||
import json
|
||||
@@ -105,7 +105,6 @@ def write_firefox_configs(firefox_dir: Path):
|
||||
'pref("extensions.sideloadScopes", 15);\n'
|
||||
'pref("extensions.startupScanScopes", 15);\n'
|
||||
'pref("extensions.installDistroAddons", true);\n'
|
||||
'defaultPref("browser.startup.homepage", "http://insulaocculta.i2p/");\n'
|
||||
'defaultPref("browser.startup.page", 1);\n'
|
||||
'defaultPref("dom.security.https_only_mode", false);\n'
|
||||
'defaultPref("dom.security.https_only_mode_pbm", false);\n'
|
||||
@@ -126,11 +125,6 @@ def write_firefox_configs(firefox_dir: Path):
|
||||
dist_dir.mkdir(parents=True, exist_ok=True)
|
||||
policies = {
|
||||
"policies": {
|
||||
"Homepage": {
|
||||
"URL": "http://insulaocculta.i2p/",
|
||||
"StartPage": "homepage",
|
||||
"Locked": False,
|
||||
},
|
||||
"OverrideFirstRunPage": "",
|
||||
"OverridePostUpdatePage": "",
|
||||
"DontCheckDefaultBrowser": True,
|
||||
@@ -140,6 +134,16 @@ def write_firefox_configs(firefox_dir: Path):
|
||||
"DisableFirefoxStudies": True,
|
||||
"DNSOverHTTPS": {"Enabled": False},
|
||||
"Bookmarks": [
|
||||
{
|
||||
"Title": "NotBob Directory",
|
||||
"URL": "http://notbob.i2p/",
|
||||
"Placement": "toolbar",
|
||||
},
|
||||
{
|
||||
"Title": "Postman Tracker",
|
||||
"URL": "http://tracker2.postman.i2p/",
|
||||
"Placement": "toolbar",
|
||||
},
|
||||
{
|
||||
"Title": "Insula Occulta",
|
||||
"URL": "http://insulaocculta.i2p/",
|
||||
@@ -155,16 +159,6 @@ def write_firefox_configs(firefox_dir: Path):
|
||||
"URL": "http://zzz.i2p/",
|
||||
"Placement": "toolbar",
|
||||
},
|
||||
{
|
||||
"Title": "Postman Tracker",
|
||||
"URL": "http://tracker2.postman.i2p/",
|
||||
"Placement": "toolbar",
|
||||
},
|
||||
{
|
||||
"Title": "NotBob Directory",
|
||||
"URL": "http://notbob.i2p/",
|
||||
"Placement": "toolbar",
|
||||
},
|
||||
],
|
||||
"ExtensionSettings": {
|
||||
"moon-i2p-torrent@local": {
|
||||
@@ -321,7 +315,6 @@ function FindProxyForURL(url, host) {
|
||||
EOF
|
||||
|
||||
cat > "$PROFILE_DIR/user.js" <<EOF
|
||||
user_pref("browser.startup.homepage", "http://insulaocculta.i2p/");
|
||||
user_pref("browser.startup.page", 1);
|
||||
user_pref("network.proxy.type", 2);
|
||||
user_pref("network.proxy.autoconfig_url", "file://$PROFILE_DIR/i2p.pac");
|
||||
@@ -339,6 +332,14 @@ user_pref("network.captive-portal-service.enabled", false);
|
||||
user_pref("browser.shell.checkDefaultBrowser", false);
|
||||
EOF
|
||||
|
||||
# One-time migration: clear only the legacy insulaocculta.i2p default from prefs.js
|
||||
# so the extension's Start Page takes over without touching any custom homepage.
|
||||
if [[ -f "$PROFILE_DIR/prefs.js" ]] && grep -Fqx 'user_pref("browser.startup.homepage", "http://insulaocculta.i2p/");' "$PROFILE_DIR/prefs.js"; then
|
||||
PREFS_TMP="$PROFILE_DIR/prefs.js.tmp.$$"
|
||||
grep -Fvx 'user_pref("browser.startup.homepage", "http://insulaocculta.i2p/");' "$PROFILE_DIR/prefs.js" > "$PREFS_TMP" || true
|
||||
mv -f "$PREFS_TMP" "$PROFILE_DIR/prefs.js"
|
||||
fi
|
||||
|
||||
ROUTER_BIN="$APPDIR/usr/bin/moon-i2p-router"
|
||||
ROUTER_PID=""
|
||||
FF_PID=""
|
||||
|
||||
Reference in new issue
Block a user