freenet-core
freenet-core copied to clipboard
Web browser integration
Use a browser profile to specify Locutus as a proxy: https://superuser.com/questions/1633255/how-can-i-start-a-google-chrome-instance-which-uses-a-proxy-while-already-having
If we decide to create a customized browser based on something like Electron, then Min may be a good starting point.
CHAT-GPT guide:
To add a new URL type in Electron, you can use the webPreferences option in the BrowserWindow options when creating a new window. This option allows you to specify custom protocol handlers and their associated handler functions.
For example, to add a new URL type for freenet keys, you could do the following:
In the main Electron process, create a new BrowserWindow instance with the following options:
const win = new BrowserWindow({
webPreferences: {
customProtocols: {
'freenet': (request) => {
// Step 2: Handle the request and rewrite the URL
}
}
}
});
In the custom protocol handler function, you can parse the freenet key from the URL and rewrite it to request it via a local HTTP listener provided by the local freenet node. For example:
const win = new BrowserWindow({
webPreferences: {
customProtocols: {
'freenet': (request) => {
// Parse the freenet key from the URL
const freenetKey = request.url.split(':')[1];
// Rewrite the URL to request it via the local freenet node
const rewrittenUrl = `http://localhost:8888/freenet/${freenetKey}`;
// Load the rewritten URL in the window
win.loadURL(rewrittenUrl);
}
}
}
});
To prevent normal HTTP requests from a website, you can use the webRequest module to block any requests that are not using the freenet protocol. For example:
const { webRequest } = require('electron');
// Block any requests that are not using the freenet protocol
webRequest.onBeforeRequest((details, callback) => {
if (details.url.startsWith('http') && !details.url.startsWith('freenet')) {
// Block the request
return callback({ cancel: true });
}
// Allow the request
callback({});
});
With these steps, you can add a new URL type for freenet keys and handle requests to them in the Electron browser.
Alternative to Electron: https://tauri.app/
Pivotal Tracker story: https://www.pivotaltracker.com/story/show/184046434
How about providing access to I2P, Tor, IPFS, etc.
How about providing access to I2P, Tor, IPFS, etc.
Foxyproxy and its conditional proxying rules? -> i2p inproxy, tor2web, ipfs http gateway, etc.
all of these today require manual setup, but I don't see why an extension or standalone browser couldn't be developed that prepackages these things.