Compare commits

...

4 Commits
0.0.6 ... 0.0.7

Author SHA1 Message Date
idk
120f92d626 update version 2022-08-19 18:47:20 -04:00
idk
2c7b9a8fea add private-windows support 2022-08-19 18:45:59 -04:00
idk
20fd681f46 add private-windows support 2022-08-19 18:44:06 -04:00
idk
31c7096edc add private-windows support 2022-08-19 18:30:14 -04:00
8 changed files with 78 additions and 37 deletions

View File

@ -1,3 +1,8 @@
Fri, August 19
--------------
- Adds the ability to pass --private-window to Firefoxes and --incognito to Chromiums
Mon, August 8 Mon, August 8
------------- -------------

View File

@ -12,9 +12,7 @@ produces the jar as a by-product, or you can:
```sh ```sh
cd src ant jar
ant
cd ..
``` ```
To build just the jar. You'll know it worked if you can: To build just the jar. You'll know it worked if you can:

View File

@ -43,6 +43,7 @@
</exec> </exec>
<exec executable="zip" failonerror="true"> <exec executable="zip" failonerror="true">
<arg value="-r"/> <arg value="-r"/>
<arg value="i2pfirefox.zip"/>
<arg value="src/build/i2pfirefox.jar"/> <arg value="src/build/i2pfirefox.jar"/>
<arg value="i2pbrowser.cmd"/> <arg value="i2pbrowser.cmd"/>
<arg value="LICENSE.md"/> <arg value="LICENSE.md"/>

View File

@ -2,16 +2,16 @@
GITHUB_USER=eyedeekay GITHUB_USER=eyedeekay
GITHUB_REPO=i2p.plugins.firefox GITHUB_REPO=i2p.plugins.firefox
GITHUB_NAME="With a launcher script so you can run it without typing the full java command" GITHUB_NAME="With Private Windows and Incognito support"
GITHUB_DESCRIPTION=$(cat CHANGES.md) GITHUB_DESCRIPTION=$(cat CHANGES.md)
GITHUB_TAG=0.0.6 GITHUB_TAG=0.0.7
ant distclean ant distclean
ant jar freeZip ant jar freeZip
github-release release --user "${GITHUB_USER}" \ github-release release --user "${GITHUB_USER}" \
--repo "${GITHUB_REPO}" \ --repo "${GITHUB_REPO}" \
--name "${GITHUB_NAME}" \ --name "${GITHUB_NAME}" \
--description "${GITHUB_DESCRIPTION}" \ --description "${GITHUB_DESCRIPTION}" \
--tag "${GITHUB_TAG}" --tag "${GITHUB_TAG}"; true
sleep 2s sleep 2s
github-release upload --user "${GITHUB_USER}" \ github-release upload --user "${GITHUB_USER}" \
--repo "${GITHUB_REPO}" \ --repo "${GITHUB_REPO}" \

View File

@ -1,3 +1,3 @@
#Build Number for ANT. Do not edit! #Build Number for ANT. Do not edit!
#Sun Aug 07 20:17:38 EDT 2022 #Mon Aug 15 01:27:49 EDT 2022
build.number=85 build.number=87

View File

@ -265,6 +265,19 @@ public class I2PChromium {
return processBuilder(new String[]{}); return processBuilder(new String[]{});
} }
/*
* Build a ProcessBuilder for the top Chromium binary and
* the default profile.
*
* @param args the arguments to pass to the Chromium binary.
* @return a ProcessBuilder for the top Chromium binary and
* the default profile. Always passes the --incognito flag.
* @since 0.0.1
*/
public ProcessBuilder privateProcessBuilder() {
return processBuilder(new String[]{"--incognito"});
}
/* /*
1 --user-data-dir="$CHROMIUM_I2P" \ 1 --user-data-dir="$CHROMIUM_I2P" \
2 --proxy-server="http://127.0.0.1:4444" \ 2 --proxy-server="http://127.0.0.1:4444" \
@ -403,9 +416,10 @@ public class I2PChromium {
* Waits for an HTTP proxy on the port 4444 to be ready. * Waits for an HTTP proxy on the port 4444 to be ready.
* Launches Chromium with the profile directory. * Launches Chromium with the profile directory.
* *
* @param bool if true, the profile will be ephemeral(i.e. a --private-window profile).
* @since 0.0.1 * @since 0.0.1
*/ */
public void launch(){ public void launch(boolean privateWindow){
String profileDirectory = I2PChromiumProfileBuilder.profileDirectory(); String profileDirectory = I2PChromiumProfileBuilder.profileDirectory();
if (I2PChromiumProfileChecker.validateProfileDirectory(profileDirectory)) { if (I2PChromiumProfileChecker.validateProfileDirectory(profileDirectory)) {
System.out.println("Valid profile directory: "+profileDirectory); System.out.println("Valid profile directory: "+profileDirectory);
@ -419,7 +433,13 @@ public class I2PChromium {
} }
} }
if (waitForProxy()){ if (waitForProxy()){
ProcessBuilder pb = this.defaultProcessBuilder(); ProcessBuilder pb = null;
if (privateWindow) {
pb = this.privateProcessBuilder();
} else {
pb = this.defaultProcessBuilder();
}
Process p = null; Process p = null;
try{ try{
System.out.println(pb.command()); System.out.println(pb.command());
@ -437,6 +457,16 @@ public class I2PChromium {
} }
} }
} }
/*
* Populates a profile directory with a proxy configuration.
* Waits for an HTTP proxy on the port 4444 to be ready.
* Launches Chromium with the profile directory.
*
* @since 0.0.1
*/
public void launch(){
launch(false);
}
public static void main(String[] args) { public static void main(String[] args) {
System.out.println("I2PChromium"); System.out.println("I2PChromium");

View File

@ -262,6 +262,20 @@ public class I2PFirefox {
return processBuilder(new String[]{}); return processBuilder(new String[]{});
} }
/*
* Build a ProcessBuilder for the top Firefox binary and
* the default profile. Pass the --private-window flag to
* open a private window.
*
* @param args the arguments to pass to the Firefox binary.
* @return a ProcessBuilder for the top Firefox binary and
* the default profile.
* @since 0.0.1
*/
public ProcessBuilder privateProcessBuilder(String[] args) {
return processBuilder(new String[]{"--private-window"});
}
/* /*
* Build a ProcessBuilder for the top Firefox binary and * Build a ProcessBuilder for the top Firefox binary and
* the default profile, with a specific set of extended * the default profile, with a specific set of extended
@ -361,9 +375,10 @@ public class I2PFirefox {
* Waits for an HTTP proxy on the port 4444 to be ready. * Waits for an HTTP proxy on the port 4444 to be ready.
* Launches Firefox with the profile directory. * Launches Firefox with the profile directory.
* *
* @param bool if true, the profile will be ephemeral(i.e. a --private-window profile).
* @since 0.0.1 * @since 0.0.1
*/ */
public void launch(){ public void launch(boolean privateWindow){
String profileDirectory = I2PFirefoxProfileBuilder.profileDirectory(); String profileDirectory = I2PFirefoxProfileBuilder.profileDirectory();
if (I2PFirefoxProfileChecker.validateProfileDirectory(profileDirectory)) { if (I2PFirefoxProfileChecker.validateProfileDirectory(profileDirectory)) {
System.out.println("Valid profile directory: "+profileDirectory); System.out.println("Valid profile directory: "+profileDirectory);
@ -377,7 +392,12 @@ public class I2PFirefox {
} }
} }
if (waitForProxy()){ if (waitForProxy()){
ProcessBuilder pb = this.defaultProcessBuilder(); ProcessBuilder pb = null;
if (privateWindow) {
pb = privateProcessBuilder(new String[]{});
} else {
pb = defaultProcessBuilder();
}
Process p = null; Process p = null;
try{ try{
System.out.println(pb.command()); System.out.println(pb.command());
@ -396,6 +416,18 @@ public class I2PFirefox {
} }
} }
/*
* Populates a profile directory with a proxy configuration.
* Waits for an HTTP proxy on the port 4444 to be ready.
* Launches Firefox with the profile directory. Uses a semi-permanent
* profile.
*
* @since 0.0.1
*/
public void launch(){
launch(false);
}
public static void main(String[] args) { public static void main(String[] args) {
System.out.println("I2PFirefox"); System.out.println("I2PFirefox");
I2PFirefox i2pFirefox = new I2PFirefox(); I2PFirefox i2pFirefox = new I2PFirefox();

View File

@ -22,29 +22,4 @@
<url-pattern>/index.html</url-pattern> <url-pattern>/index.html</url-pattern>
</servlet-mapping> </servlet-mapping>
<servlet-mapping>
<servlet-name>net.i2p.i2pfirefox.announce_jsp</servlet-name>
<url-pattern>/announce.php</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>net.i2p.i2pfirefox.announce_jsp</servlet-name>
<url-pattern>/announce</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>net.i2p.i2pfirefox.announce_jsp</servlet-name>
<url-pattern>/a</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>net.i2p.i2pfirefox.scrape_jsp</servlet-name>
<url-pattern>/scrape</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>net.i2p.i2pfirefox.scrape_jsp</servlet-name>
<url-pattern>/scrape.php</url-pattern>
</servlet-mapping>
</web-app> </web-app>