Compare commits

...

26 Commits

Author SHA1 Message Date
idk
41d7c188f8 update CHANGES.html 2022-08-21 20:19:46 -04:00
idk
4e254d59c3 sleep 2 seconds before waiting? I have no idea why Windows thinks it's exit 0 2022-08-21 20:19:08 -04:00
idk
629162372e sleep 2 seconds before waiting? I have no idea why Windows thinks it's exit 0 2022-08-21 20:01:34 -04:00
idk
b1bfd39327 analyze exit value 2022-08-21 19:34:29 -04:00
idk
3ee2c7a10d add launchers for private mode 2022-08-21 19:25:05 -04:00
idk
44ce1d2ed2 disable https-only mode for now 2022-08-21 19:03:03 -04:00
idk
7cef932d3d fix path issue on Windows 2022-08-21 18:13:17 -04:00
idk
c063eae03c fix path issue on Windows 2022-08-21 18:03:17 -04:00
idk
7f9bcbe1c0 fix path issue on Windows 2022-08-21 17:59:55 -04:00
idk
e023469b93 log a little more 2022-08-21 17:56:56 -04:00
idk
0cf817bb09 don't initialize the process to null 2022-08-21 17:36:15 -04:00
idk
865c0fca84 don't initialize the process to null 2022-08-21 17:34:03 -04:00
idk
6ecd993531 add note about licensing TODO 2022-08-21 14:37:24 -04:00
idk
b6ab50c337 Fixes a bug in privateProcessBuilder 2022-08-21 01:13:38 -04:00
idk
3ad98b38ab Fixes a bug in privateProcessBuilder 2022-08-21 01:12:52 -04:00
idk
8ba4651e32 Fixes a bug in privateProcessBuilder 2022-08-21 01:12:37 -04:00
idk
3e5b9c049d only add more flags when more flags are passed. 2022-08-21 00:25:27 -04:00
idk
e5d36aff8f fix an issue where passing the -private flag annihilates extension flags 2022-08-20 23:50:08 -04:00
idk
fa3fa165b1 update index.html 2022-08-20 22:49:08 -04:00
idk
5211c6d7e0 move target for chrome extension out of main build process because of requirement on go-crx3 2022-08-20 22:47:51 -04:00
idk
ce6a31166b update index.html 2022-08-20 21:04:45 -04:00
idk
842f4bb992 update CHANGES.html 2022-08-20 20:58:13 -04:00
idk
5fefdab16d update index.html 2022-08-20 20:58:10 -04:00
idk
53d4cf8146 update CHANGES.html 2022-08-20 20:54:21 -04:00
idk
6daeaf8297 update index.html 2022-08-20 20:54:17 -04:00
idk
8645f69067 Bump again 2022-08-20 20:53:31 -04:00
12 changed files with 201 additions and 41 deletions

View File

@@ -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>

View File

@@ -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
--------------

View File

@@ -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.

View File

@@ -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
View 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
View 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

View File

@@ -94,7 +94,7 @@
</h3>
<pre><code>
mkdir ~/tmp-i2pfirefox &amp;&amp; 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. Ive 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>

View File

@@ -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}" \

View File

@@ -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

View File

@@ -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);

View File

@@ -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);
}
}
}

View File

@@ -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);
}
}
}