Compare commits
26 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
41d7c188f8 | ||
![]() |
4e254d59c3 | ||
![]() |
629162372e | ||
![]() |
b1bfd39327 | ||
![]() |
3ee2c7a10d | ||
![]() |
44ce1d2ed2 | ||
![]() |
7cef932d3d | ||
![]() |
c063eae03c | ||
![]() |
7f9bcbe1c0 | ||
![]() |
e023469b93 | ||
![]() |
0cf817bb09 | ||
![]() |
865c0fca84 | ||
![]() |
6ecd993531 | ||
![]() |
b6ab50c337 | ||
![]() |
3ad98b38ab | ||
![]() |
8ba4651e32 | ||
![]() |
3e5b9c049d | ||
![]() |
e5d36aff8f | ||
![]() |
fa3fa165b1 | ||
![]() |
5211c6d7e0 | ||
![]() |
ce6a31166b | ||
![]() |
842f4bb992 | ||
![]() |
5fefdab16d | ||
![]() |
53d4cf8146 | ||
![]() |
6daeaf8297 | ||
![]() |
8645f69067 |
16
CHANGES.html
16
CHANGES.html
@@ -80,6 +80,22 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<h2>
|
||||
Sat, August 21
|
||||
</h2>
|
||||
<ul>
|
||||
<li>
|
||||
Adds support for passing the -private flag to start Firefox with –private-window and Chromium –incognito
|
||||
</li>
|
||||
</ul>
|
||||
<h2>
|
||||
Fri, August 20
|
||||
</h2>
|
||||
<ul>
|
||||
<li>
|
||||
Chromium is now a first-class citizen
|
||||
</li>
|
||||
</ul>
|
||||
<h2>
|
||||
Fri, August 19
|
||||
</h2>
|
||||
|
10
CHANGES.md
10
CHANGES.md
@@ -1,3 +1,13 @@
|
||||
Sat, August 21
|
||||
--------------
|
||||
|
||||
- Adds support for passing the -private flag to start Firefox with --private-window and Chromium --incognito
|
||||
|
||||
Fri, August 20
|
||||
--------------
|
||||
|
||||
- Chromium is now a first-class citizen
|
||||
|
||||
Fri, August 19
|
||||
--------------
|
||||
|
||||
|
23
README.md
23
README.md
@@ -9,7 +9,7 @@ A port of the batch scripts from i2p.firefox to Java.
|
||||
```sh
|
||||
|
||||
mkdir ~/tmp-i2pfirefox && cd ~/tmp-i2pfirefox
|
||||
wget https://github.com/eyedeekay/i2p.plugins.firefox/releases/download/0.0.9/i2pfirefox.zip
|
||||
wget https://github.com/eyedeekay/i2p.plugins.firefox/releases/download/0.0.10/i2pfirefox.zip
|
||||
unzip i2pfirefox.zip
|
||||
./i2pfirefox.cmd
|
||||
|
||||
@@ -18,6 +18,27 @@ unzip i2pfirefox.zip
|
||||
./i2pchromium.cmd
|
||||
```
|
||||
|
||||
### Build Dependencies
|
||||
|
||||
You will need `ant`, `java` and for building the Chromium profile, a Go application
|
||||
called `crx3` which is used to interact with the Chrome app store. I've been using Java 17
|
||||
on Debian mostly, on Debian and Ubuntu, install the dependencies with:
|
||||
|
||||
```sh
|
||||
sudo apt-get install openjdk-17* ant golang-go
|
||||
go install github.com/mediabuyerbot/go-crx3/crx3@latest
|
||||
```
|
||||
|
||||
For Fedora, use Yum, for Arch use pacman or something else but make sure to tell everyone
|
||||
about it. Once you have that installed, when building, make sure to add `$GOPATH/bin/`
|
||||
to your `$PATH`.
|
||||
|
||||
```sh
|
||||
export PATH=$PATH:$HOME/go/bin
|
||||
```
|
||||
|
||||
Will almost always work.
|
||||
|
||||
### Building
|
||||
|
||||
This is not actually a plugin yet, but it will be soon. The important bit is the jar.
|
||||
|
27
build.xml
27
build.xml
@@ -24,11 +24,7 @@
|
||||
</exec>
|
||||
</target>
|
||||
|
||||
<target name="i2pChromiumBaseProfileZip">
|
||||
<exec executable="rm" failonerror="false" dir="src">
|
||||
<arg value="-rf" />
|
||||
<arg value="i2p.chromium.base.profile.zip" />
|
||||
</exec>
|
||||
<target name="i2pChromiumBaseProfile">
|
||||
<exec executable="crx3" failonerror="true">
|
||||
<arg value="download"/>
|
||||
<arg value="ikdjcmomgldfciocnpekfndklkfgglpe" />
|
||||
@@ -36,7 +32,16 @@
|
||||
<arg value="-o" />
|
||||
<arg value="src/i2p.chromium.base.profile/extensions/i2pchrome.js.crx" />
|
||||
</exec>
|
||||
<!--<exec executable="crx3" failonerror="true">
|
||||
<!--
|
||||
TODO: I don't want to deal with licensing issues while on a headfull of cold
|
||||
medicine and COVID. SO for now I'm only including a plugin written by a person
|
||||
who I'm pretty sure isn't going to sue me for it(me). In order to more closely
|
||||
mirror the behavior of the Firefox profile, we should at least include a script
|
||||
blocking plugin, such as ScriptSafe. uBlock was also suggested and I tend to
|
||||
agree. However, since we have to load extensions unpacked, they won't be updated
|
||||
automatically. This is probably good for working against fingerprinting but it's
|
||||
also more work should a plugin have a security vulnerability.
|
||||
<exec executable="crx3" failonerror="true">
|
||||
<arg value="download"/>
|
||||
<arg value="cjpalhdlnbpafiamejdnhcphjbkeiagm" />
|
||||
<arg value="-u=true"/>
|
||||
@@ -50,6 +55,13 @@
|
||||
<arg value="-o" />
|
||||
<arg value="src/i2p.chromium.base.profile/extensions/scriptsafe.js.crx" />
|
||||
</exec>-->
|
||||
</target>
|
||||
|
||||
<target name="i2pChromiumBaseProfileZip">
|
||||
<exec executable="rm" failonerror="false" dir="src">
|
||||
<arg value="-rf" />
|
||||
<arg value="i2p.chromium.base.profile.zip" />
|
||||
</exec>
|
||||
<exec executable="zip" failonerror="true" dir="src">
|
||||
<arg value="-r"/>
|
||||
<arg value="i2p.chromium.base.profile.zip"/>
|
||||
@@ -66,7 +78,8 @@
|
||||
<arg value="-r"/>
|
||||
<arg value="i2pfirefox.zip"/>
|
||||
<arg value="src/build/i2pfirefox.jar"/>
|
||||
<arg value="i2pbrowser.cmd"/>
|
||||
<arg value="i2pfirefox.cmd"/>
|
||||
<arg value="i2pchromium.cmd"/>
|
||||
<arg value="LICENSE.md"/>
|
||||
<arg value="README.md"/>
|
||||
</exec>
|
||||
|
3
i2pchromium-private.cmd
Executable file
3
i2pchromium-private.cmd
Executable file
@@ -0,0 +1,3 @@
|
||||
:; dir=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd); java -cp "$dir"/src/build/i2pfirefox.jar net.i2p.i2pfirefox.I2PChromium -private; exit $?
|
||||
@ECHO OFF
|
||||
java -cp %cd%/src/build/i2pfirefox.jar net.i2p.i2pfirefox.I2PChromium -private
|
3
i2pfirefox-private.cmd
Executable file
3
i2pfirefox-private.cmd
Executable file
@@ -0,0 +1,3 @@
|
||||
:; dir=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd); java -cp "$dir"/src/build/i2pfirefox.jar net.i2p.i2pfirefox.I2PFirefox -private; exit $?
|
||||
@ECHO OFF
|
||||
java -cp %cd%/src/build/i2pfirefox.jar net.i2p.i2pfirefox.I2PFirefox -private
|
42
index.html
42
index.html
@@ -94,7 +94,7 @@
|
||||
</h3>
|
||||
<pre><code>
|
||||
mkdir ~/tmp-i2pfirefox && cd ~/tmp-i2pfirefox
|
||||
wget https://github.com/eyedeekay/i2p.plugins.firefox/releases/download/0.0.9/i2pfirefox.zip
|
||||
wget https://github.com/eyedeekay/i2p.plugins.firefox/releases/download/0.0.10/i2pfirefox.zip
|
||||
unzip i2pfirefox.zip
|
||||
./i2pfirefox.cmd
|
||||
|
||||
@@ -102,6 +102,46 @@ unzip i2pfirefox.zip
|
||||
|
||||
./i2pchromium.cmd
|
||||
</code></pre>
|
||||
<h3>
|
||||
Build Dependencies
|
||||
</h3>
|
||||
<p>
|
||||
You will need
|
||||
<code>
|
||||
ant
|
||||
</code>
|
||||
,
|
||||
<code>
|
||||
java
|
||||
</code>
|
||||
and for building the Chromium profile, a Go application
|
||||
called
|
||||
<code>
|
||||
crx3
|
||||
</code>
|
||||
which is used to interact with the Chrome app store. I’ve been using Java 17
|
||||
on Debian mostly, on Debian and Ubuntu, install the dependencies with:
|
||||
</p>
|
||||
<pre><code>sudo apt-get install openjdk-17* ant golang-go
|
||||
go install github.com/mediabuyerbot/go-crx3/crx3@latest
|
||||
</code></pre>
|
||||
<p>
|
||||
For Fedora, use Yum, for Arch use pacman or something else but make sure to tell everyone
|
||||
about it. Once you have that installed, when building, make sure to add
|
||||
<code>
|
||||
$GOPATH/bin/
|
||||
</code>
|
||||
to your
|
||||
<code>
|
||||
$PATH
|
||||
</code>
|
||||
.
|
||||
</p>
|
||||
<pre><code>export PATH=$PATH:$HOME/go/bin
|
||||
</code></pre>
|
||||
<p>
|
||||
Will almost always work.
|
||||
</p>
|
||||
<h3>
|
||||
Building
|
||||
</h3>
|
||||
|
@@ -2,9 +2,9 @@
|
||||
|
||||
GITHUB_USER=eyedeekay
|
||||
GITHUB_REPO=i2p.plugins.firefox
|
||||
GITHUB_NAME="Which fixes some Chromium issues identified by xip"
|
||||
GITHUB_NAME="Which adds the ability to pass the -private flag to the command line to launch a private browser instance."
|
||||
GITHUB_DESCRIPTION=$(cat CHANGES.md)
|
||||
GITHUB_TAG=0.0.9
|
||||
GITHUB_TAG=0.0.15
|
||||
ant distclean
|
||||
ant jar freeZip
|
||||
github-release release --user "${GITHUB_USER}" \
|
||||
@@ -13,6 +13,11 @@ github-release release --user "${GITHUB_USER}" \
|
||||
--description "${GITHUB_DESCRIPTION}" \
|
||||
--tag "${GITHUB_TAG}"; true
|
||||
sleep 2s
|
||||
github-release edit --user "${GITHUB_USER}" \
|
||||
--repo "${GITHUB_REPO}" \
|
||||
--name "${GITHUB_NAME}" \
|
||||
--description "${GITHUB_DESCRIPTION}" \
|
||||
--tag "${GITHUB_TAG}"; true
|
||||
github-release upload --user "${GITHUB_USER}" \
|
||||
--repo "${GITHUB_REPO}" \
|
||||
--tag "${GITHUB_TAG}" \
|
||||
|
@@ -1,3 +1,3 @@
|
||||
#Build Number for ANT. Do not edit!
|
||||
#Mon Aug 15 01:27:49 EDT 2022
|
||||
build.number=87
|
||||
#Sun Aug 21 17:53:26 EDT 2022
|
||||
build.number=88
|
||||
|
@@ -517,7 +517,7 @@ user_pref("security.mixed_content.block_display_content", true);
|
||||
* [SETTING] Privacy & Security>HTTPS-Only Mode (and manage exceptions)
|
||||
* [TEST] http://example.com [upgrade]
|
||||
* [TEST] http://httpforever.com/ [no upgrade] ***/
|
||||
user_pref("dom.security.https_only_mode", true); // [FF76+]
|
||||
user_pref("dom.security.https_only_mode", false); // [FF76+]
|
||||
// user_pref("dom.security.https_only_mode_pbm", true); // [FF80+]
|
||||
/* 1245: enable HTTPS-Only mode for local resources [FF77+] ***/
|
||||
// user_pref("dom.security.https_only_mode.upgrade_local", true);
|
||||
|
@@ -77,7 +77,7 @@ public class I2PChromium {
|
||||
int i = 0;
|
||||
for (String s : path) {
|
||||
for (String exe : exes) {
|
||||
exePath[i] = s + exe;
|
||||
exePath[i] = s + "\\" + exe;
|
||||
i++;
|
||||
}
|
||||
}
|
||||
@@ -202,8 +202,10 @@ public class I2PChromium {
|
||||
for (String chrome : chromees) {
|
||||
File chromeFile = new File(chrome);
|
||||
if (chromeFile.exists()) {
|
||||
System.out.println("Found valid chromium at " + chrome);
|
||||
validChromiums.add(chrome);
|
||||
}
|
||||
System.out.println("chrome at " + chrome + "does not exist");
|
||||
}
|
||||
return validChromiums.toArray(new String[validChromiums.size()]);
|
||||
}
|
||||
@@ -339,11 +341,14 @@ public class I2PChromium {
|
||||
new File(I2PChromiumProfileBuilder.profileDirectory(),"extensions/ublock.js").getAbsolutePath()
|
||||
+","+
|
||||
new File(I2PChromiumProfileBuilder.profileDirectory(),"extensions/scriptsafe.js").getAbsolutePath();*/
|
||||
for (int i = 0; i < args.length; i++) {
|
||||
newArgs[i+19] = args[i];
|
||||
if (args.length > 0) {
|
||||
for (int i = 0; i < args.length; i++) {
|
||||
newArgs[i+20] = args[i];
|
||||
}
|
||||
}
|
||||
return new ProcessBuilder(newArgs).directory(I2PChromiumProfileBuilder.runtimeDirectory(true));
|
||||
} else {
|
||||
System.out.println("No Chromium found.");
|
||||
return new ProcessBuilder(args);
|
||||
}
|
||||
}
|
||||
@@ -444,21 +449,20 @@ public class I2PChromium {
|
||||
} else {
|
||||
pb = this.defaultProcessBuilder();
|
||||
}
|
||||
|
||||
Process p = null;
|
||||
try{
|
||||
System.out.println(pb.command());
|
||||
p = pb.start();
|
||||
}catch(Exception e){
|
||||
System.out.println("Error: "+e.getMessage());
|
||||
}finally{
|
||||
Process p = pb.start();
|
||||
sleep(2000);
|
||||
System.out.println("I2PChromium");
|
||||
try{
|
||||
System.out.println("Waiting for I2PChromium to close...");
|
||||
p.waitFor();
|
||||
int exit = p.waitFor();
|
||||
System.out.println("I2PChromium exited with value: "+exit);
|
||||
}catch(Exception e){
|
||||
System.out.println("Error: "+e.getMessage());
|
||||
}
|
||||
}catch(Exception e){
|
||||
System.out.println("Error: "+e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -474,8 +478,24 @@ public class I2PChromium {
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
boolean privateBrowsing = false;
|
||||
if (args != null && args.length > 0) {
|
||||
System.out.println("checking for private browsing");
|
||||
if (args[0].equals("-private")) {
|
||||
privateBrowsing = true;
|
||||
System.out.println("private browsing is true, profile will be discarded at end of session");
|
||||
}
|
||||
}
|
||||
System.out.println("I2PChromium");
|
||||
I2PChromium i2pChromium = new I2PChromium();
|
||||
i2pChromium.launch();
|
||||
}
|
||||
i2pChromium.launch(privateBrowsing);
|
||||
}
|
||||
private static void sleep(int millis) {
|
||||
try {
|
||||
Thread.sleep(millis);
|
||||
} catch (InterruptedException bad) {
|
||||
bad.printStackTrace();
|
||||
throw new RuntimeException(bad);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -70,12 +70,19 @@ public class I2PFirefox {
|
||||
new File(programFiles86, "Waterfox/").toString(),
|
||||
new File(programFiles, "Librewolf/").toString(),
|
||||
};
|
||||
String[] exes = new String[]{"firefox.exe", "firefox-bin.exe", "firefox-esr.exe", "waterfox.exe", "waterfox-bin.exe", "librewolf.exe"};
|
||||
String[] exes = new String[]{
|
||||
"firefox.exe",
|
||||
"firefox-bin.exe",
|
||||
"firefox-esr.exe",
|
||||
"waterfox.exe",
|
||||
"waterfox-bin.exe",
|
||||
"librewolf.exe",
|
||||
};
|
||||
String[] exePath = new String[path.length * exes.length];
|
||||
int i = 0;
|
||||
for (String s : path) {
|
||||
for (String exe : exes) {
|
||||
exePath[i] = s + exe;
|
||||
exePath[i] = s + "\\" + exe;
|
||||
i++;
|
||||
}
|
||||
}
|
||||
@@ -200,8 +207,10 @@ public class I2PFirefox {
|
||||
for (String firefox : firefoxes) {
|
||||
File firefoxFile = new File(firefox);
|
||||
if (firefoxFile.exists()) {
|
||||
System.out.println("Found valid firefox at " + firefox);
|
||||
validFirefoxes.add(firefox);
|
||||
}
|
||||
System.out.println("firefox at " + firefox + "does not exist");
|
||||
}
|
||||
return validFirefoxes.toArray(new String[validFirefoxes.size()]);
|
||||
}
|
||||
@@ -273,7 +282,7 @@ public class I2PFirefox {
|
||||
* the default profile.
|
||||
* @since 0.0.1
|
||||
*/
|
||||
public ProcessBuilder privateProcessBuilder(String[] args) {
|
||||
public ProcessBuilder privateProcessBuilder() {
|
||||
return processBuilder(new String[]{"--private-window"});
|
||||
}
|
||||
|
||||
@@ -294,11 +303,14 @@ public class I2PFirefox {
|
||||
newArgs[0] = firefox;
|
||||
newArgs[1] = "--profile";
|
||||
newArgs[2] = I2PFirefoxProfileBuilder.profileDirectory();
|
||||
for (int i = 0; i < args.length; i++) {
|
||||
newArgs[i+3] = args[i];
|
||||
if (args.length > 0) {
|
||||
for (int i = 0; i < args.length; i++) {
|
||||
newArgs[i+3] = args[i];
|
||||
}
|
||||
}
|
||||
return new ProcessBuilder(newArgs).directory(I2PFirefoxProfileBuilder.runtimeDirectory(true));
|
||||
} else {
|
||||
System.out.println("No Firefox found.");
|
||||
return new ProcessBuilder(args);
|
||||
}
|
||||
}
|
||||
@@ -393,26 +405,26 @@ public class I2PFirefox {
|
||||
}
|
||||
}
|
||||
if (waitForProxy()){
|
||||
ProcessBuilder pb = null;
|
||||
ProcessBuilder pb;
|
||||
if (privateWindow) {
|
||||
pb = privateProcessBuilder(new String[]{});
|
||||
pb = privateProcessBuilder();
|
||||
} else {
|
||||
pb = defaultProcessBuilder();
|
||||
}
|
||||
Process p = null;
|
||||
try{
|
||||
System.out.println(pb.command());
|
||||
p = pb.start();
|
||||
}catch(Exception e){
|
||||
System.out.println("Error: "+e.getMessage());
|
||||
}finally{
|
||||
Process p = pb.start();
|
||||
System.out.println("I2PFirefox");
|
||||
sleep(2000);
|
||||
try{
|
||||
System.out.println("Waiting for I2PFirefox to close...");
|
||||
p.waitFor();
|
||||
int exit = p.waitFor();
|
||||
System.out.println("I2PFirefox exited with value: "+exit);
|
||||
}catch(Exception e){
|
||||
System.out.println("Error: "+e.getMessage());
|
||||
}
|
||||
}catch(Exception e){
|
||||
System.out.println("Error: "+e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -430,8 +442,25 @@ public class I2PFirefox {
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
boolean privateBrowsing = false;
|
||||
if (args != null && args.length > 0) {
|
||||
System.out.println("checking for private browsing");
|
||||
if (args[0].equals("-private")) {
|
||||
privateBrowsing = true;
|
||||
System.out.println("private browsing is true, profile will be discarded at end of session");
|
||||
}
|
||||
}
|
||||
System.out.println("I2PFirefox");
|
||||
I2PFirefox i2pFirefox = new I2PFirefox();
|
||||
i2pFirefox.launch();
|
||||
}
|
||||
i2pFirefox.launch(privateBrowsing);
|
||||
}
|
||||
|
||||
private static void sleep(int millis) {
|
||||
try {
|
||||
Thread.sleep(millis);
|
||||
} catch (InterruptedException bad) {
|
||||
bad.printStackTrace();
|
||||
throw new RuntimeException(bad);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user