add URL-passing option

Former-commit-id: ce8ec78beb
Former-commit-id: 1352be01aeb6ad0c7c2539f6354505c5b4c8a8cf
This commit is contained in:
idk
2022-08-27 13:27:28 -04:00
parent 276e67c994
commit 59f69ee5cb
21 changed files with 669 additions and 370 deletions

View File

@ -3,6 +3,10 @@
> */
Access: public
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
package: net.i2p.i2pfirefox
## Dependencies
@ -12,6 +16,7 @@ package: net.i2p.i2pfirefox
Show dependencies
</summary>
<ul>
<li>java.util.ArrayList</li>
</ul>
</details>
@ -51,7 +56,19 @@ package: net.i2p.i2pfirefox
## Methods
### launchFirefox [[src]](src/java/net/i2p/i2pfirefox/I2PBrowser.java#L29)
### launchFirefox [[src]](src/java/net/i2p/i2pfirefox/I2PBrowser.java#L30)
+ Description:
+ Access: private
+ return: void
| Name | Type | Description |
| ----- | ----- | ----- |
| privateWindow | boolean | |
| url | String[] | |
### launchFirefox [[src]](src/java/net/i2p/i2pfirefox/I2PBrowser.java#L34)
+ Description:
+ Access: private
@ -62,7 +79,19 @@ package: net.i2p.i2pfirefox
| privateWindow | boolean | |
### launchChromium [[src]](src/java/net/i2p/i2pfirefox/I2PBrowser.java#L33)
### launchChromium [[src]](src/java/net/i2p/i2pfirefox/I2PBrowser.java#L38)
+ Description:
+ Access: private
+ return: void
| Name | Type | Description |
| ----- | ----- | ----- |
| privateWindow | boolean | |
| url | String[] | |
### launchChromium [[src]](src/java/net/i2p/i2pfirefox/I2PBrowser.java#L42)
+ Description:
+ Access: private
@ -73,27 +102,39 @@ package: net.i2p.i2pfirefox
| privateWindow | boolean | |
### hasChromium [[src]](src/java/net/i2p/i2pfirefox/I2PBrowser.java#L52)
### hasChromium [[src]](src/java/net/i2p/i2pfirefox/I2PBrowser.java#L61)
+ Description:
+ Description: Return true if there is a Chromium available
+ Access: public
+ return: boolean
+ return: true if Chromium is available false otherwise
This method has no parameters.
### hasFirefox [[src]](src/java/net/i2p/i2pfirefox/I2PBrowser.java#L69)
### hasFirefox [[src]](src/java/net/i2p/i2pfirefox/I2PBrowser.java#L78)
+ Description:
+ Description: Return true if there is a Firefox variant available
+ Access: public
+ return: boolean
+ return: true if Firefox variant is available false otherwise
This method has no parameters.
### launch [[src]](src/java/net/i2p/i2pfirefox/I2PBrowser.java#L88)
### launch [[src]](src/java/net/i2p/i2pfirefox/I2PBrowser.java#L97)
+ Description:
+ Description: Populates a profile directory with a proxy configuration. Waits for an HTTP proxy on the port 4444 to be ready. Launches either Firefox or Chromium with the profile directory.
+ Access: public
+ return: void
| Name | Type | Description |
| ----- | ----- | ----- |
| privateWindow | boolean | |
| url | String[] | |
### launch [[src]](src/java/net/i2p/i2pfirefox/I2PBrowser.java#L130)
+ Description: Populates a profile directory with a proxy configuration. Waits for an HTTP proxy on the port 4444 to be ready. Launches either Firefox or Chromium with the profile directory.
+ Access: public
+ return: void
@ -102,16 +143,28 @@ This method has no parameters.
| privateWindow | boolean | |
### launch [[src]](src/java/net/i2p/i2pfirefox/I2PBrowser.java#L120)
### launch [[src]](src/java/net/i2p/i2pfirefox/I2PBrowser.java#L141)
+ Description:
+ Description: Populates a profile directory with a proxy configuration. Waits for an HTTP proxy on the port 4444 to be ready. Launches either Firefox or Chromium with the profile directory.
+ Access: public
+ return: void
This method has no parameters.
### main [[src]](src/java/net/i2p/i2pfirefox/I2PBrowser.java#L124)
### ValidURL [[src]](src/java/net/i2p/i2pfirefox/I2PBrowser.java#L145)
+ Description:
+ Access: private
+ Modifiers: static
+ return: String
| Name | Type | Description |
| ----- | ----- | ----- |
| inUrl | String | |
### main [[src]](src/java/net/i2p/i2pfirefox/I2PBrowser.java#L155)
+ Description:
+ Access: public

View File

@ -3,6 +3,10 @@
> */
Access: public
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
package: net.i2p.i2pfirefox
## Dependencies
@ -119,27 +123,27 @@ This method has no parameters.
### onlyValidChromiums [[src]](src/java/net/i2p/i2pfirefox/I2PChromium.java#L211)
+ Description:
+ Description: Check our list of chrome paths for a valid chrome binary. Just an existence check for now but should check versions in the future.
+ Access: public
+ return: String[]
+ return: a list of usable Chromiums or an empty list if none are found.
This method has no parameters.
### topChromium [[src]](src/java/net/i2p/i2pfirefox/I2PChromium.java#L231)
+ Description:
+ Description: Return the best available Chromium from the list of Chromiums we have.
+ Access: public
+ return: String
+ return: the path to the best available Chromium or null if none are found.
This method has no parameters.
### topChromium [[src]](src/java/net/i2p/i2pfirefox/I2PChromium.java#L260)
+ Description:
+ Description: Return the best available Chromium from the list of Chromiums we have. if override is passed it will be validated and if it validates it will be used.
+ Access: public
+ return: String
+ return: the path to the best available Chromium or null if none are found.
| Name | Type | Description |
| ----- | ----- | ----- |
@ -148,79 +152,101 @@ This method has no parameters.
### defaultProcessBuilder [[src]](src/java/net/i2p/i2pfirefox/I2PChromium.java#L278)
+ Description:
+ Description: Build a ProcessBuilder for the top Chromium binary and the default profile.
+ Access: public
+ return: ProcessBuilder
+ return: a ProcessBuilder for the top Chromium binary and the default profile.
This method has no parameters.
### privateProcessBuilder [[src]](src/java/net/i2p/i2pfirefox/I2PChromium.java#L291)
### defaultProcessBuilder [[src]](src/java/net/i2p/i2pfirefox/I2PChromium.java#L291)
+ Description:
+ Description: Build a ProcessBuilder for the top Chromium binary and the default profile. @args the arguments to pass to the Chromium binary
+ Access: public
+ return: ProcessBuilder
This method has no parameters.
### processBuilder [[src]](src/java/net/i2p/i2pfirefox/I2PChromium.java#L328)
+ Description:
+ Access: public
+ return: ProcessBuilder
+ return: a ProcessBuilder for the top Chromium binary and the default profile.
| Name | Type | Description |
| ----- | ----- | ----- |
| args | String[] | |
### waitForProxy [[src]](src/java/net/i2p/i2pfirefox/I2PChromium.java#L375)
### privateProcessBuilder [[src]](src/java/net/i2p/i2pfirefox/I2PChromium.java#L304)
+ Description:
+ Description: Build a ProcessBuilder for the top Chromium binary and the default profile.
+ Access: public
+ return: boolean
+ return: a ProcessBuilder for the top Chromium binary and the default profile. Always passes the --incognito flag.
This method has no parameters.
### waitForProxy [[src]](src/java/net/i2p/i2pfirefox/I2PChromium.java#L387)
### privateProcessBuilder [[src]](src/java/net/i2p/i2pfirefox/I2PChromium.java#L317)
+ Description:
+ Description: Build a ProcessBuilder for the top Chromium binary and the default profile.
+ Access: public
+ return: boolean
+ return: a ProcessBuilder for the top Chromium binary and the default profile. Always passes the --incognito flag.
| Name | Type | Description |
| ----- | ----- | ----- |
| timeout | int | |
| args | String[] | the arguments to pass to the Chromium binary. |
### waitForProxy [[src]](src/java/net/i2p/i2pfirefox/I2PChromium.java#L399)
### processBuilder [[src]](src/java/net/i2p/i2pfirefox/I2PChromium.java#L362)
+ Description:
+ Description: Build a ProcessBuilder for the top Chromium binary and the default profile with a specific set of extended arguments.
+ Access: public
+ return: boolean
+ return: a ProcessBuilder for the top Chromium binary and default profile with a specific set of extended arguments.
| Name | Type | Description |
| ----- | ----- | ----- |
| timeout | int | |
| port | int | |
| args | String[] | the extended arguments to pass to the Chromium binary. |
### waitForProxy [[src]](src/java/net/i2p/i2pfirefox/I2PChromium.java#L412)
### waitForProxy [[src]](src/java/net/i2p/i2pfirefox/I2PChromium.java#L409)
+ Description:
+ Description: Waits for an HTTP proxy on port 4444 to be ready. Returns false on timeout of 200 seconds.
+ Access: public
+ return: boolean
+ return: true if the proxy is ready false if it is not.
This method has no parameters.
### waitForProxy [[src]](src/java/net/i2p/i2pfirefox/I2PChromium.java#L421)
+ Description: Waits for an HTTP proxy on port 4444 to be ready. Returns false on timeout of the specified number of seconds.
+ Access: public
+ return: true if the proxy is ready false if it is not.
| Name | Type | Description |
| ----- | ----- | ----- |
| timeout | int | |
| port | int | |
| host | String | |
| timeout | int | the number of seconds to wait for the proxy to be ready. |
### checkifPortIsOccupied [[src]](src/java/net/i2p/i2pfirefox/I2PChromium.java#L425)
### waitForProxy [[src]](src/java/net/i2p/i2pfirefox/I2PChromium.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
+ return: true if the proxy is ready false if it is not.
| Name | Type | Description |
| ----- | ----- | ----- |
| timeout | int | the number of seconds to wait for the proxy to be ready. |
| port | int | the port to wait for the proxy to be ready on. |
### waitForProxy [[src]](src/java/net/i2p/i2pfirefox/I2PChromium.java#L446)
+ 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
+ return: true if the proxy is ready false if it is not.
| Name | Type | Description |
| ----- | ----- | ----- |
| timeout | int | the number of seconds to wait for the proxy to be ready. |
| port | int | the port to wait for the proxy to be ready on. |
| host | String | the host to wait for the proxy to be ready on. |
### checkifPortIsOccupied [[src]](src/java/net/i2p/i2pfirefox/I2PChromium.java#L459)
+ Description:
+ Access: private
@ -232,9 +258,21 @@ This method has no parameters.
| host | String | |
### launch [[src]](src/java/net/i2p/i2pfirefox/I2PChromium.java#L444)
### launch [[src]](src/java/net/i2p/i2pfirefox/I2PChromium.java#L479)
+ Description:
+ 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
+ return: void
| Name | Type | Description |
| ----- | ----- | ----- |
| privateWindow | boolean | |
| url | String[] | |
### launch [[src]](src/java/net/i2p/i2pfirefox/I2PChromium.java#L524)
+ 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
+ return: void
@ -243,16 +281,28 @@ This method has no parameters.
| privateWindow | boolean | |
### launch [[src]](src/java/net/i2p/i2pfirefox/I2PChromium.java#L488)
### launch [[src]](src/java/net/i2p/i2pfirefox/I2PChromium.java#L535)
+ Description:
+ 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
+ return: void
This method has no parameters.
### main [[src]](src/java/net/i2p/i2pfirefox/I2PChromium.java#L492)
### ValidURL [[src]](src/java/net/i2p/i2pfirefox/I2PChromium.java#L539)
+ Description:
+ Access: private
+ Modifiers: static
+ return: String
| Name | Type | Description |
| ----- | ----- | ----- |
| inUrl | String | |
### main [[src]](src/java/net/i2p/i2pfirefox/I2PChromium.java#L549)
+ Description:
+ Access: public
@ -264,7 +314,7 @@ This method has no parameters.
| args | String[] | |
### sleep [[src]](src/java/net/i2p/i2pfirefox/I2PChromium.java#L505)
### sleep [[src]](src/java/net/i2p/i2pfirefox/I2PChromium.java#L569)
+ Description:
+ Access: private

View File

@ -3,6 +3,10 @@
> */
Access: public
Description:
> I2PChromiumProfileBuilder.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. I2PChromiumProfileBuilder is a that builds a profile directory which contains the I2P browser profile for the Chromium browser family. It manages the base profile directory and copies it's contents to the active profile directory which is actually used by Chromium.
Author: idk
package: net.i2p.i2pfirefox
## Dependencies
@ -48,7 +52,7 @@ package: net.i2p.i2pfirefox
### profileDirectory [[src]](src/java/net/i2p/i2pfirefox/I2PChromiumProfileBuilder.java#L43)
+ Description:
+ Description: get the profile directory creating it if necessary
+ Access: public
+ Modifiers: static
+ return: String
@ -70,7 +74,7 @@ This method has no parameters.
### baseProfileDirectory [[src]](src/java/net/i2p/i2pfirefox/I2PChromiumProfileBuilder.java#L75)
+ Description:
+ Description: get the base profile directory creating it if necessary
+ Access: public
+ Modifiers: static
+ return: String
@ -80,29 +84,29 @@ This method has no parameters.
### runtimeDirectory [[src]](src/java/net/i2p/i2pfirefox/I2PChromiumProfileBuilder.java#L99)
+ Description:
+ Description: get the runtime directory creating it if create=true
+ Access: public
+ Modifiers: static
+ return: File
+ return: the runtime directory or null if it could not be created
| Name | Type | Description |
| ----- | ----- | ----- |
| create | boolean | |
| create | boolean | if true create the runtime directory if it does not exist |
### runtimeDirectory [[src]](src/java/net/i2p/i2pfirefox/I2PChromiumProfileBuilder.java#L116)
+ Description:
+ Description: get the correct runtime directory
+ Access: public
+ Modifiers: static
+ return: String
+ return: the runtime directory or null if it could not be created or found
This method has no parameters.
### copyBaseProfiletoProfile [[src]](src/java/net/i2p/i2pfirefox/I2PChromiumProfileBuilder.java#L162)
+ Description:
+ Description: Copy the inert base profile directory to the runtime profile directory
+ Access: public
+ Modifiers: static
+ return: boolean
@ -151,10 +155,10 @@ This method has no parameters.
### copyStrictOptions [[src]](src/java/net/i2p/i2pfirefox/I2PChromiumProfileBuilder.java#L227)
+ Description:
+ Description: Copy the strict options from the base profile to the profile
+ Access: public
+ Modifiers: static
+ return: boolean
+ return: true if successful false otherwise
This method has no parameters.

View File

@ -3,6 +3,10 @@
> */
Access: public
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
package: net.i2p.i2pfirefox
## Dependencies
@ -22,7 +26,7 @@ package: net.i2p.i2pfirefox
### main [[src]](src/java/net/i2p/i2pfirefox/I2PChromiumProfileChecker.java#L28)
+ Description:
+ Description: Output feedback if the profile directory is valid or invalid @description Output feedback if the profile directory is valid or invalid
+ Access: public
+ Modifiers: static
+ return: void
@ -34,22 +38,22 @@ package: net.i2p.i2pfirefox
### validateProfileDirectory [[src]](src/java/net/i2p/i2pfirefox/I2PChromiumProfileChecker.java#L49)
+ Description:
+ Description: Return true if the profile directory is valid.
+ Access: public
+ Modifiers: static
+ return: boolean
+ return: true if the profile directory is valid false otherwise
| Name | Type | Description |
| ----- | ----- | ----- |
| profileDirectory | String | |
| profileDirectory | String | the profile directory to check |
### validateFile [[src]](src/java/net/i2p/i2pfirefox/I2PChromiumProfileChecker.java#L80)
+ Description:
+ Description: Return true if the extension directory is valid.
+ Access: public
+ Modifiers: static
+ return: boolean
+ return: true if the extension directory is valid false otherwise
| Name | Type | Description |
| ----- | ----- | ----- |
@ -58,13 +62,13 @@ package: net.i2p.i2pfirefox
### validateExtensionDirectory [[src]](src/java/net/i2p/i2pfirefox/I2PChromiumProfileChecker.java#L107)
+ Description:
+ Description: Return true if the extension directory is valid.
+ Access: public
+ Modifiers: static
+ return: boolean
+ return: true if the extension directory is valid false otherwise
| Name | Type | Description |
| ----- | ----- | ----- |
| extensionDirectory | String | |
| extensionDirectory | String | the extension directory to check |

View File

@ -3,6 +3,10 @@
> */
Access: public
Description:
> I2PChromiumProfileUnpacker.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. I2PChromiumProfileUnpacker is a that unpacks the Chromium profile zip file into the Chromium base profile directory. This is not used by the Chromium browser instance it's unpacked to the disk to be copied to the active profile directory.
Author: idk
package: net.i2p.i2pfirefox
## Dependencies
@ -39,9 +43,9 @@ package: net.i2p.i2pfirefox
### unpackProfile [[src]](src/java/net/i2p/i2pfirefox/I2PChromiumProfileUnpacker.java#L44)
+ Description:
+ Description: unpack the profile directory
+ Access: public
+ return: boolean
+ return: true if the profile directory was successfully unpacked
| Name | Type | Description |
| ----- | ----- | ----- |

View File

@ -3,6 +3,10 @@
> */
Access: public
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
package: net.i2p.i2pfirefox
## Dependencies
@ -119,27 +123,27 @@ This method has no parameters.
### onlyValidFirefoxes [[src]](src/java/net/i2p/i2pfirefox/I2PFirefox.java#L218)
+ Description:
+ Description: Check our list of firefox paths for a valid firefox binary. Just an existence check for now but should check versions in the future.
+ Access: public
+ return: String[]
+ return: a list of usable Firefoxes or an empty list if none are found.
This method has no parameters.
### topFirefox [[src]](src/java/net/i2p/i2pfirefox/I2PFirefox.java#L238)
+ Description:
+ Description: Return the best available Firefox from the list of Firefoxes we have.
+ Access: public
+ return: String
+ return: the path to the best available Firefox or null if none are found.
This method has no parameters.
### topFirefox [[src]](src/java/net/i2p/i2pfirefox/I2PFirefox.java#L267)
+ Description:
+ Description: Return the best available Firefox from the list of Firefoxes we have. if override is passed it will be validated and if it validates it will be used.
+ Access: public
+ return: String
+ return: the path to the best available Firefox or null if none are found.
| Name | Type | Description |
| ----- | ----- | ----- |
@ -148,79 +152,101 @@ This method has no parameters.
### defaultProcessBuilder [[src]](src/java/net/i2p/i2pfirefox/I2PFirefox.java#L285)
+ Description:
+ Description: Build a ProcessBuilder for the top Firefox binary and the default profile.
+ Access: public
+ return: ProcessBuilder
+ return: a ProcessBuilder for the top Firefox binary and the default profile.
This method has no parameters.
### privateProcessBuilder [[src]](src/java/net/i2p/i2pfirefox/I2PFirefox.java#L299)
### defaultProcessBuilder [[src]](src/java/net/i2p/i2pfirefox/I2PFirefox.java#L297)
+ Description:
+ Access: public
+ return: ProcessBuilder
This method has no parameters.
### processBuilder [[src]](src/java/net/i2p/i2pfirefox/I2PFirefox.java#L313)
+ Description:
+ Description: Build a ProcessBuilder for the top Firefox binary and the default profile.
+ Access: public
+ return: ProcessBuilder
| Name | Type | Description |
| ----- | ----- | ----- |
| args | String[] | |
| args | String[] | the args to pass to the Firefox binary |
### waitForProxy [[src]](src/java/net/i2p/i2pfirefox/I2PFirefox.java#L339)
### privateProcessBuilder [[src]](src/java/net/i2p/i2pfirefox/I2PFirefox.java#L311)
+ Description:
+ Description: Build a ProcessBuilder for the top Firefox binary and the default profile. Pass the --private-window flag to open a window.
+ Access: public
+ return: boolean
+ return: a ProcessBuilder for the top Firefox binary and the default profile.
This method has no parameters.
### waitForProxy [[src]](src/java/net/i2p/i2pfirefox/I2PFirefox.java#L351)
### privateProcessBuilder [[src]](src/java/net/i2p/i2pfirefox/I2PFirefox.java#L325)
+ Description:
+ Description: Build a ProcessBuilder for the top Firefox binary and the default profile. Pass the --private-window flag to open a window.
+ Access: public
+ return: boolean
+ return: ProcessBuilder
| Name | Type | Description |
| ----- | ----- | ----- |
| timeout | int | |
| args | String[] | the arguments to pass to the Firefox binary |
### waitForProxy [[src]](src/java/net/i2p/i2pfirefox/I2PFirefox.java#L363)
### processBuilder [[src]](src/java/net/i2p/i2pfirefox/I2PFirefox.java#L346)
+ Description:
+ Description: Build a ProcessBuilder for the top Firefox binary and the default profile with a specific set of extended arguments.
+ Access: public
+ return: boolean
+ return: a ProcessBuilder for the top Firefox binary and default profile with a specific set of extended arguments.
| Name | Type | Description |
| ----- | ----- | ----- |
| timeout | int | |
| port | int | |
| args | String[] | the extended arguments to pass to the Firefox binary. |
### waitForProxy [[src]](src/java/net/i2p/i2pfirefox/I2PFirefox.java#L376)
### waitForProxy [[src]](src/java/net/i2p/i2pfirefox/I2PFirefox.java#L372)
+ Description:
+ Description: Waits for an HTTP proxy on port 4444 to be ready. Returns false on timeout of 200 seconds.
+ Access: public
+ return: boolean
+ return: true if the proxy is ready false if it is not.
This method has no parameters.
### waitForProxy [[src]](src/java/net/i2p/i2pfirefox/I2PFirefox.java#L384)
+ Description: Waits for an HTTP proxy on port 4444 to be ready. Returns false on timeout of the specified number of seconds.
+ Access: public
+ return: true if the proxy is ready false if it is not.
| Name | Type | Description |
| ----- | ----- | ----- |
| timeout | int | |
| port | int | |
| host | String | |
| timeout | int | the number of seconds to wait for the proxy to be ready. |
### checkifPortIsOccupied [[src]](src/java/net/i2p/i2pfirefox/I2PFirefox.java#L389)
### waitForProxy [[src]](src/java/net/i2p/i2pfirefox/I2PFirefox.java#L396)
+ 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
+ return: true if the proxy is ready false if it is not.
| Name | Type | Description |
| ----- | ----- | ----- |
| timeout | int | the number of seconds to wait for the proxy to be ready. |
| port | int | the port to wait for the proxy to be ready on. |
### waitForProxy [[src]](src/java/net/i2p/i2pfirefox/I2PFirefox.java#L409)
+ 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
+ return: true if the proxy is ready false if it is not.
| Name | Type | Description |
| ----- | ----- | ----- |
| timeout | int | the number of seconds to wait for the proxy to be ready. |
| port | int | the port to wait for the proxy to be ready on. |
| host | String | the host to wait for the proxy to be ready on. |
### checkifPortIsOccupied [[src]](src/java/net/i2p/i2pfirefox/I2PFirefox.java#L422)
+ Description:
+ Access: private
@ -232,9 +258,21 @@ This method has no parameters.
| host | String | |
### launch [[src]](src/java/net/i2p/i2pfirefox/I2PFirefox.java#L408)
### launch [[src]](src/java/net/i2p/i2pfirefox/I2PFirefox.java#L441)
+ Description:
+ 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
+ return: void
| Name | Type | Description |
| ----- | ----- | ----- |
| privateWindow | boolean | |
| url | String[] | |
### launch [[src]](src/java/net/i2p/i2pfirefox/I2PFirefox.java#L487)
+ 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
+ return: void
@ -243,16 +281,28 @@ This method has no parameters.
| privateWindow | boolean | |
### launch [[src]](src/java/net/i2p/i2pfirefox/I2PFirefox.java#L454)
### launch [[src]](src/java/net/i2p/i2pfirefox/I2PFirefox.java#L499)
+ Description:
+ 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
+ return: void
This method has no parameters.
### main [[src]](src/java/net/i2p/i2pfirefox/I2PFirefox.java#L458)
### ValidURL [[src]](src/java/net/i2p/i2pfirefox/I2PFirefox.java#L503)
+ Description:
+ Access: private
+ Modifiers: static
+ return: String
| Name | Type | Description |
| ----- | ----- | ----- |
| inUrl | String | |
### main [[src]](src/java/net/i2p/i2pfirefox/I2PFirefox.java#L514)
+ Description:
+ Access: public
@ -264,7 +314,7 @@ This method has no parameters.
| args | String[] | |
### sleep [[src]](src/java/net/i2p/i2pfirefox/I2PFirefox.java#L472)
### sleep [[src]](src/java/net/i2p/i2pfirefox/I2PFirefox.java#L535)
+ Description:
+ Access: private

View File

@ -3,6 +3,10 @@
> */
Access: public
Description:
> I2PFirefoxProfileBuilder.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. I2PFirefoxProfileBuilder is a that builds a profile directory which contains the I2P browser profile for the Firefox browser family. It manages the base profile directory and copies it's contents to the active profile directory which is actually used by Firefox.
Author: idk
package: net.i2p.i2pfirefox
## Dependencies
@ -48,7 +52,7 @@ package: net.i2p.i2pfirefox
### profileDirectory [[src]](src/java/net/i2p/i2pfirefox/I2PFirefoxProfileBuilder.java#L43)
+ Description:
+ Description: get the profile directory creating it if necessary
+ Access: public
+ Modifiers: static
+ return: String
@ -70,7 +74,7 @@ This method has no parameters.
### baseProfileDirectory [[src]](src/java/net/i2p/i2pfirefox/I2PFirefoxProfileBuilder.java#L75)
+ Description:
+ Description: get the base profile directory creating it if necessary
+ Access: public
+ Modifiers: static
+ return: String
@ -80,29 +84,29 @@ This method has no parameters.
### runtimeDirectory [[src]](src/java/net/i2p/i2pfirefox/I2PFirefoxProfileBuilder.java#L99)
+ Description:
+ Description: get the runtime directory creating it if create=true
+ Access: public
+ Modifiers: static
+ return: File
+ return: the runtime directory or null if it could not be created
| Name | Type | Description |
| ----- | ----- | ----- |
| create | boolean | |
| create | boolean | if true create the runtime directory if it does not exist |
### runtimeDirectory [[src]](src/java/net/i2p/i2pfirefox/I2PFirefoxProfileBuilder.java#L116)
+ Description:
+ Description: get the correct runtime directory
+ Access: public
+ Modifiers: static
+ return: String
+ return: the runtime directory or null if it could not be created or found
This method has no parameters.
### copyBaseProfiletoProfile [[src]](src/java/net/i2p/i2pfirefox/I2PFirefoxProfileBuilder.java#L162)
+ Description:
+ Description: Copy the inert base profile directory to the runtime profile directory
+ Access: public
+ Modifiers: static
+ return: boolean
@ -151,10 +155,10 @@ This method has no parameters.
### copyStrictOptions [[src]](src/java/net/i2p/i2pfirefox/I2PFirefoxProfileBuilder.java#L227)
+ Description:
+ Description: Copy the strict options from the base profile to the profile
+ Access: public
+ Modifiers: static
+ return: boolean
+ return: true if successful false otherwise
This method has no parameters.

View File

@ -3,6 +3,10 @@
> */
Access: public
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
package: net.i2p.i2pfirefox
## Dependencies
@ -34,37 +38,37 @@ package: net.i2p.i2pfirefox
### validateProfileDirectory [[src]](src/java/net/i2p/i2pfirefox/I2PFirefoxProfileChecker.java#L43)
+ Description:
+ Description: Return true if the profile directory is valid.
+ Access: public
+ Modifiers: static
+ return: boolean
+ return: true if the profile directory is valid false otherwise
| Name | Type | Description |
| ----- | ----- | ----- |
| profileDirectory | String | |
| profileDirectory | String | the profile directory to check |
### validateFile [[src]](src/java/net/i2p/i2pfirefox/I2PFirefoxProfileChecker.java#L82)
+ Description:
+ Description: Return true if the file is valid.
+ Access: public
+ Modifiers: static
+ return: boolean
+ return: true if the file is valid false otherwise
| Name | Type | Description |
| ----- | ----- | ----- |
| file | String | |
| file | String | the file to check |
### validateExtensionDirectory [[src]](src/java/net/i2p/i2pfirefox/I2PFirefoxProfileChecker.java#L109)
+ Description:
+ Description: Return true if the extension directory is valid.
+ Access: public
+ Modifiers: static
+ return: boolean
+ return: true if the extension directory is valid false otherwise
| Name | Type | Description |
| ----- | ----- | ----- |
| extensionDirectory | String | |
| extensionDirectory | String | the extension directory to check |

View File

@ -3,6 +3,10 @@
> */
Access: public
Description:
> I2PFirefoxProfileUnpacker.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. I2PFirefoxProfileUnpacker is a that unpacks the I2P Firefox profile from a zip file embedded in the `jar` file. The zip is unpacked to a base directory where it is left untouched and the base profile is copied to the active profile directory.
Author: idk
package: net.i2p.i2pfirefox
## Dependencies
@ -39,9 +43,9 @@ package: net.i2p.i2pfirefox
### unpackProfile [[src]](src/java/net/i2p/i2pfirefox/I2PFirefoxProfileUnpacker.java#L45)
+ Description:
+ Description: unpack the profile directory
+ Access: public
+ return: boolean
+ return: true if the profile directory was successfully unpacked
| Name | Type | Description |
| ----- | ----- | ----- |

View File

@ -3,25 +3,13 @@ Generating documentation from src/java/net/i2p/i2pfirefox/
Javadoc errors for class I2PChromiumProfileChecker
File: src/java/net/i2p/i2pfirefox/I2PChromiumProfileChecker.java
 Missing description for method main (Line: 28)
 Javadoc parameter not found args in method: main (Line: 28)
 Missing description for method validateProfileDirectory (Line: 49)
 Javadoc parameter not found profileDirectory in method: validateProfileDirectory (Line: 49)
 Missing description for method validateFile (Line: 80)
 Javadoc parameter not found file in method: validateFile (Line: 80)
 Missing description for method validateExtensionDirectory (Line: 107)
 Javadoc parameter not found extensionDirectory in method: validateExtensionDirectory (Line: 107)
Javadoc errors for class I2PFirefoxProfileChecker
File: src/java/net/i2p/i2pfirefox/I2PFirefoxProfileChecker.java
 Missing description for method main (Line: 22)
 Javadoc parameter not found args in method: main (Line: 22)
 Missing description for method validateProfileDirectory (Line: 43)
 Javadoc parameter not found profileDirectory in method: validateProfileDirectory (Line: 43)
 Missing description for method validateFile (Line: 82)
 Javadoc parameter not found file in method: validateFile (Line: 82)
 Missing description for method validateExtensionDirectory (Line: 109)
 Javadoc parameter not found extensionDirectory in method: validateExtensionDirectory (Line: 109)
Javadoc errors for class I2PBrowser
File: src/java/net/i2p/i2pfirefox/I2PBrowser.java
@ -35,32 +23,31 @@ File: src/java/net/i2p/i2pfirefox/I2PBrowser.java
 Missing return type for member variable boolean chromium (Line: )
 Missing description for member variable boolean chromiumFirst (Line: )
 Missing return type for member variable boolean chromiumFirst (Line: )
 Missing description for method launchFirefox (Line: 29)
 Javadoc parameter not found privateWindow in method: launchFirefox (Line: 29)
 Missing description for method launchChromium (Line: 33)
 Javadoc parameter not found privateWindow in method: launchChromium (Line: 33)
 Missing description for method  (Line: 43)
 Missing description for method hasChromium (Line: 52)
 Missing description for method hasFirefox (Line: 69)
 Missing description for method launch (Line: 88)
 Javadoc parameter not found privateWindow in method: launch (Line: 88)
 Missing description for method launch (Line: 120)
 Missing description for method main (Line: 124)
 Javadoc parameter not found args in method: main (Line: 124)
 Missing description for method launchFirefox (Line: 30)
 Javadoc parameter not found privateWindow in method: launchFirefox (Line: 30)
 Javadoc parameter not found url in method: launchFirefox (Line: 30)
 Missing description for method launchFirefox (Line: 34)
 Javadoc parameter not found privateWindow in method: launchFirefox (Line: 34)
 Missing description for method launchChromium (Line: 38)
 Javadoc parameter not found privateWindow in method: launchChromium (Line: 38)
 Javadoc parameter not found url in method: launchChromium (Line: 38)
 Missing description for method launchChromium (Line: 42)
 Javadoc parameter not found privateWindow in method: launchChromium (Line: 42)
 Javadoc parameter not found privateWindow in method: launch (Line: 97)
 Javadoc parameter not found url in method: launch (Line: 97)
 Javadoc parameter not found privateWindow in method: launch (Line: 130)
 Missing description for method ValidURL (Line: 145)
 Javadoc parameter not found inUrl in method: ValidURL (Line: 145)
 Missing description for method main (Line: 155)
 Javadoc parameter not found args in method: main (Line: 155)
Javadoc errors for class I2PFirefoxProfileBuilder
File: src/java/net/i2p/i2pfirefox/I2PFirefoxProfileBuilder.java
 Missing description for member variable strict (Line: )
 Missing description for method profileDir (Line: 33)
 Javadoc parameter not found file in method: profileDir (Line: 33)
 Missing description for method profileDirectory (Line: 43)
 Missing description for method baseProfileDir (Line: 55)
 Javadoc parameter not found file in method: baseProfileDir (Line: 55)
 Missing description for method baseProfileDirectory (Line: 75)
 Missing description for method runtimeDirectory (Line: 99)
 Javadoc parameter not found create in method: runtimeDirectory (Line: 99)
 Missing description for method runtimeDirectory (Line: 116)
 Missing description for method copyBaseProfiletoProfile (Line: 162)
 Missing description for method copyDirectory (Line: 192)
 Javadoc parameter not found sourceDirectory in method: copyDirectory (Line: 192)
 Javadoc parameter not found destinationDirectory in method: copyDirectory (Line: 192)
@ -70,10 +57,6 @@ File: src/java/net/i2p/i2pfirefox/I2PFirefoxProfileBuilder.java
 Missing description for method copyFile (Line: 210)
 Javadoc parameter not found sourceFile in method: copyFile (Line: 210)
 Javadoc parameter not found destinationFile in method: copyFile (Line: 210)
 Missing description for method copyStrictOptions (Line: 227)
 Missing description for method  (Line: 264)
 Missing description for method  (Line: 274)
 Javadoc parameter not found strict in method: (Line: 274)
Javadoc errors for class I2PChromium
File: src/java/net/i2p/i2pfirefox/I2PChromium.java
@ -81,7 +64,6 @@ File: src/java/net/i2p/i2pfirefox/I2PChromium.java
 Missing return type for member variable String[] CHROMIUM_SEARCH_PATHS (Line: )
 Missing description for member variable int DEFAULT_TIMEOUT (Line: )
 Missing return type for member variable int DEFAULT_TIMEOUT (Line: )
 Missing description for method  (Line: 33)
 Missing description for method FIND_CHROMIUM_SEARCH_PATHS_UNIX (Line: 44)
 Missing description for method FIND_CHROMIUM_SEARCH_PATHS_OSX (Line: 57)
 Missing description for method FIND_CHROMIUM_SEARCH_PATHS_WINDOWS (Line: 70)
@ -90,47 +72,31 @@ File: src/java/net/i2p/i2pfirefox/I2PChromium.java
 Missing description for method NEARBY_CHROMIUM_SEARCH_PATHS (Line: 133)
 Missing description for method CHROMIUM_FINDER (Line: 177)
 Missing description for method getOperatingSystem (Line: 189)
 Missing description for method onlyValidChromiums (Line: 211)
 Missing description for method topChromium (Line: 231)
 Missing description for method topChromium (Line: 260)
 Javadoc parameter not found overrideChromium in method: topChromium (Line: 260)
 Missing description for method defaultProcessBuilder (Line: 278)
 Missing description for method privateProcessBuilder (Line: 291)
 Missing description for method processBuilder (Line: 328)
 Javadoc parameter not found args in method: processBuilder (Line: 328)
 Missing description for method waitForProxy (Line: 375)
 Missing description for method waitForProxy (Line: 387)
 Javadoc parameter not found timeout in method: waitForProxy (Line: 387)
 Missing description for method waitForProxy (Line: 399)
 Javadoc parameter not found timeout in method: waitForProxy (Line: 399)
 Javadoc parameter not found port in method: waitForProxy (Line: 399)
 Missing description for method waitForProxy (Line: 412)
 Javadoc parameter not found timeout in method: waitForProxy (Line: 412)
 Javadoc parameter not found port in method: waitForProxy (Line: 412)
 Javadoc parameter not found host in method: waitForProxy (Line: 412)
 Missing description for method checkifPortIsOccupied (Line: 425)
 Javadoc parameter not found port in method: checkifPortIsOccupied (Line: 425)
 Javadoc parameter not found host in method: checkifPortIsOccupied (Line: 425)
 Missing description for method launch (Line: 444)
 Javadoc parameter not found privateWindow in method: launch (Line: 444)
 Missing description for method launch (Line: 488)
 Missing description for method main (Line: 492)
 Javadoc parameter not found args in method: main (Line: 492)
 Missing description for method sleep (Line: 505)
 Javadoc parameter not found millis in method: sleep (Line: 505)
 Javadoc parameter not found args in method: defaultProcessBuilder (Line: 291)
 Missing description for method checkifPortIsOccupied (Line: 459)
 Javadoc parameter not found port in method: checkifPortIsOccupied (Line: 459)
 Javadoc parameter not found host in method: checkifPortIsOccupied (Line: 459)
 Javadoc parameter not found privateWindow in method: launch (Line: 479)
 Javadoc parameter not found url in method: launch (Line: 479)
 Javadoc parameter not found privateWindow in method: launch (Line: 524)
 Missing description for method ValidURL (Line: 539)
 Javadoc parameter not found inUrl in method: ValidURL (Line: 539)
 Missing description for method main (Line: 549)
 Javadoc parameter not found args in method: main (Line: 549)
 Missing description for method sleep (Line: 569)
 Javadoc parameter not found millis in method: sleep (Line: 569)
Javadoc errors for class I2PFirefoxProfileUnpacker
File: src/java/net/i2p/i2pfirefox/I2PFirefoxProfileUnpacker.java
 Missing description for method main (Line: 30)
 Javadoc parameter not found args in method: main (Line: 30)
 Missing description for method unpackProfile (Line: 45)
 Javadoc parameter not found profileDirectory in method: unpackProfile (Line: 45)
Javadoc errors for class I2PChromiumProfileUnpacker
File: src/java/net/i2p/i2pfirefox/I2PChromiumProfileUnpacker.java
 Missing description for method main (Line: 29)
 Javadoc parameter not found args in method: main (Line: 29)
 Missing description for method unpackProfile (Line: 44)
 Javadoc parameter not found profileDirectory in method: unpackProfile (Line: 44)
Javadoc errors for class I2PChromiumProfileBuilder
@ -138,14 +104,8 @@ File: src/java/net/i2p/i2pfirefox/I2PChromiumProfileBuilder.java
 Missing description for member variable strict (Line: )
 Missing description for method profileDir (Line: 33)
 Javadoc parameter not found file in method: profileDir (Line: 33)
 Missing description for method profileDirectory (Line: 43)
 Missing description for method baseProfileDir (Line: 55)
 Javadoc parameter not found file in method: baseProfileDir (Line: 55)
 Missing description for method baseProfileDirectory (Line: 75)
 Missing description for method runtimeDirectory (Line: 99)
 Javadoc parameter not found create in method: runtimeDirectory (Line: 99)
 Missing description for method runtimeDirectory (Line: 116)
 Missing description for method copyBaseProfiletoProfile (Line: 162)
 Missing description for method copyDirectory (Line: 192)
 Javadoc parameter not found sourceDirectory in method: copyDirectory (Line: 192)
 Javadoc parameter not found destinationDirectory in method: copyDirectory (Line: 192)
@ -155,10 +115,6 @@ File: src/java/net/i2p/i2pfirefox/I2PChromiumProfileBuilder.java
 Missing description for method copyFile (Line: 210)
 Javadoc parameter not found sourceFile in method: copyFile (Line: 210)
 Javadoc parameter not found destinationFile in method: copyFile (Line: 210)
 Missing description for method copyStrictOptions (Line: 227)
 Missing description for method  (Line: 264)
 Missing description for method  (Line: 274)
 Javadoc parameter not found strict in method: (Line: 274)
Javadoc errors for class I2PFirefox
File: src/java/net/i2p/i2pfirefox/I2PFirefox.java
@ -166,7 +122,6 @@ File: src/java/net/i2p/i2pfirefox/I2PFirefox.java
 Missing return type for member variable String[] FIREFOX_SEARCH_PATHS (Line: )
 Missing description for member variable int DEFAULT_TIMEOUT (Line: )
 Missing return type for member variable int DEFAULT_TIMEOUT (Line: )
 Missing description for method  (Line: 33)
 Missing description for method FIND_FIREFOX_SEARCH_PATHS_UNIX (Line: 44)
 Missing description for method FIND_FIREFOX_SEARCH_PATHS_OSX (Line: 57)
 Missing description for method FIND_FIREFOX_SEARCH_PATHS_WINDOWS (Line: 70)
@ -175,33 +130,18 @@ File: src/java/net/i2p/i2pfirefox/I2PFirefox.java
 Missing description for method NEARBY_FIREFOX_SEARCH_PATHS (Line: 140)
 Missing description for method FIREFOX_FINDER (Line: 184)
 Missing description for method getOperatingSystem (Line: 196)
 Missing description for method onlyValidFirefoxes (Line: 218)
 Missing description for method topFirefox (Line: 238)
 Missing description for method topFirefox (Line: 267)
 Javadoc parameter not found overrideFirefox in method: topFirefox (Line: 267)
 Missing description for method defaultProcessBuilder (Line: 285)
 Missing description for method privateProcessBuilder (Line: 299)
 Missing description for method processBuilder (Line: 313)
 Javadoc parameter not found args in method: processBuilder (Line: 313)
 Missing description for method waitForProxy (Line: 339)
 Missing description for method waitForProxy (Line: 351)
 Javadoc parameter not found timeout in method: waitForProxy (Line: 351)
 Missing description for method waitForProxy (Line: 363)
 Javadoc parameter not found timeout in method: waitForProxy (Line: 363)
 Javadoc parameter not found port in method: waitForProxy (Line: 363)
 Missing description for method waitForProxy (Line: 376)
 Javadoc parameter not found timeout in method: waitForProxy (Line: 376)
 Javadoc parameter not found port in method: waitForProxy (Line: 376)
 Javadoc parameter not found host in method: waitForProxy (Line: 376)
 Missing description for method checkifPortIsOccupied (Line: 389)
 Javadoc parameter not found port in method: checkifPortIsOccupied (Line: 389)
 Javadoc parameter not found host in method: checkifPortIsOccupied (Line: 389)
 Missing description for method launch (Line: 408)
 Javadoc parameter not found privateWindow in method: launch (Line: 408)
 Missing description for method launch (Line: 454)
 Missing description for method main (Line: 458)
 Javadoc parameter not found args in method: main (Line: 458)
 Missing description for method sleep (Line: 472)
 Javadoc parameter not found millis in method: sleep (Line: 472)
 Missing description for method checkifPortIsOccupied (Line: 422)
 Javadoc parameter not found port in method: checkifPortIsOccupied (Line: 422)
 Javadoc parameter not found host in method: checkifPortIsOccupied (Line: 422)
 Javadoc parameter not found privateWindow in method: launch (Line: 441)
 Javadoc parameter not found url in method: launch (Line: 441)
 Javadoc parameter not found privateWindow in method: launch (Line: 487)
 Missing description for method ValidURL (Line: 503)
 Javadoc parameter not found inUrl in method: ValidURL (Line: 503)
 Missing description for method main (Line: 514)
 Javadoc parameter not found args in method: main (Line: 514)
 Missing description for method sleep (Line: 535)
 Javadoc parameter not found millis in method: sleep (Line: 535)

View File

@ -1,7 +1,8 @@
package net.i2p.i2pfirefox;
import java.util.ArrayList;
/*
/**
* I2PBrowser.java
* Copyright (C) 2022 idk <hankhill19580@gmail.com>
* This program is free software: you can redistribute it and/or modify
@ -26,16 +27,24 @@ public class I2PBrowser {
public boolean chromium = false;
public boolean chromiumFirst = false;
private void launchFirefox(boolean privateWindow, String[] url) {
System.out.println("I2PFirefox");
i2pFirefox.launch(privateWindow, url);
}
private void launchFirefox(boolean privateWindow) {
System.out.println("I2PFirefox");
i2pFirefox.launch(privateWindow);
}
private void launchChromium(boolean privateWindow, String[] url) {
System.out.println("I2PChromium");
i2pChromium.launch(privateWindow, url);
}
private void launchChromium(boolean privateWindow) {
System.out.println("I2PChromium");
i2pChromium.launch(privateWindow);
}
/*
/**
* Construct an I2PBrowser class which automatically determines which browser to use.
*
* @since 0.0.16
@ -43,7 +52,7 @@ public class I2PBrowser {
public I2PBrowser() {
}
/*
/**
* Return true if there is a Chromium available
*
* @return true if Chromium is available, false otherwise
@ -60,7 +69,7 @@ public class I2PBrowser {
return true;
}
/*
/**
* Return true if there is a Firefox variant available
*
* @return true if Firefox variant is available, false otherwise
@ -77,7 +86,40 @@ public class I2PBrowser {
return true;
}
/*
/**
* Populates a profile directory with a proxy configuration.
* Waits for an HTTP proxy on the port 4444 to be ready.
* Launches either Firefox or Chromium with the profile directory.
*
* @param bool if true, the profile will be ephemeral(i.e. a --private-window profile).
* @since 0.0.17
*/
public void launch(boolean privateWindow, String[] url){
if ((chromium && firefox) || (!chromium && !firefox)) {
if (this.hasFirefox()) {
this.launchFirefox(privateWindow, url);
} else if (this.hasChromium()) {
this.launchChromium(privateWindow, url);
}
return;
}
if (chromiumFirst){
if (chromium) {
this.launchChromium(privateWindow, url);
}else if (firefox) {
this.launchFirefox(privateWindow, url);
}
return;
}
if (firefox) {
this.launchFirefox(privateWindow, url);
}else if (chromium) {
this.launchChromium(privateWindow, url);
}
return;
}
/**
* Populates a profile directory with a proxy configuration.
* Waits for an HTTP proxy on the port 4444 to be ready.
* Launches either Firefox or Chromium with the profile directory.
@ -86,31 +128,10 @@ public class I2PBrowser {
* @since 0.0.16
*/
public void launch(boolean privateWindow){
if ((chromium && firefox) || (!chromium && !firefox)) {
if (this.hasFirefox()) {
this.launchFirefox(privateWindow);
} else if (this.hasChromium()) {
this.launchChromium(privateWindow);
}
return;
}
if (chromiumFirst){
if (chromium) {
this.launchChromium(privateWindow);
}else if (firefox) {
this.launchFirefox(privateWindow);
}
return;
}
if (firefox) {
this.launchFirefox(privateWindow);
}else if (chromium) {
this.launchChromium(privateWindow);
}
return;
launch(privateWindow, null);
}
/*
/**
* Populates a profile directory with a proxy configuration.
* Waits for an HTTP proxy on the port 4444 to be ready.
* Launches either Firefox or Chromium with the profile directory.
@ -119,12 +140,23 @@ public class I2PBrowser {
*/
public void launch(){
launch(false);
}
}
private static String ValidURL(String inUrl){
String[] schemes = {"http", "https"};
for (String scheme: schemes) {
if (inUrl.startsWith(scheme)) {
return inUrl;
}
}
return "";
}
public static void main(String[] args) {
boolean privateBrowsing = false;
System.out.println("I2PBrowser");
I2PBrowser i2pBrowser = new I2PBrowser();
ArrayList<String> visitURL = new ArrayList<String>();
if (args != null && args.length > 0) {
for (String arg : args) {
if (arg.equals("-private")) {
@ -136,9 +168,12 @@ public class I2PBrowser {
if (arg.equals("-firefox")) {
i2pBrowser.firefox = true;
}
if (!arg.startsWith("-")){
visitURL.add(ValidURL(arg));
}
}
}
i2pBrowser.launch(privateBrowsing);
i2pBrowser.launch(privateBrowsing, visitURL.toArray(new String[visitURL.size()]));
}
}

View File

@ -5,7 +5,7 @@ import java.io.IOException;
import java.net.Socket;
import java.util.ArrayList;
/*
/**
* I2PChromium.java
* Copyright (C) 2022 idk <hankhill19580@gmail.com>
* This program is free software: you can redistribute it and/or modify
@ -23,7 +23,7 @@ public class I2PChromium {
private final String[] CHROMIUM_SEARCH_PATHS = CHROMIUM_FINDER();
private final int DEFAULT_TIMEOUT = 200;
/*
/**
* Construct an I2PChromium class which manages an instance of Chromium and
* an accompanying Chromium profile. This version includes Chromium variants
* and forks.
@ -200,7 +200,7 @@ public class I2PChromium {
return "Unknown";
}
/*
/**
* Check our list of chrome paths for a valid chrome binary.
* Just an existence check for now, but should check versions
* in the future.
@ -222,7 +222,7 @@ public class I2PChromium {
return validChromiums.toArray(new String[validChromiums.size()]);
}
/*
/**
* Return the best available Chromium from the list of Chromiums we have.
*
* @return the path to the best available Chromium, or null if none are found.
@ -248,7 +248,7 @@ public class I2PChromium {
}
}
/*
/**
* Return the best available Chromium from the list of Chromiums we have.
* if override is passed it will be validated and if it validates, it will
* be used.
@ -267,7 +267,7 @@ public class I2PChromium {
return topChromium();
}
/*
/**
* Build a ProcessBuilder for the top Chromium binary and
* the default profile.
*
@ -279,11 +279,24 @@ public class I2PChromium {
return processBuilder(new String[]{});
}
/*
/**
* Build a ProcessBuilder for the top Chromium binary and
* the default profile.
*
* @args the arguments to pass to the Chromium binary
* @return a ProcessBuilder for the top Chromium binary and
* the default profile.
* @since 0.0.1
*/
public ProcessBuilder defaultProcessBuilder(String[] args) {
return processBuilder(args);
}
/**
* 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
@ -292,7 +305,28 @@ public class I2PChromium {
return processBuilder(new String[]{"--incognito"});
}
/*
/**
* 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(String[] args) {
//return processBuilder(new String[]{});
ArrayList<String> argList = new ArrayList<String>();
argList.add("--incognito");
if (args != null && args.length > 0) {
for (String arg : args) {
argList.add(arg);
}
}
return processBuilder(argList.toArray(new String[argList.size()]));
}
/**
1 --user-data-dir="$CHROMIUM_I2P" \
2 --proxy-server="http://127.0.0.1:4444" \
3 --proxy-bypass-list=127.0.0.1:7657 \
@ -315,7 +349,7 @@ public class I2PChromium {
20 --disable-file-system \
*/
/*
/**
* Build a ProcessBuilder for the top Chromium binary and
* the default profile, with a specific set of extended
* arguments.
@ -349,7 +383,7 @@ public class I2PChromium {
newArgs[17] = "--disable-d3d11";
newArgs[18] = "--disable-file-system";
newArgs[19] = "--load-extension="+new File(I2PChromiumProfileBuilder.profileDirectory(),"extensions/i2pchrome.js").getAbsolutePath();
/*+","+
/**+","+
new File(I2PChromiumProfileBuilder.profileDirectory(),"extensions/ublock.js").getAbsolutePath()
+","+
new File(I2PChromiumProfileBuilder.profileDirectory(),"extensions/scriptsafe.js").getAbsolutePath();*/
@ -365,7 +399,7 @@ public class I2PChromium {
}
}
/*
/**
* Waits for an HTTP proxy on port 4444 to be ready.
* Returns false on timeout of 200 seconds.
*
@ -376,7 +410,7 @@ public class I2PChromium {
return waitForProxy(DEFAULT_TIMEOUT);
}
/*
/**
* Waits for an HTTP proxy on port 4444 to be ready.
* Returns false on timeout of the specified number of seconds.
*
@ -387,7 +421,7 @@ public class I2PChromium {
public boolean waitForProxy(int timeout) {
return waitForProxy(timeout, 4444);
}
/*
/**
* Waits for an HTTP proxy on the specified port to be ready.
* Returns false on timeout of the specified number of seconds.
*
@ -399,7 +433,7 @@ public class I2PChromium {
public boolean waitForProxy(int timeout, int port) {
return waitForProxy(timeout, port, "localhost");
}
/*
/**
* Waits for an HTTP proxy on the specified port to be ready.
* Returns false on timeout of the specified number of seconds.
*
@ -433,15 +467,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.
*
* @param bool if true, the profile will be ephemeral(i.e. a --private-window profile).
* @since 0.0.1
* @param String[] a list of URL's to pass to the browser window
* @since 0.0.17
*/
public void launch(boolean privateWindow){
public void launch(boolean privateWindow, String[] url){
String profileDirectory = I2PChromiumProfileBuilder.profileDirectory();
if (I2PChromiumProfileChecker.validateProfileDirectory(profileDirectory)) {
System.out.println("Valid profile directory: "+profileDirectory);
@ -457,9 +492,9 @@ public class I2PChromium {
if (waitForProxy()){
ProcessBuilder pb = null;
if (privateWindow) {
pb = this.privateProcessBuilder();
pb = this.privateProcessBuilder(url);
} else {
pb = this.defaultProcessBuilder();
pb = this.defaultProcessBuilder(url);
}
try{
System.out.println(pb.command());
@ -478,7 +513,19 @@ 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.
*
* @param bool if true, the profile will be ephemeral(i.e. a --private-window profile).
* @since 0.0.1
*/
public void launch(boolean privateWindow){
launch(privateWindow, null);
}
/**
* 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.
@ -487,20 +534,37 @@ public class I2PChromium {
*/
public void launch(){
launch(false);
}
}
private static String ValidURL(String inUrl){
String[] schemes = {"http", "https"};
for (String scheme: schemes) {
if (inUrl.startsWith(scheme)) {
return inUrl;
}
}
return "";
}
public static void main(String[] args) {
boolean privateBrowsing = false;
System.out.println("checking for private browsing");
ArrayList<String> visitURL = new ArrayList<String>();
if (args != null && args.length > 0) {
System.out.println("checking for private browsing");
if (args[0].equals("-private")) {
privateBrowsing = true;
System.out.println("private browsing is true, profile will be discarded at end of session");
for (String arg : args) {
if (arg.equals("-private")) {
privateBrowsing = true;
System.out.println("private browsing is true, profile will be discarded at end of session");
}
if (!arg.startsWith("-")){
// check if it's a URL
visitURL.add(ValidURL(arg));
}
}
}
System.out.println("I2PChromium");
I2PChromium i2pChromium = new I2PChromium();
i2pChromium.launch(privateBrowsing);
i2pChromium.launch(privateBrowsing, visitURL.toArray(new String[visitURL.size()]));
}
private static void sleep(int millis) {
try {

View File

@ -9,7 +9,7 @@ import java.io.OutputStream;
import java.nio.file.Files;
import java.nio.file.StandardCopyOption;
/*
/**
* I2PChromiumProfileBuilder.java
* Copyright (C) 2022 idk <hankhill19580@gmail.com>
* This program is free software: you can redistribute it and/or modify
@ -35,7 +35,7 @@ public class I2PChromiumProfileBuilder {
return profileDir.getAbsolutePath();
}
/*
/**
* get the profile directory, creating it if necessary
*
* @return the profile directory, or null if it could not be created
@ -67,7 +67,7 @@ public class I2PChromiumProfileBuilder {
}
}
/*
/**
* get the base profile directory, creating it if necessary
*
* @return the base profile directory, or null if it could not be created
@ -89,7 +89,7 @@ public class I2PChromiumProfileBuilder {
return baseProfileDir(rtd);
}
/*
/**
* get the runtime directory, creating it if create=true
*
* @param create if true, create the runtime directory if it does not exist
@ -107,7 +107,7 @@ public class I2PChromiumProfileBuilder {
return new File(rtd);
}
/*
/**
* get the correct runtime directory
*
* @return the runtime directory, or null if it could not be created or found
@ -154,7 +154,7 @@ public class I2PChromiumProfileBuilder {
return "";
}
/*
/**
* Copy the inert base profile directory to the runtime profile directory
*
* @since 0.0.1
@ -218,7 +218,7 @@ public class I2PChromiumProfileBuilder {
}
}
/*
/**
* Copy the strict options from the base profile to the profile
*
* @return true if successful, false otherwise
@ -256,7 +256,7 @@ public class I2PChromiumProfileBuilder {
return true;
}
/*
/**
* Construct a new Profile Builder
*
* @since 0.0.1
@ -265,7 +265,7 @@ public class I2PChromiumProfileBuilder {
I2PChromiumProfileBuilder.strict = false;
}
/*
/**
* Construct a new Profile Builder
* @param strict if true, the strict overrides will be copied to the profile
*

View File

@ -2,7 +2,7 @@ package net.i2p.i2pfirefox;
import java.io.File;
/*
/**
* I2PChromiumProfileChecker.java
* Copyright (C) 2022 idk <hankhill19580@gmail.com>
* This program is free software: you can redistribute it and/or modify
@ -19,7 +19,7 @@ import java.io.File;
* @since 0.0.1
*/
public class I2PChromiumProfileChecker {
/*
/**
* Output feedback if the profile directory is valid or invalid
*
* @description Output feedback if the profile directory is valid or invalid
@ -39,7 +39,7 @@ public class I2PChromiumProfileChecker {
System.out.println("Profile directory is invalid");
}
}
/*
/**
* Return true if the profile directory is valid.
*
* @param profileDirectory the profile directory to check
@ -70,7 +70,7 @@ public class I2PChromiumProfileChecker {
}
return true;
}
/*
/**
* Return true if the extension directory is valid.
*
* @param extensionDirectory the extension directory to check
@ -97,7 +97,7 @@ public class I2PChromiumProfileChecker {
}
return true;
}
/*
/**
* Return true if the extension directory is valid.
*
* @param extensionDirectory the extension directory to check

View File

@ -7,7 +7,7 @@ import java.nio.file.StandardCopyOption;
import java.util.zip.ZipEntry;
import java.util.zip.ZipInputStream;
/*
/**
* I2PChromiumProfileUnpacker.java
* Copyright (C) 2022 idk <hankhill19580@gmail.com>
* This program is free software: you can redistribute it and/or modify
@ -35,7 +35,7 @@ public class I2PChromiumProfileUnpacker {
}
/*
/**
* unpack the profile directory
*
* @return true if the profile directory was successfully unpacked

View File

@ -5,7 +5,7 @@ import java.io.IOException;
import java.net.Socket;
import java.util.ArrayList;
/*
/**
* I2PFirefox.java
* Copyright (C) 2022 idk <hankhill19580@gmail.com>
* This program is free software: you can redistribute it and/or modify
@ -23,7 +23,7 @@ public class I2PFirefox {
private final String[] FIREFOX_SEARCH_PATHS = FIREFOX_FINDER();
private final int DEFAULT_TIMEOUT = 200;
/*
/**
* Construct an I2PFirefox class which manages an instance of Firefox and
* an accompanying Firefox profile. This version includes Firefox variants
* and forks.
@ -207,7 +207,7 @@ public class I2PFirefox {
return "Unknown";
}
/*
/**
* Check our list of firefox paths for a valid firefox binary.
* Just an existence check for now, but should check versions
* in the future.
@ -229,7 +229,7 @@ public class I2PFirefox {
return validFirefoxes.toArray(new String[validFirefoxes.size()]);
}
/*
/**
* Return the best available Firefox from the list of Firefoxes we have.
*
* @return the path to the best available Firefox, or null if none are found.
@ -255,7 +255,7 @@ public class I2PFirefox {
}
}
/*
/**
* Return the best available Firefox from the list of Firefoxes we have.
* if override is passed it will be validated and if it validates, it will
* be used.
@ -274,7 +274,7 @@ public class I2PFirefox {
return topFirefox();
}
/*
/**
* Build a ProcessBuilder for the top Firefox binary and
* the default profile.
*
@ -286,7 +286,19 @@ public class I2PFirefox {
return processBuilder(new String[]{});
}
/*
/**
* * Build a ProcessBuilder for the top Firefox binary and
* the default profile.
*
* @param args the args to pass to the Firefox binary
* @return a ProcessBuilder for the top Firefox binary and
* the default profile.
*/
public ProcessBuilder defaultProcessBuilder(String[] args) {
return processBuilder(args);
}
/**
* Build a ProcessBuilder for the top Firefox binary and
* the default profile. Pass the --private-window flag to
* open a private window.
@ -300,7 +312,28 @@ public class I2PFirefox {
return processBuilder(new String[]{"--private-window"});
}
/*
/**
* * 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.
*/
public ProcessBuilder privateProcessBuilder(String[] args) {
ArrayList<String> argList = new ArrayList<String>();
argList.add("--private-window");
if (args != null && args.length > 0) {
for (String arg : args) {
argList.add(arg);
}
}
return processBuilder(argList.toArray(new String[argList.size()]));
}
/**
* Build a ProcessBuilder for the top Firefox binary and
* the default profile, with a specific set of extended
* arguments.
@ -317,7 +350,7 @@ public class I2PFirefox {
newArgs[0] = firefox;
newArgs[1] = "--profile";
newArgs[2] = I2PFirefoxProfileBuilder.profileDirectory();
if (args.length > 0) {
if (args != null && args.length > 0) {
for (int i = 0; i < args.length; i++) {
newArgs[i+3] = args[i];
}
@ -329,7 +362,7 @@ public class I2PFirefox {
}
}
/*
/**
* Waits for an HTTP proxy on port 4444 to be ready.
* Returns false on timeout of 200 seconds.
*
@ -340,7 +373,7 @@ public class I2PFirefox {
return waitForProxy(DEFAULT_TIMEOUT);
}
/*
/**
* Waits for an HTTP proxy on port 4444 to be ready.
* Returns false on timeout of the specified number of seconds.
*
@ -351,7 +384,7 @@ public class I2PFirefox {
public boolean waitForProxy(int timeout) {
return waitForProxy(timeout, 4444);
}
/*
/**
* Waits for an HTTP proxy on the specified port to be ready.
* Returns false on timeout of the specified number of seconds.
*
@ -363,7 +396,7 @@ public class I2PFirefox {
public boolean waitForProxy(int timeout, int port) {
return waitForProxy(timeout, port, "localhost");
}
/*
/**
* Waits for an HTTP proxy on the specified port to be ready.
* Returns false on timeout of the specified number of seconds.
*
@ -396,16 +429,16 @@ 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.
*
* @param bool if true, the profile will be ephemeral(i.e. a --private-window profile).
* @since 0.0.1
* @param String[] a list of URL's to pass to the browser window
* @since 0.0.17
*/
public void launch(boolean privateWindow){
public void launch(boolean privateWindow, String[] url){
String profileDirectory = I2PFirefoxProfileBuilder.profileDirectory();
if (I2PFirefoxProfileChecker.validateProfileDirectory(profileDirectory)) {
System.out.println("Valid profile directory: "+profileDirectory);
@ -421,9 +454,9 @@ public class I2PFirefox {
if (waitForProxy()){
ProcessBuilder pb;
if (privateWindow) {
pb = privateProcessBuilder();
pb = privateProcessBuilder(url);
} else {
pb = defaultProcessBuilder();
pb = defaultProcessBuilder(url);
}
try{
System.out.println(pb.command());
@ -443,7 +476,19 @@ 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.
*
* @param bool if true, the profile will be ephemeral(i.e. a --private-window profile).
* @since 0.0.1
*/
public void launch(boolean privateWindow){
launch(privateWindow, null);
}
/**
* 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
@ -455,18 +500,36 @@ public class I2PFirefox {
launch(false);
}
private static String ValidURL(String inUrl){
String[] schemes = {"http", "https"};
for (String scheme: schemes) {
if (inUrl.startsWith(scheme)) {
System.out.println("Valid URL: " + inUrl);
return inUrl;
}
}
return "";
}
public static void main(String[] args) {
boolean privateBrowsing = false;
System.out.println("checking for private browsing");
ArrayList<String> visitURL = new ArrayList<String>();
if (args != null && args.length > 0) {
System.out.println("checking for private browsing");
if (args[0].equals("-private")) {
privateBrowsing = true;
System.out.println("private browsing is true, profile will be discarded at end of session");
for (String arg : args) {
if (arg.equals("-private")) {
privateBrowsing = true;
System.out.println("private browsing is true, profile will be discarded at end of session");
}
if (!arg.startsWith("-")){
// check if it's a URL
visitURL.add(ValidURL(arg));
}
}
}
System.out.println("I2PFirefox");
I2PFirefox i2pFirefox = new I2PFirefox();
i2pFirefox.launch(privateBrowsing);
i2pFirefox.launch(privateBrowsing, visitURL.toArray(new String[visitURL.size()]));
}
private static void sleep(int millis) {

View File

@ -9,7 +9,7 @@ import java.io.OutputStream;
import java.nio.file.Files;
import java.nio.file.StandardCopyOption;
/*
/**
* I2PFirefoxProfileBuilder.java
* Copyright (C) 2022 idk <hankhill19580@gmail.com>
* This program is free software: you can redistribute it and/or modify
@ -35,7 +35,7 @@ public class I2PFirefoxProfileBuilder {
return profileDir.getAbsolutePath();
}
/*
/**
* get the profile directory, creating it if necessary
*
* @return the profile directory, or null if it could not be created
@ -67,7 +67,7 @@ public class I2PFirefoxProfileBuilder {
}
}
/*
/**
* get the base profile directory, creating it if necessary
*
* @return the base profile directory, or null if it could not be created
@ -89,7 +89,7 @@ public class I2PFirefoxProfileBuilder {
return baseProfileDir(rtd);
}
/*
/**
* get the runtime directory, creating it if create=true
*
* @param create if true, create the runtime directory if it does not exist
@ -107,7 +107,7 @@ public class I2PFirefoxProfileBuilder {
return new File(rtd);
}
/*
/**
* get the correct runtime directory
*
* @return the runtime directory, or null if it could not be created or found
@ -154,7 +154,7 @@ public class I2PFirefoxProfileBuilder {
return "";
}
/*
/**
* Copy the inert base profile directory to the runtime profile directory
*
* @since 0.0.1
@ -218,7 +218,7 @@ public class I2PFirefoxProfileBuilder {
}
}
/*
/**
* Copy the strict options from the base profile to the profile
*
* @return true if successful, false otherwise
@ -256,7 +256,7 @@ public class I2PFirefoxProfileBuilder {
return true;
}
/*
/**
* Construct a new Profile Builder
*
* @since 0.0.1
@ -265,7 +265,7 @@ public class I2PFirefoxProfileBuilder {
I2PFirefoxProfileBuilder.strict = false;
}
/*
/**
* Construct a new Profile Builder
* @param strict if true, the strict overrides will be copied to the profile
*

View File

@ -2,7 +2,7 @@ package net.i2p.i2pfirefox;
import java.io.File;
/*
/**
* I2PFirefoxProfileChecker.java
* Copyright (C) 2022 idk <hankhill19580@gmail.com>
* This program is free software: you can redistribute it and/or modify
@ -33,7 +33,7 @@ public class I2PFirefoxProfileChecker {
System.out.println("Profile directory is invalid");
}
}
/*
/**
* Return true if the profile directory is valid.
*
* @param profileDirectory the profile directory to check
@ -72,7 +72,7 @@ public class I2PFirefoxProfileChecker {
}
return true;
}
/*
/**
* Return true if the file is valid.
*
* @param file the file to check
@ -99,7 +99,7 @@ public class I2PFirefoxProfileChecker {
}
return true;
}
/*
/**
* Return true if the extension directory is valid.
*
* @param extensionDirectory the extension directory to check

View File

@ -7,7 +7,7 @@ import java.nio.file.StandardCopyOption;
import java.util.zip.ZipEntry;
import java.util.zip.ZipInputStream;
/*
/**
* I2PFirefoxProfileUnpacker.java
* Copyright (C) 2022 idk <hankhill19580@gmail.com>
* This program is free software: you can redistribute it and/or modify
@ -36,7 +36,7 @@ public class I2PFirefoxProfileUnpacker {
}
/*
/**
* unpack the profile directory
*
* @return true if the profile directory was successfully unpacked

View File

@ -1,5 +0,0 @@
#! /usr/bin/env sh
ant distclean
ant jar
java -cp ./src/build/i2pfirefox.jar net.i2p.i2pfirefox.I2PBrowser -private -chromium

35
test.sh
View File

@ -1,8 +1,33 @@
#! /usr/bin/env sh
GITHUB_USER=eyedeekay
GITHUB_REPO=i2p.plugins.firefox
ant distclean
cd src && \
ant && cd ../
./i2pbrowser.cmd
ant jar
echo "Testing auto-selector with no private and no URL parameters."
java -cp ./src/build/i2pfirefox.jar net.i2p.i2pfirefox.I2PBrowser
echo "Testing auto-selector with local URL parameter."
java -cp ./src/build/i2pfirefox.jar net.i2p.i2pfirefox.I2PBrowser "http://127.0.0.1:7657"
echo "Testing auto-selector with remote URL parameter."
java -cp ./src/build/i2pfirefox.jar net.i2p.i2pfirefox.I2PBrowser "http://idk.i2p"
echo "Testing auto-selector with private browsing parameter"
java -cp ./src/build/i2pfirefox.jar net.i2p.i2pfirefox.I2PBrowser -private "http://127.0.0.1:7657"
echo "Testing Chromium with no private and no URL parameters."
java -cp ./src/build/i2pfirefox.jar net.i2p.i2pfirefox.I2PBrowser -chromium
echo "Testing Chromium with local URL parameter."
java -cp ./src/build/i2pfirefox.jar net.i2p.i2pfirefox.I2PBrowser -chromium "http://127.0.0.1:7657"
echo "Testing Chromium with remote URL parameter."
java -cp ./src/build/i2pfirefox.jar net.i2p.i2pfirefox.I2PBrowser -chromium "http://idk.i2p"
echo "Testing Chromium with private browsing parameter"
java -cp ./src/build/i2pfirefox.jar net.i2p.i2pfirefox.I2PBrowser -chromium -private "http://127.0.0.1:7657"
echo "Testing Firefox with no private and no URL parameters."
java -cp ./src/build/i2pfirefox.jar net.i2p.i2pfirefox.I2PBrowser -firefox
echo "Testing Firefox with local URL parameter."
java -cp ./src/build/i2pfirefox.jar net.i2p.i2pfirefox.I2PBrowser -firefox "http://127.0.0.1:7657"
echo "Testing Firefox with remote URL parameter."
java -cp ./src/build/i2pfirefox.jar net.i2p.i2pfirefox.I2PBrowser -firefox "http://idk.i2p"
echo "Testing Firefox with private browsing parameter"
java -cp ./src/build/i2pfirefox.jar net.i2p.i2pfirefox.I2PBrowser -firefox -private "http://127.0.0.1:7657"