Compare commits

...

12 Commits

Author SHA1 Message Date
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
5 changed files with 47 additions and 26 deletions

View File

@ -32,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"/>

View File

@ -2,9 +2,9 @@
GITHUB_USER=eyedeekay
GITHUB_REPO=i2p.plugins.firefox
GITHUB_NAME="Which moves the launcher scripts around slightly"
GITHUB_NAME="Which fixes a Windows-specific bug"
GITHUB_DESCRIPTION=$(cat CHANGES.md)
GITHUB_TAG=0.0.10
GITHUB_TAG=0.0.14
ant distclean
ant jar freeZip
github-release release --user "${GITHUB_USER}" \

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

@ -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,14 +449,9 @@ 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();
System.out.println("I2PChromium");
try{
System.out.println("Waiting for I2PChromium to close...");
@ -459,6 +459,8 @@ public class I2PChromium {
}catch(Exception e){
System.out.println("Error: "+e.getMessage());
}
}catch(Exception e){
System.out.println("Error: "+e.getMessage());
}
}
}

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,19 +405,15 @@ 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");
try{
System.out.println("Waiting for I2PFirefox to close...");
@ -413,6 +421,8 @@ public class I2PFirefox {
}catch(Exception e){
System.out.println("Error: "+e.getMessage());
}
}catch(Exception e){
System.out.println("Error: "+e.getMessage());
}
}
}