public final class BrowserApiInstaller extends Object
No shell script is involved: the registered command is the router's own
JVM running MagnetHandler with the console URL baked in, so it keeps
working across console port or HTTPS changes made before installation.
Linux: writes a .desktop file and registers it in mimeapps.list, which xdg-open, Firefox, and Chromium-based browsers honor.
Windows: writes per-user HKCU\Software\Classes registry entries for the magnet: scheme and the .torrent file type (no admin rights needed).
macOS: not supported (LaunchServices has no CLI scheme registration).
| Modifier and Type | Field and Description |
|---|---|
static String | DESKTOP_ID |
| Modifier and Type | Method and Description |
|---|---|
static String | install(String consoleBaseUrl)Register the browser handler pointing at the given console base URL,
e.g. |
static String | installLinux(String consoleBaseUrl,
File home)Linux registration with an explicit home directory (testable). |
public static final String DESKTOP_ID
public static String install(String consoleBaseUrl) throws IOException
consoleBaseUrl - base URL of the I2PSnark webappIOException - on any failurepublic static String installLinux(String consoleBaseUrl, File home) throws IOException
consoleBaseUrl - base URL of the I2PSnark webapphome - the user home dir, e.g. System.getProperty("user.home")IOException - on any failure