Compare commits
29 Commits
Author | SHA1 | Date | |
---|---|---|---|
b6a66cf96e | |||
91f44d29f7 | |||
9152da34c9 | |||
e49cd5d470 | |||
02c148ccbd | |||
5216ec40f4 | |||
65e67f661b | |||
adfda72398 | |||
5f320087f0 | |||
86c0c1b68b | |||
07cc177a95 | |||
40299b00fc | |||
1c1e048c50 | |||
084ecb46ff | |||
2b80b4151a | |||
e43468c367 | |||
1f770c01ab | |||
4d79219358 | |||
3725be1d5b | |||
5d1afd8dd4 | |||
6234ffdff1 | |||
8802f9448f | |||
31d654ef4f | |||
04894a0977 | |||
a2733d8ffb | |||
100fe7fd95 | |||
91964508d8 | |||
9d347bdfa2 | |||
93f6e01e53 |
14
CHANGES.html
14
CHANGES.html
@ -118,6 +118,20 @@
|
||||
<a id="returnhome" href="/">
|
||||
/
|
||||
</a>
|
||||
<h2>
|
||||
<a href="#mon-september-5" rel="nofollow">
|
||||
<span></span>
|
||||
</a>
|
||||
Mon, September 5
|
||||
</h2>
|
||||
<ul>
|
||||
<li>
|
||||
Fix several issues with running on Windows 11
|
||||
</li>
|
||||
<li>
|
||||
Make tunnel nicknames different to avoid double shared tunnels
|
||||
</li>
|
||||
</ul>
|
||||
<h2>
|
||||
<a href="#fri-september-2" rel="nofollow">
|
||||
<span></span>
|
||||
|
@ -1,3 +1,9 @@
|
||||
Mon, September 5
|
||||
----------------
|
||||
|
||||
- Fix several issues with running on Windows 11
|
||||
- Make tunnel nicknames different to avoid double shared tunnels
|
||||
|
||||
Fri, September 2
|
||||
----------------
|
||||
|
||||
|
@ -149,6 +149,8 @@
|
||||
<p>
|
||||
Author: idk
|
||||
<br>
|
||||
Parent class: I2PCommonBrowser
|
||||
<br>
|
||||
package: net.i2p.i2pfirefox
|
||||
</p>
|
||||
<h2>
|
||||
|
@ -7,6 +7,7 @@ Description:
|
||||
> I2PBrowser.java Copyright C 2022 idk <hankhill19580@gmail.com> This program is free software: you can redistribute it and/or modify it under the terms of the MIT License. See LICENSE.md for details. This program is distributed in the hope that it will be useful but WITHOUT ANY WARRANTY without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. @description I2PBrowser is a that is used to open a browser window to the I2P network. It automatically detects the operating system and available browsers and selects the best one to use with Tor Browser at the top for Firefox and Brave at the top for Chrome.
|
||||
|
||||
Author: idk
|
||||
Parent class: I2PCommonBrowser
|
||||
package: net.i2p.i2pfirefox
|
||||
|
||||
## Dependencies
|
||||
|
@ -149,6 +149,8 @@
|
||||
<p>
|
||||
Author: idk
|
||||
<br>
|
||||
Parent class: I2PCommonBrowser
|
||||
<br>
|
||||
package: net.i2p.i2pfirefox
|
||||
</p>
|
||||
<h2>
|
||||
@ -895,7 +897,7 @@
|
||||
<span></span>
|
||||
</a>
|
||||
launch
|
||||
<a href="src/java/net/i2p/i2pfirefox/I2PChromium.java#L596" rel="nofollow">
|
||||
<a href="src/java/net/i2p/i2pfirefox/I2PChromium.java#L597" rel="nofollow">
|
||||
[src]
|
||||
</a>
|
||||
</h3>
|
||||
@ -927,7 +929,7 @@
|
||||
<span></span>
|
||||
</a>
|
||||
launch
|
||||
<a href="src/java/net/i2p/i2pfirefox/I2PChromium.java#L619" rel="nofollow">
|
||||
<a href="src/java/net/i2p/i2pfirefox/I2PChromium.java#L622" rel="nofollow">
|
||||
[src]
|
||||
</a>
|
||||
</h3>
|
||||
@ -957,7 +959,7 @@
|
||||
<span></span>
|
||||
</a>
|
||||
launch
|
||||
<a href="src/java/net/i2p/i2pfirefox/I2PChromium.java#L628" rel="nofollow">
|
||||
<a href="src/java/net/i2p/i2pfirefox/I2PChromium.java#L631" rel="nofollow">
|
||||
[src]
|
||||
</a>
|
||||
</h3>
|
||||
@ -983,7 +985,7 @@
|
||||
<span></span>
|
||||
</a>
|
||||
ValidURL
|
||||
<a href="src/java/net/i2p/i2pfirefox/I2PChromium.java#L630" rel="nofollow">
|
||||
<a href="src/java/net/i2p/i2pfirefox/I2PChromium.java#L633" rel="nofollow">
|
||||
[src]
|
||||
</a>
|
||||
</h3>
|
||||
@ -1016,7 +1018,7 @@
|
||||
<span></span>
|
||||
</a>
|
||||
main
|
||||
<a href="src/java/net/i2p/i2pfirefox/I2PChromium.java#L640" rel="nofollow">
|
||||
<a href="src/java/net/i2p/i2pfirefox/I2PChromium.java#L643" rel="nofollow">
|
||||
[src]
|
||||
</a>
|
||||
</h3>
|
||||
@ -1049,7 +1051,7 @@
|
||||
<span></span>
|
||||
</a>
|
||||
sleep
|
||||
<a href="src/java/net/i2p/i2pfirefox/I2PChromium.java#L667" rel="nofollow">
|
||||
<a href="src/java/net/i2p/i2pfirefox/I2PChromium.java#L670" rel="nofollow">
|
||||
[src]
|
||||
</a>
|
||||
</h3>
|
||||
|
@ -7,6 +7,7 @@ Description:
|
||||
> I2PChromium.java Copyright C 2022 idk <hankhill19580@gmail.com> This program is free software: you can redistribute it and/or modify it under the terms of the MIT License. See LICENSE.md for details. This program is distributed in the hope that it will be useful but WITHOUT ANY WARRANTY without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
Author: idk
|
||||
Parent class: I2PCommonBrowser
|
||||
package: net.i2p.i2pfirefox
|
||||
|
||||
## Dependencies
|
||||
@ -276,7 +277,7 @@ This method has no parameters.
|
||||
| url | String[] | |
|
||||
|
||||
|
||||
### launch [[src]](src/java/net/i2p/i2pfirefox/I2PChromium.java#L596)
|
||||
### launch [[src]](src/java/net/i2p/i2pfirefox/I2PChromium.java#L597)
|
||||
|
||||
+ Description: 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.
|
||||
+ Access: public
|
||||
@ -288,7 +289,7 @@ This method has no parameters.
|
||||
| url | String[] | |
|
||||
|
||||
|
||||
### launch [[src]](src/java/net/i2p/i2pfirefox/I2PChromium.java#L619)
|
||||
### launch [[src]](src/java/net/i2p/i2pfirefox/I2PChromium.java#L622)
|
||||
|
||||
+ Description: 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.
|
||||
+ Access: public
|
||||
@ -299,7 +300,7 @@ This method has no parameters.
|
||||
| privateWindow | boolean | |
|
||||
|
||||
|
||||
### launch [[src]](src/java/net/i2p/i2pfirefox/I2PChromium.java#L628)
|
||||
### launch [[src]](src/java/net/i2p/i2pfirefox/I2PChromium.java#L631)
|
||||
|
||||
+ Description: 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.
|
||||
+ Access: public
|
||||
@ -308,7 +309,7 @@ This method has no parameters.
|
||||
This method has no parameters.
|
||||
|
||||
|
||||
### ValidURL [[src]](src/java/net/i2p/i2pfirefox/I2PChromium.java#L630)
|
||||
### ValidURL [[src]](src/java/net/i2p/i2pfirefox/I2PChromium.java#L633)
|
||||
|
||||
+ Description:
|
||||
+ Access: private
|
||||
@ -320,7 +321,7 @@ This method has no parameters.
|
||||
| inUrl | String | |
|
||||
|
||||
|
||||
### main [[src]](src/java/net/i2p/i2pfirefox/I2PChromium.java#L640)
|
||||
### main [[src]](src/java/net/i2p/i2pfirefox/I2PChromium.java#L643)
|
||||
|
||||
+ Description:
|
||||
+ Access: public
|
||||
@ -332,7 +333,7 @@ This method has no parameters.
|
||||
| args | String[] | |
|
||||
|
||||
|
||||
### sleep [[src]](src/java/net/i2p/i2pfirefox/I2PChromium.java#L667)
|
||||
### sleep [[src]](src/java/net/i2p/i2pfirefox/I2PChromium.java#L670)
|
||||
|
||||
+ Description:
|
||||
+ Access: private
|
||||
|
@ -149,6 +149,8 @@
|
||||
<p>
|
||||
Author: idk
|
||||
<br>
|
||||
Parent class: I2PCommonBrowser
|
||||
<br>
|
||||
package: net.i2p.i2pfirefox
|
||||
</p>
|
||||
<h2>
|
||||
|
@ -7,6 +7,7 @@ Description:
|
||||
> I2PChromiumProfileChecker.java Copyright C 2022 idk <hankhill19580@gmail.com> This program is free software: you can redistribute it and/or modify it under the terms of the MIT License. See LICENSE.md for details. This program is distributed in the hope that it will be useful but WITHOUT ANY WARRANTY without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. I2PChromiumProfileChecker is a that checks if the Chromium profile directory exists and is valid.
|
||||
|
||||
Author: idk
|
||||
Parent class: I2PCommonBrowser
|
||||
package: net.i2p.i2pfirefox
|
||||
|
||||
## Dependencies
|
||||
|
@ -188,6 +188,15 @@
|
||||
<li>
|
||||
java.nio.file.StandardCopyOption
|
||||
</li>
|
||||
<li>
|
||||
java.util.logging.FileHandler
|
||||
</li>
|
||||
<li>
|
||||
java.util.logging.Logger
|
||||
</li>
|
||||
<li>
|
||||
java.util.logging.SimpleFormatter
|
||||
</li>
|
||||
<li>
|
||||
java.util.zip.ZipEntry
|
||||
</li>
|
||||
@ -197,10 +206,10 @@
|
||||
</ul>
|
||||
<br>
|
||||
<h2>
|
||||
<a href="#no-member-variables-in-this-class" rel="nofollow">
|
||||
<a href="#member-variables" rel="nofollow">
|
||||
<span></span>
|
||||
</a>
|
||||
No member variables in this class
|
||||
Member Variables
|
||||
</h2>
|
||||
<h2>
|
||||
<a href="#methods" rel="nofollow">
|
||||
@ -208,12 +217,74 @@
|
||||
</a>
|
||||
Methods
|
||||
</h2>
|
||||
<h3>
|
||||
<a href="#println-src" rel="nofollow">
|
||||
<span></span>
|
||||
</a>
|
||||
println
|
||||
<a href="src/java/net/i2p/i2pfirefox/I2PCommonBrowser.java#L52" rel="nofollow">
|
||||
[src]
|
||||
</a>
|
||||
</h3>
|
||||
<ul>
|
||||
<li>
|
||||
Description:
|
||||
<br>
|
||||
</li>
|
||||
<li>
|
||||
Access: public
|
||||
<br>
|
||||
</li>
|
||||
<li>
|
||||
Modifiers: static
|
||||
</li>
|
||||
<li>
|
||||
return: void
|
||||
<br>
|
||||
</li>
|
||||
</ul>
|
||||
<p>
|
||||
| Name | Type | Description |
|
||||
<br>
|
||||
| ----- | ----- | ----- |
|
||||
<br>
|
||||
| line | String | |
|
||||
</p>
|
||||
<h3>
|
||||
<a href="#logfile-src" rel="nofollow">
|
||||
<span></span>
|
||||
</a>
|
||||
logFile
|
||||
<a href="src/java/net/i2p/i2pfirefox/I2PCommonBrowser.java#L54" rel="nofollow">
|
||||
[src]
|
||||
</a>
|
||||
</h3>
|
||||
<ul>
|
||||
<li>
|
||||
Description:
|
||||
<br>
|
||||
</li>
|
||||
<li>
|
||||
Access: private
|
||||
<br>
|
||||
</li>
|
||||
<li>
|
||||
Modifiers: static
|
||||
</li>
|
||||
<li>
|
||||
return: File
|
||||
<br>
|
||||
</li>
|
||||
</ul>
|
||||
<p>
|
||||
This method has no parameters.
|
||||
</p>
|
||||
<h3>
|
||||
<a href="#runtimedirectory-src" rel="nofollow">
|
||||
<span></span>
|
||||
</a>
|
||||
runtimeDirectory
|
||||
<a href="src/java/net/i2p/i2pfirefox/I2PCommonBrowser.java#L38" rel="nofollow">
|
||||
<a href="src/java/net/i2p/i2pfirefox/I2PCommonBrowser.java#L68" rel="nofollow">
|
||||
[src]
|
||||
</a>
|
||||
</h3>
|
||||
@ -248,7 +319,7 @@
|
||||
<span></span>
|
||||
</a>
|
||||
runtimeDirectory
|
||||
<a href="src/java/net/i2p/i2pfirefox/I2PCommonBrowser.java#L55" rel="nofollow">
|
||||
<a href="src/java/net/i2p/i2pfirefox/I2PCommonBrowser.java#L85" rel="nofollow">
|
||||
[src]
|
||||
</a>
|
||||
</h3>
|
||||
@ -281,7 +352,7 @@
|
||||
<span></span>
|
||||
</a>
|
||||
profileDirectory
|
||||
<a href="src/java/net/i2p/i2pfirefox/I2PCommonBrowser.java#L102" rel="nofollow">
|
||||
<a href="src/java/net/i2p/i2pfirefox/I2PCommonBrowser.java#L132" rel="nofollow">
|
||||
[src]
|
||||
</a>
|
||||
</h3>
|
||||
@ -316,7 +387,7 @@
|
||||
<span></span>
|
||||
</a>
|
||||
profileDir
|
||||
<a href="src/java/net/i2p/i2pfirefox/I2PCommonBrowser.java#L114" rel="nofollow">
|
||||
<a href="src/java/net/i2p/i2pfirefox/I2PCommonBrowser.java#L144" rel="nofollow">
|
||||
[src]
|
||||
</a>
|
||||
</h3>
|
||||
@ -351,7 +422,7 @@
|
||||
<span></span>
|
||||
</a>
|
||||
unpackProfile
|
||||
<a href="src/java/net/i2p/i2pfirefox/I2PCommonBrowser.java#L120" rel="nofollow">
|
||||
<a href="src/java/net/i2p/i2pfirefox/I2PCommonBrowser.java#L150" rel="nofollow">
|
||||
[src]
|
||||
</a>
|
||||
</h3>
|
||||
@ -385,7 +456,7 @@
|
||||
<span></span>
|
||||
</a>
|
||||
copyDirectory
|
||||
<a href="src/java/net/i2p/i2pfirefox/I2PCommonBrowser.java#L167" rel="nofollow">
|
||||
<a href="src/java/net/i2p/i2pfirefox/I2PCommonBrowser.java#L196" rel="nofollow">
|
||||
[src]
|
||||
</a>
|
||||
</h3>
|
||||
@ -424,7 +495,7 @@
|
||||
<span></span>
|
||||
</a>
|
||||
copyDirectoryCompatibityMode
|
||||
<a href="src/java/net/i2p/i2pfirefox/I2PCommonBrowser.java#L183" rel="nofollow">
|
||||
<a href="src/java/net/i2p/i2pfirefox/I2PCommonBrowser.java#L212" rel="nofollow">
|
||||
[src]
|
||||
</a>
|
||||
</h3>
|
||||
@ -463,7 +534,7 @@
|
||||
<span></span>
|
||||
</a>
|
||||
copyFile
|
||||
<a href="src/java/net/i2p/i2pfirefox/I2PCommonBrowser.java#L192" rel="nofollow">
|
||||
<a href="src/java/net/i2p/i2pfirefox/I2PCommonBrowser.java#L221" rel="nofollow">
|
||||
[src]
|
||||
</a>
|
||||
</h3>
|
||||
@ -493,6 +564,39 @@
|
||||
<br>
|
||||
| destinationFile | File | |
|
||||
</p>
|
||||
<h3>
|
||||
<a href="#validateprofilefirstrun-src" rel="nofollow">
|
||||
<span></span>
|
||||
</a>
|
||||
validateProfileFirstRun
|
||||
<a href="src/java/net/i2p/i2pfirefox/I2PCommonBrowser.java#L232" rel="nofollow">
|
||||
[src]
|
||||
</a>
|
||||
</h3>
|
||||
<ul>
|
||||
<li>
|
||||
Description:
|
||||
<br>
|
||||
</li>
|
||||
<li>
|
||||
Access: public
|
||||
<br>
|
||||
</li>
|
||||
<li>
|
||||
Modifiers: static
|
||||
</li>
|
||||
<li>
|
||||
return: boolean
|
||||
<br>
|
||||
</li>
|
||||
</ul>
|
||||
<p>
|
||||
| Name | Type | Description |
|
||||
<br>
|
||||
| ----- | ----- | ----- |
|
||||
<br>
|
||||
| profileDirectory | String | |
|
||||
</p>
|
||||
<div id="sourcecode">
|
||||
<span id="sourcehead">
|
||||
<strong>
|
||||
|
@ -24,16 +24,41 @@ package: net.i2p.i2pfirefox
|
||||
<li>java.io.OutputStream</li>
|
||||
<li>java.nio.file.Files</li>
|
||||
<li>java.nio.file.StandardCopyOption</li>
|
||||
<li>java.util.logging.FileHandler</li>
|
||||
<li>java.util.logging.Logger</li>
|
||||
<li>java.util.logging.SimpleFormatter</li>
|
||||
<li>java.util.zip.ZipEntry</li>
|
||||
<li>java.util.zip.ZipInputStream</li>
|
||||
</ul>
|
||||
</details>
|
||||
|
||||
## No member variables in this class
|
||||
## Member Variables
|
||||
|
||||
## Methods
|
||||
|
||||
### runtimeDirectory [[src]](src/java/net/i2p/i2pfirefox/I2PCommonBrowser.java#L38)
|
||||
### println [[src]](src/java/net/i2p/i2pfirefox/I2PCommonBrowser.java#L52)
|
||||
|
||||
+ Description:
|
||||
+ Access: public
|
||||
+ Modifiers: static
|
||||
+ return: void
|
||||
|
||||
| Name | Type | Description |
|
||||
| ----- | ----- | ----- |
|
||||
| line | String | |
|
||||
|
||||
|
||||
### logFile [[src]](src/java/net/i2p/i2pfirefox/I2PCommonBrowser.java#L54)
|
||||
|
||||
+ Description:
|
||||
+ Access: private
|
||||
+ Modifiers: static
|
||||
+ return: File
|
||||
|
||||
This method has no parameters.
|
||||
|
||||
|
||||
### runtimeDirectory [[src]](src/java/net/i2p/i2pfirefox/I2PCommonBrowser.java#L68)
|
||||
|
||||
+ Description: get the runtime directory creating it if create=true
|
||||
+ Access: protected
|
||||
@ -46,7 +71,7 @@ package: net.i2p.i2pfirefox
|
||||
| override | String | |
|
||||
|
||||
|
||||
### runtimeDirectory [[src]](src/java/net/i2p/i2pfirefox/I2PCommonBrowser.java#L55)
|
||||
### runtimeDirectory [[src]](src/java/net/i2p/i2pfirefox/I2PCommonBrowser.java#L85)
|
||||
|
||||
+ Description: get the correct runtime directory
|
||||
+ Access: protected
|
||||
@ -58,7 +83,7 @@ package: net.i2p.i2pfirefox
|
||||
| override | String | |
|
||||
|
||||
|
||||
### profileDirectory [[src]](src/java/net/i2p/i2pfirefox/I2PCommonBrowser.java#L102)
|
||||
### profileDirectory [[src]](src/java/net/i2p/i2pfirefox/I2PCommonBrowser.java#L132)
|
||||
|
||||
+ Description: get the profile directory creating it if necessary
|
||||
+ Access: protected
|
||||
@ -71,7 +96,7 @@ package: net.i2p.i2pfirefox
|
||||
| browser | String | |
|
||||
|
||||
|
||||
### profileDir [[src]](src/java/net/i2p/i2pfirefox/I2PCommonBrowser.java#L114)
|
||||
### profileDir [[src]](src/java/net/i2p/i2pfirefox/I2PCommonBrowser.java#L144)
|
||||
|
||||
+ Description:
|
||||
+ Access: protected
|
||||
@ -84,7 +109,7 @@ package: net.i2p.i2pfirefox
|
||||
| browser | String | |
|
||||
|
||||
|
||||
### unpackProfile [[src]](src/java/net/i2p/i2pfirefox/I2PCommonBrowser.java#L120)
|
||||
### unpackProfile [[src]](src/java/net/i2p/i2pfirefox/I2PCommonBrowser.java#L150)
|
||||
|
||||
+ Description:
|
||||
+ Access: protected
|
||||
@ -97,7 +122,7 @@ package: net.i2p.i2pfirefox
|
||||
| base | String | |
|
||||
|
||||
|
||||
### copyDirectory [[src]](src/java/net/i2p/i2pfirefox/I2PCommonBrowser.java#L167)
|
||||
### copyDirectory [[src]](src/java/net/i2p/i2pfirefox/I2PCommonBrowser.java#L196)
|
||||
|
||||
+ Description:
|
||||
+ Access: protected
|
||||
@ -112,7 +137,7 @@ package: net.i2p.i2pfirefox
|
||||
| base | String | |
|
||||
|
||||
|
||||
### copyDirectoryCompatibityMode [[src]](src/java/net/i2p/i2pfirefox/I2PCommonBrowser.java#L183)
|
||||
### copyDirectoryCompatibityMode [[src]](src/java/net/i2p/i2pfirefox/I2PCommonBrowser.java#L212)
|
||||
|
||||
+ Description:
|
||||
+ Access: private
|
||||
@ -127,7 +152,7 @@ package: net.i2p.i2pfirefox
|
||||
| base | String | |
|
||||
|
||||
|
||||
### copyFile [[src]](src/java/net/i2p/i2pfirefox/I2PCommonBrowser.java#L192)
|
||||
### copyFile [[src]](src/java/net/i2p/i2pfirefox/I2PCommonBrowser.java#L221)
|
||||
|
||||
+ Description:
|
||||
+ Access: private
|
||||
@ -140,3 +165,15 @@ package: net.i2p.i2pfirefox
|
||||
| destinationFile | File | |
|
||||
|
||||
|
||||
### validateProfileFirstRun [[src]](src/java/net/i2p/i2pfirefox/I2PCommonBrowser.java#L232)
|
||||
|
||||
+ Description:
|
||||
+ Access: public
|
||||
+ Modifiers: static
|
||||
+ return: boolean
|
||||
|
||||
| Name | Type | Description |
|
||||
| ----- | ----- | ----- |
|
||||
| profileDirectory | String | |
|
||||
|
||||
|
||||
|
@ -149,6 +149,8 @@
|
||||
<p>
|
||||
Author: idk
|
||||
<br>
|
||||
Parent class: I2PCommonBrowser
|
||||
<br>
|
||||
package: net.i2p.i2pfirefox
|
||||
</p>
|
||||
<h2>
|
||||
@ -728,7 +730,7 @@
|
||||
<span></span>
|
||||
</a>
|
||||
waitForProxy
|
||||
<a href="src/java/net/i2p/i2pfirefox/I2PFirefox.java#L396" rel="nofollow">
|
||||
<a href="src/java/net/i2p/i2pfirefox/I2PFirefox.java#L398" rel="nofollow">
|
||||
[src]
|
||||
</a>
|
||||
</h3>
|
||||
@ -754,7 +756,7 @@
|
||||
<span></span>
|
||||
</a>
|
||||
waitForProxy
|
||||
<a href="src/java/net/i2p/i2pfirefox/I2PFirefox.java#L406" rel="nofollow">
|
||||
<a href="src/java/net/i2p/i2pfirefox/I2PFirefox.java#L408" rel="nofollow">
|
||||
[src]
|
||||
</a>
|
||||
</h3>
|
||||
@ -784,7 +786,7 @@
|
||||
<span></span>
|
||||
</a>
|
||||
waitForProxy
|
||||
<a href="src/java/net/i2p/i2pfirefox/I2PFirefox.java#L418" rel="nofollow">
|
||||
<a href="src/java/net/i2p/i2pfirefox/I2PFirefox.java#L420" rel="nofollow">
|
||||
[src]
|
||||
</a>
|
||||
</h3>
|
||||
@ -816,7 +818,7 @@
|
||||
<span></span>
|
||||
</a>
|
||||
waitForProxy
|
||||
<a href="src/java/net/i2p/i2pfirefox/I2PFirefox.java#L431" rel="nofollow">
|
||||
<a href="src/java/net/i2p/i2pfirefox/I2PFirefox.java#L433" rel="nofollow">
|
||||
[src]
|
||||
</a>
|
||||
</h3>
|
||||
@ -850,7 +852,7 @@
|
||||
<span></span>
|
||||
</a>
|
||||
checkifPortIsOccupied
|
||||
<a href="src/java/net/i2p/i2pfirefox/I2PFirefox.java#L444" rel="nofollow">
|
||||
<a href="src/java/net/i2p/i2pfirefox/I2PFirefox.java#L447" rel="nofollow">
|
||||
[src]
|
||||
</a>
|
||||
</h3>
|
||||
@ -882,7 +884,7 @@
|
||||
<span></span>
|
||||
</a>
|
||||
usabilityMode
|
||||
<a href="src/java/net/i2p/i2pfirefox/I2PFirefox.java#L454" rel="nofollow">
|
||||
<a href="src/java/net/i2p/i2pfirefox/I2PFirefox.java#L457" rel="nofollow">
|
||||
[src]
|
||||
</a>
|
||||
</h3>
|
||||
@ -908,7 +910,7 @@
|
||||
<span></span>
|
||||
</a>
|
||||
launchAndDetatch
|
||||
<a href="src/java/net/i2p/i2pfirefox/I2PFirefox.java#L461" rel="nofollow">
|
||||
<a href="src/java/net/i2p/i2pfirefox/I2PFirefox.java#L464" rel="nofollow">
|
||||
[src]
|
||||
</a>
|
||||
</h3>
|
||||
@ -940,7 +942,7 @@
|
||||
<span></span>
|
||||
</a>
|
||||
launch
|
||||
<a href="src/java/net/i2p/i2pfirefox/I2PFirefox.java#L507" rel="nofollow">
|
||||
<a href="src/java/net/i2p/i2pfirefox/I2PFirefox.java#L511" rel="nofollow">
|
||||
[src]
|
||||
</a>
|
||||
</h3>
|
||||
@ -972,7 +974,7 @@
|
||||
<span></span>
|
||||
</a>
|
||||
launch
|
||||
<a href="src/java/net/i2p/i2pfirefox/I2PFirefox.java#L529" rel="nofollow">
|
||||
<a href="src/java/net/i2p/i2pfirefox/I2PFirefox.java#L535" rel="nofollow">
|
||||
[src]
|
||||
</a>
|
||||
</h3>
|
||||
@ -1002,7 +1004,7 @@
|
||||
<span></span>
|
||||
</a>
|
||||
launch
|
||||
<a href="src/java/net/i2p/i2pfirefox/I2PFirefox.java#L539" rel="nofollow">
|
||||
<a href="src/java/net/i2p/i2pfirefox/I2PFirefox.java#L545" rel="nofollow">
|
||||
[src]
|
||||
</a>
|
||||
</h3>
|
||||
@ -1028,7 +1030,7 @@
|
||||
<span></span>
|
||||
</a>
|
||||
ValidURL
|
||||
<a href="src/java/net/i2p/i2pfirefox/I2PFirefox.java#L541" rel="nofollow">
|
||||
<a href="src/java/net/i2p/i2pfirefox/I2PFirefox.java#L547" rel="nofollow">
|
||||
[src]
|
||||
</a>
|
||||
</h3>
|
||||
@ -1061,7 +1063,7 @@
|
||||
<span></span>
|
||||
</a>
|
||||
main
|
||||
<a href="src/java/net/i2p/i2pfirefox/I2PFirefox.java#L552" rel="nofollow">
|
||||
<a href="src/java/net/i2p/i2pfirefox/I2PFirefox.java#L558" rel="nofollow">
|
||||
[src]
|
||||
</a>
|
||||
</h3>
|
||||
@ -1094,7 +1096,7 @@
|
||||
<span></span>
|
||||
</a>
|
||||
sleep
|
||||
<a href="src/java/net/i2p/i2pfirefox/I2PFirefox.java#L580" rel="nofollow">
|
||||
<a href="src/java/net/i2p/i2pfirefox/I2PFirefox.java#L586" rel="nofollow">
|
||||
[src]
|
||||
</a>
|
||||
</h3>
|
||||
|
@ -7,6 +7,7 @@ Description:
|
||||
> I2PFirefox.java Copyright C 2022 idk <hankhill19580@gmail.com> This program is free software: you can redistribute it and/or modify it under the terms of the MIT License. See LICENSE.md for details. This program is distributed in the hope that it will be useful but WITHOUT ANY WARRANTY without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
Author: idk
|
||||
Parent class: I2PCommonBrowser
|
||||
package: net.i2p.i2pfirefox
|
||||
|
||||
## Dependencies
|
||||
@ -214,7 +215,7 @@ This method has no parameters.
|
||||
| args | String[] | the extended arguments to pass to the Firefox binary. |
|
||||
|
||||
|
||||
### waitForProxy [[src]](src/java/net/i2p/i2pfirefox/I2PFirefox.java#L396)
|
||||
### waitForProxy [[src]](src/java/net/i2p/i2pfirefox/I2PFirefox.java#L398)
|
||||
|
||||
+ Description: Waits for an HTTP proxy on port 4444 to be ready. Returns false on timeout of 200 seconds.
|
||||
+ Access: public
|
||||
@ -223,7 +224,7 @@ This method has no parameters.
|
||||
This method has no parameters.
|
||||
|
||||
|
||||
### waitForProxy [[src]](src/java/net/i2p/i2pfirefox/I2PFirefox.java#L406)
|
||||
### waitForProxy [[src]](src/java/net/i2p/i2pfirefox/I2PFirefox.java#L408)
|
||||
|
||||
+ Description: Waits for an HTTP proxy on port 4444 to be ready. Returns false on timeout of the specified number of seconds.
|
||||
+ Access: public
|
||||
@ -234,7 +235,7 @@ This method has no parameters.
|
||||
| timeout | int | the number of seconds to wait for the proxy to be ready. |
|
||||
|
||||
|
||||
### waitForProxy [[src]](src/java/net/i2p/i2pfirefox/I2PFirefox.java#L418)
|
||||
### waitForProxy [[src]](src/java/net/i2p/i2pfirefox/I2PFirefox.java#L420)
|
||||
|
||||
+ Description: Waits for an HTTP proxy on the specified port to be ready. Returns false on timeout of the specified number of seconds.
|
||||
+ Access: public
|
||||
@ -246,7 +247,7 @@ This method has no parameters.
|
||||
| port | int | the port to wait for the proxy to be ready on. |
|
||||
|
||||
|
||||
### waitForProxy [[src]](src/java/net/i2p/i2pfirefox/I2PFirefox.java#L431)
|
||||
### waitForProxy [[src]](src/java/net/i2p/i2pfirefox/I2PFirefox.java#L433)
|
||||
|
||||
+ Description: Waits for an HTTP proxy on the specified port to be ready. Returns false on timeout of the specified number of seconds.
|
||||
+ Access: public
|
||||
@ -259,7 +260,7 @@ This method has no parameters.
|
||||
| host | String | the host to wait for the proxy to be ready on. |
|
||||
|
||||
|
||||
### checkifPortIsOccupied [[src]](src/java/net/i2p/i2pfirefox/I2PFirefox.java#L444)
|
||||
### checkifPortIsOccupied [[src]](src/java/net/i2p/i2pfirefox/I2PFirefox.java#L447)
|
||||
|
||||
+ Description:
|
||||
+ Access: private
|
||||
@ -271,7 +272,7 @@ This method has no parameters.
|
||||
| host | String | |
|
||||
|
||||
|
||||
### usabilityMode [[src]](src/java/net/i2p/i2pfirefox/I2PFirefox.java#L454)
|
||||
### usabilityMode [[src]](src/java/net/i2p/i2pfirefox/I2PFirefox.java#L457)
|
||||
|
||||
+ Description:
|
||||
+ Access: private
|
||||
@ -280,7 +281,7 @@ This method has no parameters.
|
||||
This method has no parameters.
|
||||
|
||||
|
||||
### launchAndDetatch [[src]](src/java/net/i2p/i2pfirefox/I2PFirefox.java#L461)
|
||||
### launchAndDetatch [[src]](src/java/net/i2p/i2pfirefox/I2PFirefox.java#L464)
|
||||
|
||||
+ Description:
|
||||
+ Access: public
|
||||
@ -292,7 +293,7 @@ This method has no parameters.
|
||||
| url | String[] | |
|
||||
|
||||
|
||||
### launch [[src]](src/java/net/i2p/i2pfirefox/I2PFirefox.java#L507)
|
||||
### launch [[src]](src/java/net/i2p/i2pfirefox/I2PFirefox.java#L511)
|
||||
|
||||
+ Description: 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.
|
||||
+ Access: public
|
||||
@ -304,7 +305,7 @@ This method has no parameters.
|
||||
| url | String[] | |
|
||||
|
||||
|
||||
### launch [[src]](src/java/net/i2p/i2pfirefox/I2PFirefox.java#L529)
|
||||
### launch [[src]](src/java/net/i2p/i2pfirefox/I2PFirefox.java#L535)
|
||||
|
||||
+ Description: 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.
|
||||
+ Access: public
|
||||
@ -315,7 +316,7 @@ This method has no parameters.
|
||||
| privateWindow | boolean | |
|
||||
|
||||
|
||||
### launch [[src]](src/java/net/i2p/i2pfirefox/I2PFirefox.java#L539)
|
||||
### launch [[src]](src/java/net/i2p/i2pfirefox/I2PFirefox.java#L545)
|
||||
|
||||
+ Description: 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.
|
||||
+ Access: public
|
||||
@ -324,7 +325,7 @@ This method has no parameters.
|
||||
This method has no parameters.
|
||||
|
||||
|
||||
### ValidURL [[src]](src/java/net/i2p/i2pfirefox/I2PFirefox.java#L541)
|
||||
### ValidURL [[src]](src/java/net/i2p/i2pfirefox/I2PFirefox.java#L547)
|
||||
|
||||
+ Description:
|
||||
+ Access: private
|
||||
@ -336,7 +337,7 @@ This method has no parameters.
|
||||
| inUrl | String | |
|
||||
|
||||
|
||||
### main [[src]](src/java/net/i2p/i2pfirefox/I2PFirefox.java#L552)
|
||||
### main [[src]](src/java/net/i2p/i2pfirefox/I2PFirefox.java#L558)
|
||||
|
||||
+ Description:
|
||||
+ Access: public
|
||||
@ -348,7 +349,7 @@ This method has no parameters.
|
||||
| args | String[] | |
|
||||
|
||||
|
||||
### sleep [[src]](src/java/net/i2p/i2pfirefox/I2PFirefox.java#L580)
|
||||
### sleep [[src]](src/java/net/i2p/i2pfirefox/I2PFirefox.java#L586)
|
||||
|
||||
+ Description:
|
||||
+ Access: private
|
||||
|
@ -409,7 +409,7 @@
|
||||
<span></span>
|
||||
</a>
|
||||
copyStrictOptions
|
||||
<a href="src/java/net/i2p/i2pfirefox/I2PFirefoxProfileBuilder.java#L149" rel="nofollow">
|
||||
<a href="src/java/net/i2p/i2pfirefox/I2PFirefoxProfileBuilder.java#L151" rel="nofollow">
|
||||
[src]
|
||||
</a>
|
||||
</h3>
|
||||
|
@ -103,7 +103,7 @@ This method has no parameters.
|
||||
| base | String | |
|
||||
|
||||
|
||||
### copyStrictOptions [[src]](src/java/net/i2p/i2pfirefox/I2PFirefoxProfileBuilder.java#L149)
|
||||
### copyStrictOptions [[src]](src/java/net/i2p/i2pfirefox/I2PFirefoxProfileBuilder.java#L151)
|
||||
|
||||
+ Description: Copy the strict options from the base profile to the profile
|
||||
+ Access: public
|
||||
|
@ -149,6 +149,8 @@
|
||||
<p>
|
||||
Author: idk
|
||||
<br>
|
||||
Parent class: I2PCommonBrowser
|
||||
<br>
|
||||
package: net.i2p.i2pfirefox
|
||||
</p>
|
||||
<h2>
|
||||
|
@ -7,6 +7,7 @@ Description:
|
||||
> I2PFirefoxProfileChecker.java Copyright C 2022 idk <hankhill19580@gmail.com> This program is free software: you can redistribute it and/or modify it under the terms of the MIT License. See LICENSE.md for details. This program is distributed in the hope that it will be useful but WITHOUT ANY WARRANTY without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. I2PFirefoxProfileChecker is a that checks if the Firefox profile directory exists and is valid.
|
||||
|
||||
Author: idk
|
||||
Parent class: I2PCommonBrowser
|
||||
package: net.i2p.i2pfirefox
|
||||
|
||||
## Dependencies
|
||||
|
@ -684,7 +684,7 @@
|
||||
<span></span>
|
||||
</a>
|
||||
sleep
|
||||
<a href="src/java/net/i2p/i2pfirefox/I2PGenericUnsafeBrowser.java#L367" rel="nofollow">
|
||||
<a href="src/java/net/i2p/i2pfirefox/I2PGenericUnsafeBrowser.java#L366" rel="nofollow">
|
||||
[src]
|
||||
</a>
|
||||
</h3>
|
||||
@ -717,7 +717,7 @@
|
||||
<span></span>
|
||||
</a>
|
||||
ValidURL
|
||||
<a href="src/java/net/i2p/i2pfirefox/I2PGenericUnsafeBrowser.java#L375" rel="nofollow">
|
||||
<a href="src/java/net/i2p/i2pfirefox/I2PGenericUnsafeBrowser.java#L374" rel="nofollow">
|
||||
[src]
|
||||
</a>
|
||||
</h3>
|
||||
@ -750,7 +750,7 @@
|
||||
<span></span>
|
||||
</a>
|
||||
checkifPortIsOccupied
|
||||
<a href="src/java/net/i2p/i2pfirefox/I2PGenericUnsafeBrowser.java#L385" rel="nofollow">
|
||||
<a href="src/java/net/i2p/i2pfirefox/I2PGenericUnsafeBrowser.java#L384" rel="nofollow">
|
||||
[src]
|
||||
</a>
|
||||
</h3>
|
||||
|
@ -204,7 +204,7 @@ This method has no parameters.
|
||||
| url | String[] | |
|
||||
|
||||
|
||||
### sleep [[src]](src/java/net/i2p/i2pfirefox/I2PGenericUnsafeBrowser.java#L367)
|
||||
### sleep [[src]](src/java/net/i2p/i2pfirefox/I2PGenericUnsafeBrowser.java#L366)
|
||||
|
||||
+ Description:
|
||||
+ Access: private
|
||||
@ -216,7 +216,7 @@ This method has no parameters.
|
||||
| millis | int | |
|
||||
|
||||
|
||||
### ValidURL [[src]](src/java/net/i2p/i2pfirefox/I2PGenericUnsafeBrowser.java#L375)
|
||||
### ValidURL [[src]](src/java/net/i2p/i2pfirefox/I2PGenericUnsafeBrowser.java#L374)
|
||||
|
||||
+ Description:
|
||||
+ Access: private
|
||||
@ -228,7 +228,7 @@ This method has no parameters.
|
||||
| inUrl | String | |
|
||||
|
||||
|
||||
### checkifPortIsOccupied [[src]](src/java/net/i2p/i2pfirefox/I2PGenericUnsafeBrowser.java#L385)
|
||||
### checkifPortIsOccupied [[src]](src/java/net/i2p/i2pfirefox/I2PGenericUnsafeBrowser.java#L384)
|
||||
|
||||
+ Description:
|
||||
+ Access: private
|
||||
|
@ -298,6 +298,12 @@ Linux(because the top command will be run and the script will exit).\n\nBoth det
|
||||
<arg value="src/build/i2pfirefox.jar"/>
|
||||
<arg value="i2pfirefox.cmd"/>
|
||||
<arg value="i2pchromium.cmd"/>
|
||||
<arg value="i2pfirefox-private.cmd"/>
|
||||
<arg value="i2pchromium-private.cmd"/>
|
||||
<arg value="i2pfirefox-usability.cmd"/>
|
||||
<arg value="i2pchromium-usability.cmd"/>
|
||||
<arg value="i2pfirefox-usability-private.cmd"/>
|
||||
<arg value="i2pchromium-usability-private.cmd"/>
|
||||
<arg value="LICENSE.md"/>
|
||||
<arg value="README.md"/>
|
||||
</exec>
|
||||
@ -311,7 +317,7 @@ Linux(because the top command will be run and the script will exit).\n\nBoth det
|
||||
<delete dir="plugin/eepsite/docroot/torrents/" />
|
||||
<!-- get version number -->
|
||||
<buildnumber file="scripts/build.number" />
|
||||
<property name="release.number" value="0.0.21" />
|
||||
<property name="release.number" value="0.0.26" />
|
||||
|
||||
<!-- make the update xpi2p -->
|
||||
<!-- this contains everything except i2ptunnel.config -->
|
||||
|
@ -2,9 +2,9 @@
|
||||
|
||||
GITHUB_USER=eyedeekay
|
||||
GITHUB_REPO=i2p.plugins.firefox
|
||||
GITHUB_NAME="That gets it ready for inclusion in another bundle."
|
||||
GITHUB_NAME="Always pass --new-instance to Firefox"
|
||||
GITHUB_DESCRIPTION=$(cat CHANGES.md)
|
||||
GITHUB_TAG=0.0.21
|
||||
GITHUB_TAG=0.0.26
|
||||
ant distclean
|
||||
./javadoc.sh
|
||||
NUMLINE=`grep release.number build.xml | head -n 1`
|
||||
|
Binary file not shown.
5
src/i2p.chromium.base.profile/LICENSE.md
Normal file
5
src/i2p.chromium.base.profile/LICENSE.md
Normal file
@ -0,0 +1,5 @@
|
||||
This browser profile is entirely composed of the work of Free Software developers.
|
||||
The licenses for the sub-projects may be found in the extensions directories themselves.
|
||||
|
||||
i2p.chromium.usabilty.profile/extensions/i2pchrome.js/
|
||||
i2p.chromium.usabilty.profile/extensions/noscript.js/
|
@ -1,6 +0,0 @@
|
||||
TODO:
|
||||
|
||||
Licensing work! This is probably mostly done, but I need to double-check it to make sure
|
||||
the T&C are the same from all of these extensions are the same as for their Firefox versions
|
||||
since I did the licensing review already. Since the license is included with the unpacked
|
||||
extensions, we're almost certainly good.
|
0
src/i2p.chromium.base.profile/first-run
Normal file
0
src/i2p.chromium.base.profile/first-run
Normal file
7
src/i2p.chromium.usability.profile/LICENSE.md
Normal file
7
src/i2p.chromium.usability.profile/LICENSE.md
Normal file
@ -0,0 +1,7 @@
|
||||
This browser profile is entirely composed of the work of Free Software developers.
|
||||
The licenses for the sub-projects may be found in the extensions directories themselves.
|
||||
|
||||
i2p.chromium.usabilty.profile/extensions/i2pchrome.js/
|
||||
i2p.chromium.usabilty.profile/extensions/jshelter.js
|
||||
i2p.chromium.usabilty.profile/extensions/localcdn.js
|
||||
i2p.chromium.usabilty.profile/extensions/ublock.js
|
@ -1,6 +0,0 @@
|
||||
TODO:
|
||||
|
||||
Licensing work! This is probably mostly done, but I need to double-check it to make sure
|
||||
the T&C are the same from all of these extensions are the same as for their Firefox versions
|
||||
since I did the licensing review already. Since the license is included with the unpacked
|
||||
extensions, we're almost certainly good.
|
0
src/i2p.chromium.usability.profile/first-run
Normal file
0
src/i2p.chromium.usability.profile/first-run
Normal file
Binary file not shown.
0
src/i2p.firefox.base.profile/first-run
Normal file
0
src/i2p.firefox.base.profile/first-run
Normal file
@ -60,6 +60,6 @@ user_pref("media.navigator.enabled", false);
|
||||
user_pref("dom.w3c_touch_events.enabled", false);
|
||||
user_pref("browser.privatebrowsing.autostart", false);
|
||||
user_pref("browser.display.use_system_colors", false);
|
||||
user_pref("dom.image-lazy-loading.enabled", false)
|
||||
user_pref("dom.image-lazy-loading.enabled", false);
|
||||
user_pref("extensions.autoDisableScopes", 0);
|
||||
user_pref("extensions.enabledScopes", 1);
|
Binary file not shown.
0
src/i2p.firefox.usability.profile/first-run
Normal file
0
src/i2p.firefox.usability.profile/first-run
Normal file
@ -60,6 +60,6 @@ user_pref("media.navigator.enabled", false);
|
||||
user_pref("dom.w3c_touch_events.enabled", false);
|
||||
user_pref("browser.privatebrowsing.autostart", false);
|
||||
user_pref("browser.display.use_system_colors", false);
|
||||
user_pref("dom.image-lazy-loading.enabled", false)
|
||||
user_pref("dom.image-lazy-loading.enabled", false);
|
||||
user_pref("extensions.autoDisableScopes", 0);
|
||||
user_pref("extensions.enabledScopes", 1);
|
@ -20,7 +20,7 @@ import java.util.ArrayList;
|
||||
* @author idk
|
||||
* @since 0.0.16
|
||||
*/
|
||||
public class I2PBrowser {
|
||||
public class I2PBrowser extends I2PCommonBrowser {
|
||||
private final I2PFirefox i2pFirefox = new I2PFirefox();
|
||||
private final I2PChromium i2pChromium = new I2PChromium();
|
||||
private final I2PGenericUnsafeBrowser i2pGeneral =
|
||||
@ -32,17 +32,17 @@ public class I2PBrowser {
|
||||
public boolean usability = false;
|
||||
|
||||
private void launchFirefox(boolean privateWindow, String[] url) {
|
||||
System.out.println("I2PFirefox");
|
||||
println("I2PFirefox");
|
||||
I2PFirefox.usability = usability;
|
||||
i2pFirefox.launch(privateWindow, url);
|
||||
}
|
||||
private void launchChromium(boolean privateWindow, String[] url) {
|
||||
System.out.println("I2PChromium");
|
||||
println("I2PChromium");
|
||||
I2PChromiumProfileBuilder.usability = usability;
|
||||
i2pChromium.launch(privateWindow, url);
|
||||
}
|
||||
private void launchGeneric(boolean privateWindow, String[] url) {
|
||||
System.out.println("I2PChromium");
|
||||
println("I2PChromium");
|
||||
i2pGeneral.launch(privateWindow, url);
|
||||
}
|
||||
|
||||
@ -176,7 +176,7 @@ public class I2PBrowser {
|
||||
|
||||
public static void main(String[] args) {
|
||||
boolean privateBrowsing = false;
|
||||
System.out.println("I2PBrowser");
|
||||
println("I2PBrowser");
|
||||
I2PBrowser i2pBrowser = new I2PBrowser();
|
||||
ArrayList<String> visitURL = new ArrayList<String>();
|
||||
if (args != null) {
|
||||
|
@ -19,7 +19,7 @@ import java.util.ArrayList;
|
||||
* @author idk
|
||||
* @since 0.0.1
|
||||
*/
|
||||
public class I2PChromium {
|
||||
public class I2PChromium extends I2PCommonBrowser {
|
||||
private final String[] CHROMIUM_SEARCH_PATHS = CHROMIUM_FINDER();
|
||||
private final int DEFAULT_TIMEOUT = 200;
|
||||
private Process p = null;
|
||||
@ -35,7 +35,7 @@ public class I2PChromium {
|
||||
for (String path : CHROMIUM_SEARCH_PATHS) {
|
||||
File f = new File(path);
|
||||
if (f.exists()) {
|
||||
System.out.println("Found Chromium at " + path);
|
||||
println("Found Chromium at " + path);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -44,7 +44,7 @@ public class I2PChromium {
|
||||
for (String path : CHROMIUM_SEARCH_PATHS) {
|
||||
File f = new File(path);
|
||||
if (f.exists()) {
|
||||
System.out.println("Found Chromium at " + path);
|
||||
println("Found Chromium at " + path);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -250,10 +250,10 @@ public class I2PChromium {
|
||||
for (String chrome : chromees) {
|
||||
File chromeFile = new File(chrome);
|
||||
if (chromeFile.exists()) {
|
||||
System.out.println("Found valid chromium at " + chrome);
|
||||
println("Found valid chromium at " + chrome);
|
||||
validChromiums.add(chrome);
|
||||
}
|
||||
System.out.println("chrome at " + chrome + "does not exist");
|
||||
println("chrome at " + chrome + "does not exist");
|
||||
}
|
||||
return validChromiums.toArray(new String[validChromiums.size()]);
|
||||
}
|
||||
@ -478,7 +478,7 @@ public class I2PChromium {
|
||||
return new ProcessBuilder(newArgs).directory(
|
||||
I2PChromiumProfileBuilder.runtimeDirectory(true));
|
||||
} else {
|
||||
System.out.println("No Chromium found.");
|
||||
println("No Chromium found.");
|
||||
return new ProcessBuilder(args);
|
||||
}
|
||||
}
|
||||
@ -553,18 +553,19 @@ public class I2PChromium {
|
||||
String profileDirectory = I2PChromiumProfileBuilder.profileDirectory();
|
||||
if (I2PChromiumProfileChecker.validateProfileDirectory(
|
||||
profileDirectory)) {
|
||||
System.out.println("Valid profile directory: " + profileDirectory);
|
||||
println("Valid profile directory: " + profileDirectory);
|
||||
} else {
|
||||
System.out.println("Invalid profile directory: " + profileDirectory +
|
||||
" rebuilding...");
|
||||
println("Invalid profile directory: " + profileDirectory +
|
||||
" rebuilding...");
|
||||
if (!I2PChromiumProfileBuilder.copyBaseProfiletoProfile()) {
|
||||
System.out.println("Failed to rebuild profile directory: " +
|
||||
profileDirectory);
|
||||
println("Failed to rebuild profile directory: " + profileDirectory);
|
||||
return null;
|
||||
} else {
|
||||
System.out.println("Rebuilt profile directory: " + profileDirectory);
|
||||
println("Rebuilt profile directory: " + profileDirectory);
|
||||
}
|
||||
}
|
||||
if (validateProfileFirstRun(profileDirectory))
|
||||
return null;
|
||||
ProcessBuilder pb = null;
|
||||
if (privateWindow) {
|
||||
pb = this.privateProcessBuilder(url);
|
||||
@ -596,13 +597,15 @@ public class I2PChromium {
|
||||
public void launch(boolean privateWindow, String[] url) {
|
||||
if (waitForProxy()) {
|
||||
p = launchAndDetatch(privateWindow, url);
|
||||
System.out.println("I2PChromium");
|
||||
if (p == null)
|
||||
return;
|
||||
println("I2PChromium");
|
||||
try {
|
||||
System.out.println("Waiting for I2PChromium to close...");
|
||||
println("Waiting for I2PChromium to close...");
|
||||
int exit = p.waitFor();
|
||||
System.out.println("I2PChromium exited with value: " + exit);
|
||||
println("I2PChromium exited with value: " + exit);
|
||||
} catch (Exception e) {
|
||||
System.out.println("Error: " + e.getMessage());
|
||||
println("Error: " + e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -639,16 +642,16 @@ public class I2PChromium {
|
||||
|
||||
public static void main(String[] args) {
|
||||
boolean privateBrowsing = false;
|
||||
System.out.println("I2PChromium");
|
||||
println("I2PChromium");
|
||||
I2PChromium i2pChromium = new I2PChromium();
|
||||
System.out.println("checking for private browsing");
|
||||
println("checking for private browsing");
|
||||
ArrayList<String> visitURL = new ArrayList<String>();
|
||||
if (args != null) {
|
||||
if (args.length > 0) {
|
||||
for (String arg : args) {
|
||||
if (arg.equals("-private")) {
|
||||
privateBrowsing = true;
|
||||
System.out.println(
|
||||
println(
|
||||
"private browsing is true, profile will be discarded at end of session");
|
||||
}
|
||||
if (arg.equals("-usability")) {
|
||||
|
@ -120,22 +120,23 @@ public class I2PChromiumProfileBuilder extends I2PCommonBrowser {
|
||||
public static boolean copyBaseProfiletoProfile() {
|
||||
String baseProfile = baseProfileDirectory(usabilityMode());
|
||||
String profile = profileDirectory();
|
||||
System.out.println("Copying base profile to profile directory: " +
|
||||
baseProfile + " -> " + profile);
|
||||
println("Copying base profile to profile directory: " + baseProfile +
|
||||
" -> " + profile);
|
||||
if (baseProfile.isEmpty() || profile.isEmpty()) {
|
||||
return false;
|
||||
}
|
||||
File baseProfileDir = new File(baseProfile);
|
||||
File profileDir = new File(profile);
|
||||
|
||||
try {
|
||||
System.out.println("Copying base profile to profile directory");
|
||||
copyDirectory(baseProfileDir, profileDir, "chromium", usabilityMode());
|
||||
} catch (Exception e) {
|
||||
System.out.println("Error copying base profile to profile" + e);
|
||||
return false;
|
||||
if (!profileDir.exists()) {
|
||||
try {
|
||||
println("Copying base profile to profile directory");
|
||||
copyDirectory(baseProfileDir, profileDir, "chromium", usabilityMode());
|
||||
} catch (Exception e) {
|
||||
println("Error copying base profile to profile" + e);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
System.out.println("Copied base profile to profile directory");
|
||||
println("Copied base profile to profile directory");
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -18,7 +18,7 @@ import java.io.File;
|
||||
* @author idk
|
||||
* @since 0.0.1
|
||||
*/
|
||||
public class I2PChromiumProfileChecker {
|
||||
public class I2PChromiumProfileChecker extends I2PCommonBrowser {
|
||||
/**
|
||||
* Output feedback if the profile directory is valid or invalid
|
||||
*
|
||||
@ -29,15 +29,15 @@ public class I2PChromiumProfileChecker {
|
||||
public static void main(String[] args) {
|
||||
String profileDirectory = I2PChromiumProfileBuilder.profileDirectory();
|
||||
if (profileDirectory == null) {
|
||||
System.out.println("No profile directory found");
|
||||
println("No profile directory found");
|
||||
return;
|
||||
}
|
||||
System.out.println("Profile directory: " + profileDirectory);
|
||||
println("Profile directory: " + profileDirectory);
|
||||
boolean ok = validateProfileDirectory(profileDirectory);
|
||||
if (ok) {
|
||||
System.out.println("Profile directory is valid");
|
||||
println("Profile directory is valid");
|
||||
} else {
|
||||
System.out.println("Profile directory is invalid");
|
||||
println("Profile directory is invalid");
|
||||
}
|
||||
}
|
||||
/**
|
||||
@ -50,23 +50,23 @@ public class I2PChromiumProfileChecker {
|
||||
public static boolean validateProfileDirectory(String profileDirectory) {
|
||||
File profileDir = new File(profileDirectory);
|
||||
if (!profileDir.exists()) {
|
||||
System.out.println("Profile directory does not exist");
|
||||
println("Profile directory does not exist");
|
||||
return false;
|
||||
}
|
||||
if (!profileDir.isDirectory()) {
|
||||
System.out.println("Profile directory is not a directory");
|
||||
println("Profile directory is not a directory");
|
||||
return false;
|
||||
}
|
||||
if (!profileDir.canRead()) {
|
||||
System.out.println("Profile directory is not readable");
|
||||
println("Profile directory is not readable");
|
||||
return false;
|
||||
}
|
||||
if (!profileDir.canWrite()) {
|
||||
System.out.println("Profile directory is not writable");
|
||||
println("Profile directory is not writable");
|
||||
return false;
|
||||
}
|
||||
if (!validateExtensionDirectory(profileDir + "/extensions")) {
|
||||
System.out.println("extensions directory is invalid");
|
||||
println("extensions directory is invalid");
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
@ -81,19 +81,19 @@ public class I2PChromiumProfileChecker {
|
||||
public static boolean validateFile(String file) {
|
||||
File f = new File(file);
|
||||
if (!f.exists()) {
|
||||
System.out.println("User JavaScript file does not exist");
|
||||
println("User JavaScript file does not exist");
|
||||
return false;
|
||||
}
|
||||
if (!f.isFile()) {
|
||||
System.out.println("User JavaScript file is not a file");
|
||||
println("User JavaScript file is not a file");
|
||||
return false;
|
||||
}
|
||||
if (!f.canRead()) {
|
||||
System.out.println("User JavaScript file is not readable");
|
||||
println("User JavaScript file is not readable");
|
||||
return false;
|
||||
}
|
||||
if (!f.canWrite()) {
|
||||
System.out.println("User JavaScript file is not writable");
|
||||
println("User JavaScript file is not writable");
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
@ -108,19 +108,19 @@ public class I2PChromiumProfileChecker {
|
||||
public static boolean validateExtensionDirectory(String extensionDirectory) {
|
||||
File extensionDir = new File(extensionDirectory);
|
||||
if (!extensionDir.exists()) {
|
||||
System.out.println("Extension directory does not exist");
|
||||
println("Extension directory does not exist");
|
||||
return false;
|
||||
}
|
||||
if (!extensionDir.isDirectory()) {
|
||||
System.out.println("Extension directory is not a directory");
|
||||
println("Extension directory is not a directory");
|
||||
return false;
|
||||
}
|
||||
if (!extensionDir.canRead()) {
|
||||
System.out.println("Extension directory is not readable");
|
||||
println("Extension directory is not readable");
|
||||
return false;
|
||||
}
|
||||
if (!extensionDir.canWrite()) {
|
||||
System.out.println("Extension directory is not writable");
|
||||
println("Extension directory is not writable");
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
@ -23,7 +23,7 @@ public class I2PChromiumProfileUnpacker extends I2PCommonBrowser {
|
||||
public static void main(String[] args) {
|
||||
String profileDirectory = I2PChromiumProfileBuilder.profileDirectory();
|
||||
if (profileDirectory == null) {
|
||||
System.out.println("No profile directory found");
|
||||
println("No profile directory found");
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -35,7 +35,7 @@ public class I2PChromiumProfileUnpacker extends I2PCommonBrowser {
|
||||
* @since 0.0.1
|
||||
*/
|
||||
public boolean unpackProfile(String profileDirectory, String mode) {
|
||||
System.out.println("Unpacking base profile to " + profileDirectory);
|
||||
println("Unpacking base profile to " + profileDirectory);
|
||||
return unpackProfile(profileDirectory, "chromium", mode);
|
||||
}
|
||||
}
|
||||
|
@ -8,6 +8,9 @@ import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.StandardCopyOption;
|
||||
import java.util.logging.FileHandler;
|
||||
import java.util.logging.Logger;
|
||||
import java.util.logging.SimpleFormatter;
|
||||
import java.util.zip.ZipEntry;
|
||||
import java.util.zip.ZipInputStream;
|
||||
|
||||
@ -27,6 +30,33 @@ import java.util.zip.ZipInputStream;
|
||||
*/
|
||||
|
||||
public class I2PCommonBrowser {
|
||||
static Logger logger = Logger.getLogger("browserlauncher");
|
||||
static FileHandler fh;
|
||||
|
||||
public I2PCommonBrowser() {
|
||||
try {
|
||||
// This block configure the logger with handler and formatter
|
||||
fh = new FileHandler(logFile().toString());
|
||||
logger.addHandler(fh);
|
||||
SimpleFormatter formatter = new SimpleFormatter();
|
||||
fh.setFormatter(formatter);
|
||||
// the following statement is used to log any messages
|
||||
logger.info("Browser log");
|
||||
} catch (SecurityException e) {
|
||||
e.printStackTrace();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
public static void println(String line) { logger.info(line); }
|
||||
|
||||
private static File logFile() {
|
||||
File log = new File("logs");
|
||||
if (!log.exists())
|
||||
log.mkdirs();
|
||||
return new File(log, "browserlauncher.log");
|
||||
}
|
||||
|
||||
/**
|
||||
* get the runtime directory, creating it if create=true
|
||||
@ -118,16 +148,16 @@ public class I2PCommonBrowser {
|
||||
|
||||
protected boolean unpackProfile(String profileDirectory, String browser,
|
||||
String base) {
|
||||
System.out.println("Unpacking base profile to " + profileDirectory);
|
||||
println("Unpacking base profile to " + profileDirectory);
|
||||
try {
|
||||
final InputStream resources =
|
||||
this.getClass().getClassLoader().getResourceAsStream(
|
||||
"i2p." + browser + "." + base + ".profile.zip");
|
||||
if (resources == null) {
|
||||
System.out.println("Could not find resources");
|
||||
println("Could not find resources");
|
||||
return false;
|
||||
}
|
||||
System.out.println(resources.toString());
|
||||
println(resources.toString());
|
||||
// InputStream corresponds to a zip file. Unzip it.
|
||||
// Files.copy(r, new File(profileDirectory).toPath(),
|
||||
// StandardCopyOption.REPLACE_EXISTING);
|
||||
@ -135,15 +165,14 @@ public class I2PCommonBrowser {
|
||||
ZipEntry entry;
|
||||
// while there are entries I process them
|
||||
while ((entry = zis.getNextEntry()) != null) {
|
||||
System.out.println("entry: " + entry.getName() + ", " +
|
||||
entry.getSize());
|
||||
println("entry: " + entry.getName() + ", " + entry.getSize());
|
||||
// consume all the data from this entry
|
||||
if (entry.isDirectory()) {
|
||||
System.out.println("Creating directory: " + entry.getName());
|
||||
println("Creating directory: " + entry.getName());
|
||||
File dir = new File(profileDirectory + "/" + entry.getName());
|
||||
dir.mkdirs();
|
||||
} else {
|
||||
System.out.println("Creating file: " + entry.getName());
|
||||
println("Creating file: " + entry.getName());
|
||||
File file = new File(profileDirectory + "/" + entry.getName());
|
||||
file.createNewFile();
|
||||
Files.copy(zis, file.toPath(), StandardCopyOption.REPLACE_EXISTING);
|
||||
@ -156,7 +185,7 @@ public class I2PCommonBrowser {
|
||||
// loop through the Enumeration
|
||||
|
||||
} catch (Exception e) {
|
||||
System.out.println("Error copying profile files: " + e.getMessage());
|
||||
println("Error copying profile files: " + e.getMessage());
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
@ -199,4 +228,23 @@ public class I2PCommonBrowser {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean validateProfileFirstRun(String profileDirectory) {
|
||||
File profileDir = new File(profileDirectory);
|
||||
if (!profileDir.exists()) {
|
||||
println("Profile directory does not exist");
|
||||
return false;
|
||||
}
|
||||
if (!profileDir.isDirectory()) {
|
||||
println("Profile directory is not a directory");
|
||||
return false;
|
||||
}
|
||||
File frf = new File(profileDir, "first-run");
|
||||
if (frf.exists()) {
|
||||
frf.delete();
|
||||
// is a first run
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -19,7 +19,7 @@ import java.util.ArrayList;
|
||||
* @author idk
|
||||
* @since 0.0.1
|
||||
*/
|
||||
public class I2PFirefox {
|
||||
public class I2PFirefox extends I2PCommonBrowser {
|
||||
private final String[] FIREFOX_SEARCH_PATHS = FIREFOX_FINDER();
|
||||
private final int DEFAULT_TIMEOUT = 200;
|
||||
private Process p = null;
|
||||
@ -36,7 +36,7 @@ public class I2PFirefox {
|
||||
for (String path : FIREFOX_SEARCH_PATHS) {
|
||||
File f = new File(path);
|
||||
if (f.exists()) {
|
||||
System.out.println("Found Firefox at " + path);
|
||||
println("Found Firefox at " + path);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -238,10 +238,10 @@ public class I2PFirefox {
|
||||
for (String firefox : firefoxes) {
|
||||
File firefoxFile = new File(firefox);
|
||||
if (firefoxFile.exists()) {
|
||||
System.out.println("Found valid firefox at " + firefox);
|
||||
println("Found valid firefox at " + firefox);
|
||||
validFirefoxes.add(firefox);
|
||||
}
|
||||
System.out.println("firefox at " + firefox + "does not exist");
|
||||
println("firefox at " + firefox + "does not exist");
|
||||
}
|
||||
return validFirefoxes.toArray(new String[validFirefoxes.size()]);
|
||||
}
|
||||
@ -367,21 +367,23 @@ public class I2PFirefox {
|
||||
int arglength = 0;
|
||||
if (args != null)
|
||||
arglength = args.length;
|
||||
String[] newArgs = new String[arglength + 3];
|
||||
String[] newArgs = new String[arglength + 5];
|
||||
newArgs[0] = firefox;
|
||||
newArgs[1] = "--profile";
|
||||
newArgs[2] = I2PFirefoxProfileBuilder.profileDirectory();
|
||||
newArgs[1] = "-attach-console";
|
||||
newArgs[2] = "--new-instance";
|
||||
newArgs[3] = "--profile";
|
||||
newArgs[4] = I2PFirefoxProfileBuilder.profileDirectory();
|
||||
if (args != null) {
|
||||
if (arglength > 0) {
|
||||
for (int i = 0; i < arglength; i++) {
|
||||
newArgs[i + 3] = args[i];
|
||||
newArgs[i + 5] = args[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
return new ProcessBuilder(newArgs).directory(
|
||||
I2PFirefoxProfileBuilder.runtimeDirectory(true));
|
||||
} else {
|
||||
System.out.println("No Firefox found.");
|
||||
println("No Firefox found.");
|
||||
return new ProcessBuilder(args);
|
||||
}
|
||||
}
|
||||
@ -430,6 +432,7 @@ public class I2PFirefox {
|
||||
*/
|
||||
public boolean waitForProxy(int timeout, int port, String host) {
|
||||
for (int i = 0; i < timeout; i++) {
|
||||
println("Waiting for proxy");
|
||||
if (checkifPortIsOccupied(port, host)) {
|
||||
return true;
|
||||
}
|
||||
@ -462,19 +465,20 @@ public class I2PFirefox {
|
||||
if (waitForProxy()) {
|
||||
String profileDirectory = I2PFirefoxProfileBuilder.profileDirectory();
|
||||
if (I2PFirefoxProfileChecker.validateProfileDirectory(profileDirectory)) {
|
||||
System.out.println("Valid profile directory: " + profileDirectory);
|
||||
println("Valid profile directory: " + profileDirectory);
|
||||
} else {
|
||||
System.out.println("Invalid profile directory: " + profileDirectory +
|
||||
" rebuilding...");
|
||||
println("Invalid profile directory: " + profileDirectory +
|
||||
" rebuilding...");
|
||||
if (!I2PFirefoxProfileBuilder.copyBaseProfiletoProfile(
|
||||
usabilityMode())) {
|
||||
System.out.println("Failed to rebuild profile directory: " +
|
||||
profileDirectory);
|
||||
println("Failed to rebuild profile directory: " + profileDirectory);
|
||||
return null;
|
||||
} else {
|
||||
System.out.println("Rebuilt profile directory: " + profileDirectory);
|
||||
println("Rebuilt profile directory: " + profileDirectory);
|
||||
}
|
||||
}
|
||||
if (validateProfileFirstRun(profileDirectory))
|
||||
return null;
|
||||
ProcessBuilder pb;
|
||||
if (privateWindow) {
|
||||
pb = privateProcessBuilder(url);
|
||||
@ -484,7 +488,7 @@ public class I2PFirefox {
|
||||
try {
|
||||
System.out.println(pb.command());
|
||||
p = pb.start();
|
||||
System.out.println("I2PFirefox");
|
||||
println("I2PFirefox");
|
||||
sleep(2000);
|
||||
return p;
|
||||
} catch (Throwable e) {
|
||||
@ -507,12 +511,14 @@ public class I2PFirefox {
|
||||
public void launch(boolean privateWindow, String[] url) {
|
||||
if (waitForProxy()) {
|
||||
p = launchAndDetatch(privateWindow, url);
|
||||
if (p == null)
|
||||
return;
|
||||
try {
|
||||
System.out.println("Waiting for I2PFirefox to close...");
|
||||
println("Waiting for I2PFirefox to close...");
|
||||
int exit = p.waitFor();
|
||||
System.out.println("I2PFirefox exited with value: " + exit);
|
||||
println("I2PFirefox exited with value: " + exit);
|
||||
} catch (Exception e) {
|
||||
System.out.println("Error: " + e.getMessage());
|
||||
println("Error: " + e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -542,7 +548,7 @@ public class I2PFirefox {
|
||||
String[] schemes = {"http", "https"};
|
||||
for (String scheme : schemes) {
|
||||
if (inUrl.startsWith(scheme)) {
|
||||
System.out.println("Valid URL: " + inUrl);
|
||||
println("Valid URL: " + inUrl);
|
||||
return inUrl;
|
||||
}
|
||||
}
|
||||
@ -551,14 +557,14 @@ public class I2PFirefox {
|
||||
|
||||
public static void main(String[] args) {
|
||||
boolean privateBrowsing = false;
|
||||
System.out.println("checking for private browsing");
|
||||
println("checking for private browsing");
|
||||
ArrayList<String> visitURL = new ArrayList<String>();
|
||||
if (args != null) {
|
||||
if (args.length > 0) {
|
||||
for (String arg : args) {
|
||||
if (arg.equals("-private")) {
|
||||
privateBrowsing = true;
|
||||
System.out.println(
|
||||
println(
|
||||
"private browsing is true, profile will be discarded at end of session");
|
||||
}
|
||||
if (arg.equals("-usability")) {
|
||||
@ -571,7 +577,7 @@ public class I2PFirefox {
|
||||
}
|
||||
}
|
||||
}
|
||||
System.out.println("I2PFirefox");
|
||||
println("I2PFirefox");
|
||||
I2PFirefox i2pFirefox = new I2PFirefox();
|
||||
i2pFirefox.launch(privateBrowsing,
|
||||
visitURL.toArray(new String[visitURL.size()]));
|
||||
|
@ -112,22 +112,24 @@ public class I2PFirefoxProfileBuilder extends I2PCommonBrowser {
|
||||
public static boolean copyBaseProfiletoProfile(String base) {
|
||||
String baseProfile = baseProfileDirectory(base);
|
||||
String profile = profileDirectory();
|
||||
System.out.println("Copying base profile to profile directory: " +
|
||||
baseProfile + " -> " + profile);
|
||||
println("Copying base profile to profile directory: " + baseProfile +
|
||||
" -> " + profile);
|
||||
if (baseProfile.isEmpty() || profile.isEmpty()) {
|
||||
return false;
|
||||
}
|
||||
File baseProfileDir = new File(baseProfile);
|
||||
File profileDir = new File(profile);
|
||||
|
||||
try {
|
||||
System.out.println("Copying base profile to profile directory");
|
||||
copyDirectory(baseProfileDir, profileDir, "firefox", base);
|
||||
} catch (Exception e) {
|
||||
System.out.println("Error copying base profile to profile" + e);
|
||||
return false;
|
||||
if (!profileDir.exists()) {
|
||||
try {
|
||||
println("Copying base profile to profile directory");
|
||||
copyDirectory(baseProfileDir, profileDir, "firefox", base);
|
||||
} catch (Exception e) {
|
||||
println("Error copying base profile to profile" + e);
|
||||
return false;
|
||||
}
|
||||
println("Copied base profile to profile directory");
|
||||
}
|
||||
System.out.println("Copied base profile to profile directory");
|
||||
// if user.js does not exist yet, make an empty one.
|
||||
// if (!touch(profileDir.toString(), "user.js")) {
|
||||
// return false;
|
||||
@ -169,7 +171,7 @@ public class I2PFirefoxProfileBuilder extends I2PCommonBrowser {
|
||||
Files.copy(baseOverrides.toPath(), userOverrides.toPath(),
|
||||
StandardCopyOption.REPLACE_EXISTING);
|
||||
} catch (Exception e) {
|
||||
System.out.println("Error copying base profile to profile" + e);
|
||||
println("Error copying base profile to profile" + e);
|
||||
return false;
|
||||
}
|
||||
// if user-overrides.js does not exist yet, make an empty one.
|
||||
|
@ -22,7 +22,7 @@ import java.io.IOException;
|
||||
* @author idk
|
||||
* @since 0.0.1
|
||||
*/
|
||||
public class I2PFirefoxProfileChecker {
|
||||
public class I2PFirefoxProfileChecker extends I2PCommonBrowser {
|
||||
|
||||
/**
|
||||
* @param args unused
|
||||
@ -30,15 +30,15 @@ public class I2PFirefoxProfileChecker {
|
||||
public static void main(String[] args) {
|
||||
String profileDirectory = I2PFirefoxProfileBuilder.profileDirectory();
|
||||
if (profileDirectory == null) {
|
||||
System.out.println("No profile directory found");
|
||||
println("No profile directory found");
|
||||
return;
|
||||
}
|
||||
System.out.println("Profile directory: " + profileDirectory);
|
||||
println("Profile directory: " + profileDirectory);
|
||||
boolean ok = validateProfileDirectory(profileDirectory);
|
||||
if (ok) {
|
||||
System.out.println("Profile directory is valid");
|
||||
println("Profile directory is valid");
|
||||
} else {
|
||||
System.out.println("Profile directory is invalid");
|
||||
println("Profile directory is invalid");
|
||||
}
|
||||
}
|
||||
/**
|
||||
@ -51,31 +51,31 @@ public class I2PFirefoxProfileChecker {
|
||||
public static boolean validateProfileDirectory(String profileDirectory) {
|
||||
File profileDir = new File(profileDirectory);
|
||||
if (!profileDir.exists()) {
|
||||
System.out.println("Profile directory does not exist");
|
||||
println("Profile directory does not exist");
|
||||
return false;
|
||||
}
|
||||
if (!profileDir.isDirectory()) {
|
||||
System.out.println("Profile directory is not a directory");
|
||||
println("Profile directory is not a directory");
|
||||
return false;
|
||||
}
|
||||
if (!profileDir.canRead()) {
|
||||
System.out.println("Profile directory is not readable");
|
||||
println("Profile directory is not readable");
|
||||
return false;
|
||||
}
|
||||
if (!profileDir.canWrite()) {
|
||||
System.out.println("Profile directory is not writable");
|
||||
println("Profile directory is not writable");
|
||||
return false;
|
||||
}
|
||||
if (!validateFile(profileDir + "/prefs.js")) {
|
||||
System.out.println("prefs.js is not valid");
|
||||
println("prefs.js is not valid");
|
||||
return false;
|
||||
}
|
||||
if (!validateFile(profileDir + "/user.js")) {
|
||||
System.out.println("user.js is not valid");
|
||||
println("user.js is not valid");
|
||||
return false;
|
||||
}
|
||||
if (!validateExtensionDirectory(profileDir + "/extensions")) {
|
||||
System.out.println("extensions directory is invalid");
|
||||
println("extensions directory is invalid");
|
||||
return false;
|
||||
}
|
||||
return deRestrictHTTPS(profileDir.toString());
|
||||
@ -140,19 +140,19 @@ public class I2PFirefoxProfileChecker {
|
||||
public static boolean validateFile(String file) {
|
||||
File f = new File(file);
|
||||
if (!f.exists()) {
|
||||
System.out.println("User JavaScript file does not exist");
|
||||
println("User JavaScript file does not exist");
|
||||
return false;
|
||||
}
|
||||
if (!f.isFile()) {
|
||||
System.out.println("User JavaScript file is not a file");
|
||||
println("User JavaScript file is not a file");
|
||||
return false;
|
||||
}
|
||||
if (!f.canRead()) {
|
||||
System.out.println("User JavaScript file is not readable");
|
||||
println("User JavaScript file is not readable");
|
||||
return false;
|
||||
}
|
||||
if (!f.canWrite()) {
|
||||
System.out.println("User JavaScript file is not writable");
|
||||
println("User JavaScript file is not writable");
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
@ -167,19 +167,19 @@ public class I2PFirefoxProfileChecker {
|
||||
public static boolean validateExtensionDirectory(String extensionDirectory) {
|
||||
File extensionDir = new File(extensionDirectory);
|
||||
if (!extensionDir.exists()) {
|
||||
System.out.println("Extension directory does not exist");
|
||||
println("Extension directory does not exist");
|
||||
return false;
|
||||
}
|
||||
if (!extensionDir.isDirectory()) {
|
||||
System.out.println("Extension directory is not a directory");
|
||||
println("Extension directory is not a directory");
|
||||
return false;
|
||||
}
|
||||
if (!extensionDir.canRead()) {
|
||||
System.out.println("Extension directory is not readable");
|
||||
println("Extension directory is not readable");
|
||||
return false;
|
||||
}
|
||||
if (!extensionDir.canWrite()) {
|
||||
System.out.println("Extension directory is not writable");
|
||||
println("Extension directory is not writable");
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
@ -23,7 +23,7 @@ public class I2PFirefoxProfileUnpacker extends I2PCommonBrowser {
|
||||
public static void main(String[] args) {
|
||||
String profileDirectory = I2PFirefoxProfileBuilder.profileDirectory();
|
||||
if (profileDirectory == null) {
|
||||
System.out.println("No profile directory found");
|
||||
println("No profile directory found");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -216,7 +216,7 @@ public class I2PGenericUnsafeBrowser extends I2PCommonBrowser {
|
||||
pb.environment().put("NO_PROXY", "http://127.0.0.1:7657");
|
||||
return pb;
|
||||
} else {
|
||||
System.out.println("No Browser found.");
|
||||
println("No Browser found.");
|
||||
return new ProcessBuilder(args);
|
||||
}
|
||||
}
|
||||
@ -336,7 +336,7 @@ public class I2PGenericUnsafeBrowser extends I2PCommonBrowser {
|
||||
try {
|
||||
System.out.println(pb.command());
|
||||
p = pb.start();
|
||||
System.out.println("I2PBrowser");
|
||||
println("I2PBrowser");
|
||||
sleep(2000);
|
||||
return p;
|
||||
} catch (Throwable e) {
|
||||
@ -350,16 +350,15 @@ public class I2PGenericUnsafeBrowser extends I2PCommonBrowser {
|
||||
if (waitForProxy()) {
|
||||
p = launchAndDetatch(privateWindow, url);
|
||||
try {
|
||||
System.out.println("Waiting for I2PBrowser to close...");
|
||||
println("Waiting for I2PBrowser to close...");
|
||||
int exit = p.waitFor();
|
||||
if (privateWindow) {
|
||||
if (deleteRuntimeDirectory())
|
||||
System.out.println(
|
||||
"Private browsing enforced, deleting runtime directory");
|
||||
println("Private browsing enforced, deleting runtime directory");
|
||||
}
|
||||
System.out.println("I2PBrowser exited with value: " + exit);
|
||||
println("I2PBrowser exited with value: " + exit);
|
||||
} catch (Exception e) {
|
||||
System.out.println("Error: " + e.getMessage());
|
||||
println("Error: " + e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -376,7 +375,7 @@ public class I2PGenericUnsafeBrowser extends I2PCommonBrowser {
|
||||
String[] schemes = {"http", "https"};
|
||||
for (String scheme : schemes) {
|
||||
if (inUrl.startsWith(scheme)) {
|
||||
System.out.println("Valid URL: " + inUrl);
|
||||
println("Valid URL: " + inUrl);
|
||||
return inUrl;
|
||||
}
|
||||
}
|
||||
@ -395,14 +394,14 @@ public class I2PGenericUnsafeBrowser extends I2PCommonBrowser {
|
||||
//
|
||||
public static void main(String[] args) {
|
||||
boolean privateBrowsing = false;
|
||||
System.out.println("checking for private browsing");
|
||||
println("checking for private browsing");
|
||||
ArrayList<String> visitURL = new ArrayList<String>();
|
||||
if (args != null) {
|
||||
if (args.length > 0) {
|
||||
for (String arg : args) {
|
||||
if (arg.equals("-private")) {
|
||||
privateBrowsing = true;
|
||||
System.out.println(
|
||||
println(
|
||||
"private browsing is true, profile will be discarded at end of session");
|
||||
}
|
||||
if (!arg.startsWith("-")) {
|
||||
@ -412,7 +411,7 @@ public class I2PGenericUnsafeBrowser extends I2PCommonBrowser {
|
||||
}
|
||||
}
|
||||
}
|
||||
System.out.println("I2PGenericUnsafeBrowser");
|
||||
println("I2PGenericUnsafeBrowser");
|
||||
I2PGenericUnsafeBrowser i2pBrowser = new I2PGenericUnsafeBrowser();
|
||||
i2pBrowser.launch(privateBrowsing,
|
||||
visitURL.toArray(new String[visitURL.size()]));
|
||||
|
Reference in New Issue
Block a user