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
|
@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 chromiumFirst = false;
|
||||||
public boolean usability = false;
|
public boolean usability = false;
|
||||||
|
|
||||||
private void launchFirefox(boolean privateWindow, String[] url) {
|
private void launchFirefox(int privateWindow, String[] url) {
|
||||||
logger.info("I2PFirefox");
|
logger.info("I2PFirefox" + privateWindow);
|
||||||
I2PFirefox.usability = usability;
|
I2PFirefox.usability = usability;
|
||||||
i2pFirefox.launch(privateWindow, url);
|
i2pFirefox.launch(privateWindow, url);
|
||||||
}
|
}
|
||||||
private void launchChromium(boolean privateWindow, String[] url) {
|
private void launchChromium(int privateWindow, String[] url) {
|
||||||
logger.info("I2PChromium");
|
logger.info("I2PChromium" + privateWindow);
|
||||||
I2PChromiumProfileBuilder.usability = usability;
|
I2PChromiumProfileBuilder.usability = usability;
|
||||||
i2pChromium.launch(privateWindow, url);
|
i2pChromium.launch(privateWindow, url);
|
||||||
}
|
}
|
||||||
private void launchGeneric(boolean privateWindow, String[] url) {
|
private void launchGeneric(int privateWindowInt, String[] url) {
|
||||||
logger.info("I2PChromium");
|
boolean privateWindow = false;
|
||||||
|
if (privateWindowInt == 1)
|
||||||
|
privateWindow = true;
|
||||||
|
logger.info("I2PGeneric" + privateWindowInt);
|
||||||
i2pGeneral.launch(privateWindow, url);
|
i2pGeneral.launch(privateWindow, url);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -111,7 +114,7 @@ public class I2PBrowser extends I2PCommonBrowser {
|
|||||||
* profile).
|
* profile).
|
||||||
* @since 0.0.17
|
* @since 0.0.17
|
||||||
*/
|
*/
|
||||||
public void launch(boolean privateWindow, String[] url) {
|
public void launch(int privateWindow, String[] url) {
|
||||||
validateUserDir();
|
validateUserDir();
|
||||||
if (generic)
|
if (generic)
|
||||||
this.launchGeneric(privateWindow, url);
|
this.launchGeneric(privateWindow, url);
|
||||||
@ -154,7 +157,12 @@ public class I2PBrowser extends I2PCommonBrowser {
|
|||||||
* profile).
|
* profile).
|
||||||
* @since 0.0.16
|
* @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.
|
* Populates a profile directory with a proxy configuration.
|
||||||
@ -177,7 +185,7 @@ public class I2PBrowser extends I2PCommonBrowser {
|
|||||||
|
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
validateUserDir();
|
validateUserDir();
|
||||||
boolean privateBrowsing = false;
|
int privateBrowsing = 0;
|
||||||
logger.info("I2PBrowser");
|
logger.info("I2PBrowser");
|
||||||
I2PBrowser i2pBrowser = new I2PBrowser();
|
I2PBrowser i2pBrowser = new I2PBrowser();
|
||||||
ArrayList<String> visitURL = new ArrayList<String>();
|
ArrayList<String> visitURL = new ArrayList<String>();
|
||||||
@ -185,7 +193,7 @@ public class I2PBrowser extends I2PCommonBrowser {
|
|||||||
if (args.length > 0) {
|
if (args.length > 0) {
|
||||||
for (String arg : args) {
|
for (String arg : args) {
|
||||||
if (arg.equals("-private")) {
|
if (arg.equals("-private")) {
|
||||||
privateBrowsing = true;
|
privateBrowsing = 1;
|
||||||
}
|
}
|
||||||
if (arg.equals("-chromium")) {
|
if (arg.equals("-chromium")) {
|
||||||
i2pBrowser.chromium = true;
|
i2pBrowser.chromium = true;
|
||||||
@ -196,6 +204,10 @@ public class I2PBrowser extends I2PCommonBrowser {
|
|||||||
if (arg.equals("-usability")) {
|
if (arg.equals("-usability")) {
|
||||||
i2pBrowser.usability = true;
|
i2pBrowser.usability = true;
|
||||||
}
|
}
|
||||||
|
if (arg.equals("-app")) {
|
||||||
|
i2pBrowser.usability = true;
|
||||||
|
privateBrowsing = 2;
|
||||||
|
}
|
||||||
if (arg.equals("-noproxycheck")) {
|
if (arg.equals("-noproxycheck")) {
|
||||||
logger.info("zeroing out proxy check");
|
logger.info("zeroing out proxy check");
|
||||||
i2pBrowser.setProxyTimeoutTime(0);
|
i2pBrowser.setProxyTimeoutTime(0);
|
||||||
|
@ -369,7 +369,7 @@ public class I2PChromium extends I2PCommonBrowser {
|
|||||||
* @since 0.0.1
|
* @since 0.0.1
|
||||||
*/
|
*/
|
||||||
public ProcessBuilder appProcessBuilder() {
|
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) {
|
public ProcessBuilder appProcessBuilder(String[] args) {
|
||||||
ArrayList<String> argList = new ArrayList<String>();
|
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 != null) {
|
||||||
if (args.length > 0) {
|
if (args.length > 0) {
|
||||||
for (String arg : args) {
|
for (String arg : args) {
|
||||||
|
@ -518,8 +518,16 @@ public class I2PFirefox extends I2PCommonBrowser {
|
|||||||
pb = this.privateProcessBuilder(url);
|
pb = this.privateProcessBuilder(url);
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
pb = this.appProcessBuilder(url);
|
logger.info("Setting up app mode " + url.toString());
|
||||||
break;
|
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:
|
default:
|
||||||
pb = this.defaultProcessBuilder(url);
|
pb = this.defaultProcessBuilder(url);
|
||||||
break;
|
break;
|
||||||
|
Reference in New Issue
Block a user