adds the -app mode flag
This commit is contained in:
@ -1,3 +1,3 @@
|
||||
:; dir=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd); java -cp "$dir"/src/build/i2pfirefox.jar net.i2p.i2pfirefox.I2PBrowser; exit $?
|
||||
:; dir=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd); java -cp "$dir"/src/build/i2pfirefox.jar net.i2p.i2pfirefox.I2PBrowser -app; exit $?
|
||||
@ECHO OFF
|
||||
java -cp %cd%/src/build/i2pfirefox.jar net.i2p.i2pfirefox.I2PBrowser
|
||||
java -cp %cd%/src/build/i2pfirefox.jar net.i2p.i2pfirefox.I2PBrowser -app
|
@ -31,18 +31,21 @@ public class I2PBrowser extends I2PCommonBrowser {
|
||||
public boolean chromiumFirst = false;
|
||||
public boolean usability = false;
|
||||
|
||||
private void launchFirefox(boolean privateWindow, String[] url) {
|
||||
logger.info("I2PFirefox");
|
||||
private void launchFirefox(int privateWindow, String[] url) {
|
||||
logger.info("I2PFirefox" + privateWindow);
|
||||
I2PFirefox.usability = usability;
|
||||
i2pFirefox.launch(privateWindow, url);
|
||||
}
|
||||
private void launchChromium(boolean privateWindow, String[] url) {
|
||||
logger.info("I2PChromium");
|
||||
private void launchChromium(int privateWindow, String[] url) {
|
||||
logger.info("I2PChromium" + privateWindow);
|
||||
I2PChromiumProfileBuilder.usability = usability;
|
||||
i2pChromium.launch(privateWindow, url);
|
||||
}
|
||||
private void launchGeneric(boolean privateWindow, String[] url) {
|
||||
logger.info("I2PChromium");
|
||||
private void launchGeneric(int privateWindowInt, String[] url) {
|
||||
boolean privateWindow = false;
|
||||
if (privateWindowInt == 1)
|
||||
privateWindow = true;
|
||||
logger.info("I2PGeneric" + privateWindowInt);
|
||||
i2pGeneral.launch(privateWindow, url);
|
||||
}
|
||||
|
||||
@ -111,7 +114,7 @@ public class I2PBrowser extends I2PCommonBrowser {
|
||||
* profile).
|
||||
* @since 0.0.17
|
||||
*/
|
||||
public void launch(boolean privateWindow, String[] url) {
|
||||
public void launch(int privateWindow, String[] url) {
|
||||
validateUserDir();
|
||||
if (generic)
|
||||
this.launchGeneric(privateWindow, url);
|
||||
@ -154,7 +157,12 @@ public class I2PBrowser extends I2PCommonBrowser {
|
||||
* profile).
|
||||
* @since 0.0.16
|
||||
*/
|
||||
public void launch(boolean privateWindow) { launch(privateWindow, null); }
|
||||
public void launch(boolean privateWindow) {
|
||||
int privateWindowInt = 0;
|
||||
if (privateWindow)
|
||||
privateWindowInt = 1;
|
||||
launch(privateWindowInt, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Populates a profile directory with a proxy configuration.
|
||||
@ -177,7 +185,7 @@ public class I2PBrowser extends I2PCommonBrowser {
|
||||
|
||||
public static void main(String[] args) {
|
||||
validateUserDir();
|
||||
boolean privateBrowsing = false;
|
||||
int privateBrowsing = 0;
|
||||
logger.info("I2PBrowser");
|
||||
I2PBrowser i2pBrowser = new I2PBrowser();
|
||||
ArrayList<String> visitURL = new ArrayList<String>();
|
||||
@ -185,7 +193,7 @@ public class I2PBrowser extends I2PCommonBrowser {
|
||||
if (args.length > 0) {
|
||||
for (String arg : args) {
|
||||
if (arg.equals("-private")) {
|
||||
privateBrowsing = true;
|
||||
privateBrowsing = 1;
|
||||
}
|
||||
if (arg.equals("-chromium")) {
|
||||
i2pBrowser.chromium = true;
|
||||
@ -196,6 +204,10 @@ public class I2PBrowser extends I2PCommonBrowser {
|
||||
if (arg.equals("-usability")) {
|
||||
i2pBrowser.usability = true;
|
||||
}
|
||||
if (arg.equals("-app")) {
|
||||
i2pBrowser.usability = true;
|
||||
privateBrowsing = 2;
|
||||
}
|
||||
if (arg.equals("-noproxycheck")) {
|
||||
logger.info("zeroing out proxy check");
|
||||
i2pBrowser.setProxyTimeoutTime(0);
|
||||
|
@ -369,7 +369,7 @@ public class I2PChromium extends I2PCommonBrowser {
|
||||
* @since 0.0.1
|
||||
*/
|
||||
public ProcessBuilder appProcessBuilder() {
|
||||
return processBuilder(new String[] {"--app"});
|
||||
return processBuilder(new String[] {"--app=http://127.0.0.1:7657"});
|
||||
}
|
||||
|
||||
/**
|
||||
@ -383,7 +383,8 @@ public class I2PChromium extends I2PCommonBrowser {
|
||||
*/
|
||||
public ProcessBuilder appProcessBuilder(String[] args) {
|
||||
ArrayList<String> argList = new ArrayList<String>();
|
||||
argList.add("--app");
|
||||
argList.add("--app=http://127.0.0.1:7657");
|
||||
// argList.add("http://127.0.0.1:7657");
|
||||
if (args != null) {
|
||||
if (args.length > 0) {
|
||||
for (String arg : args) {
|
||||
|
@ -518,8 +518,16 @@ public class I2PFirefox extends I2PCommonBrowser {
|
||||
pb = this.privateProcessBuilder(url);
|
||||
break;
|
||||
case 2:
|
||||
pb = this.appProcessBuilder(url);
|
||||
break;
|
||||
logger.info("Setting up app mode " + url.toString());
|
||||
if (url == null || url.length == 0) {
|
||||
String[] newurl = {"http://127.0.0.1:7657"};
|
||||
logger.info("Setting up default urls" + newurl.toString());
|
||||
pb = this.appProcessBuilder(newurl);
|
||||
break;
|
||||
} else {
|
||||
pb = this.appProcessBuilder(url);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
pb = this.defaultProcessBuilder(url);
|
||||
break;
|
||||
|
Reference in New Issue
Block a user