add URL-passing option
Former-commit-id: ce8ec78beb
Former-commit-id: 1352be01aeb6ad0c7c2539f6354505c5b4c8a8cf
This commit is contained in:
@ -3,6 +3,10 @@
|
|||||||
> */
|
> */
|
||||||
|
|
||||||
Access: public
|
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
|
package: net.i2p.i2pfirefox
|
||||||
|
|
||||||
## Dependencies
|
## Dependencies
|
||||||
@ -12,6 +16,7 @@ package: net.i2p.i2pfirefox
|
|||||||
Show dependencies
|
Show dependencies
|
||||||
</summary>
|
</summary>
|
||||||
<ul>
|
<ul>
|
||||||
|
<li>java.util.ArrayList</li>
|
||||||
</ul>
|
</ul>
|
||||||
</details>
|
</details>
|
||||||
|
|
||||||
@ -51,7 +56,19 @@ package: net.i2p.i2pfirefox
|
|||||||
|
|
||||||
## Methods
|
## 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:
|
+ Description:
|
||||||
+ Access: private
|
+ Access: private
|
||||||
@ -62,7 +79,19 @@ package: net.i2p.i2pfirefox
|
|||||||
| privateWindow | boolean | |
|
| 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:
|
+ Description:
|
||||||
+ Access: private
|
+ Access: private
|
||||||
@ -73,27 +102,39 @@ package: net.i2p.i2pfirefox
|
|||||||
| privateWindow | boolean | |
|
| 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
|
+ Access: public
|
||||||
+ return: boolean
|
+ return: true if Chromium is available false otherwise
|
||||||
|
|
||||||
This method has no parameters.
|
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
|
+ Access: public
|
||||||
+ return: boolean
|
+ return: true if Firefox variant is available false otherwise
|
||||||
|
|
||||||
This method has no parameters.
|
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
|
+ Access: public
|
||||||
+ return: void
|
+ return: void
|
||||||
|
|
||||||
@ -102,16 +143,28 @@ This method has no parameters.
|
|||||||
| privateWindow | boolean | |
|
| 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
|
+ Access: public
|
||||||
+ return: void
|
+ return: void
|
||||||
|
|
||||||
This method has no parameters.
|
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:
|
+ Description:
|
||||||
+ Access: public
|
+ Access: public
|
||||||
|
140
I2PChromium.md
140
I2PChromium.md
@ -3,6 +3,10 @@
|
|||||||
> */
|
> */
|
||||||
|
|
||||||
Access: public
|
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
|
package: net.i2p.i2pfirefox
|
||||||
|
|
||||||
## Dependencies
|
## Dependencies
|
||||||
@ -119,27 +123,27 @@ This method has no parameters.
|
|||||||
|
|
||||||
### onlyValidChromiums [[src]](src/java/net/i2p/i2pfirefox/I2PChromium.java#L211)
|
### 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
|
+ Access: public
|
||||||
+ return: String[]
|
+ return: a list of usable Chromiums or an empty list if none are found.
|
||||||
|
|
||||||
This method has no parameters.
|
This method has no parameters.
|
||||||
|
|
||||||
|
|
||||||
### topChromium [[src]](src/java/net/i2p/i2pfirefox/I2PChromium.java#L231)
|
### 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
|
+ Access: public
|
||||||
+ return: String
|
+ return: the path to the best available Chromium or null if none are found.
|
||||||
|
|
||||||
This method has no parameters.
|
This method has no parameters.
|
||||||
|
|
||||||
|
|
||||||
### topChromium [[src]](src/java/net/i2p/i2pfirefox/I2PChromium.java#L260)
|
### 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
|
+ Access: public
|
||||||
+ return: String
|
+ return: the path to the best available Chromium or null if none are found.
|
||||||
|
|
||||||
| Name | Type | Description |
|
| Name | Type | Description |
|
||||||
| ----- | ----- | ----- |
|
| ----- | ----- | ----- |
|
||||||
@ -148,79 +152,101 @@ This method has no parameters.
|
|||||||
|
|
||||||
### defaultProcessBuilder [[src]](src/java/net/i2p/i2pfirefox/I2PChromium.java#L278)
|
### 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
|
+ Access: public
|
||||||
+ return: ProcessBuilder
|
+ return: a ProcessBuilder for the top Chromium binary and the default profile.
|
||||||
|
|
||||||
This method has no parameters.
|
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
|
+ Access: public
|
||||||
+ return: ProcessBuilder
|
+ return: a ProcessBuilder for the top Chromium binary and the default profile.
|
||||||
|
|
||||||
This method has no parameters.
|
|
||||||
|
|
||||||
|
|
||||||
### processBuilder [[src]](src/java/net/i2p/i2pfirefox/I2PChromium.java#L328)
|
|
||||||
|
|
||||||
+ Description:
|
|
||||||
+ Access: public
|
|
||||||
+ return: ProcessBuilder
|
|
||||||
|
|
||||||
| Name | Type | Description |
|
| Name | Type | Description |
|
||||||
| ----- | ----- | ----- |
|
| ----- | ----- | ----- |
|
||||||
| args | String[] | |
|
| 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
|
+ 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.
|
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
|
+ Access: public
|
||||||
+ return: boolean
|
+ return: a ProcessBuilder for the top Chromium binary and the default profile. Always passes the --incognito flag.
|
||||||
|
|
||||||
| Name | Type | Description |
|
| 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
|
+ 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 |
|
| Name | Type | Description |
|
||||||
| ----- | ----- | ----- |
|
| ----- | ----- | ----- |
|
||||||
| timeout | int | |
|
| args | String[] | the extended arguments to pass to the Chromium binary. |
|
||||||
| port | int | |
|
|
||||||
|
|
||||||
|
|
||||||
### 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
|
+ 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 |
|
| Name | Type | Description |
|
||||||
| ----- | ----- | ----- |
|
| ----- | ----- | ----- |
|
||||||
| timeout | int | |
|
| timeout | int | the number of seconds to wait for the proxy to be ready. |
|
||||||
| port | int | |
|
|
||||||
| host | String | |
|
|
||||||
|
|
||||||
|
|
||||||
### 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:
|
+ Description:
|
||||||
+ Access: private
|
+ Access: private
|
||||||
@ -232,9 +258,21 @@ This method has no parameters.
|
|||||||
| host | String | |
|
| 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
|
+ Access: public
|
||||||
+ return: void
|
+ return: void
|
||||||
|
|
||||||
@ -243,16 +281,28 @@ This method has no parameters.
|
|||||||
| privateWindow | boolean | |
|
| 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
|
+ Access: public
|
||||||
+ return: void
|
+ return: void
|
||||||
|
|
||||||
This method has no parameters.
|
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:
|
+ Description:
|
||||||
+ Access: public
|
+ Access: public
|
||||||
@ -264,7 +314,7 @@ This method has no parameters.
|
|||||||
| args | String[] | |
|
| args | String[] | |
|
||||||
|
|
||||||
|
|
||||||
### sleep [[src]](src/java/net/i2p/i2pfirefox/I2PChromium.java#L505)
|
### sleep [[src]](src/java/net/i2p/i2pfirefox/I2PChromium.java#L569)
|
||||||
|
|
||||||
+ Description:
|
+ Description:
|
||||||
+ Access: private
|
+ Access: private
|
||||||
|
@ -3,6 +3,10 @@
|
|||||||
> */
|
> */
|
||||||
|
|
||||||
Access: public
|
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
|
package: net.i2p.i2pfirefox
|
||||||
|
|
||||||
## Dependencies
|
## Dependencies
|
||||||
@ -48,7 +52,7 @@ package: net.i2p.i2pfirefox
|
|||||||
|
|
||||||
### profileDirectory [[src]](src/java/net/i2p/i2pfirefox/I2PChromiumProfileBuilder.java#L43)
|
### profileDirectory [[src]](src/java/net/i2p/i2pfirefox/I2PChromiumProfileBuilder.java#L43)
|
||||||
|
|
||||||
+ Description:
|
+ Description: get the profile directory creating it if necessary
|
||||||
+ Access: public
|
+ Access: public
|
||||||
+ Modifiers: static
|
+ Modifiers: static
|
||||||
+ return: String
|
+ return: String
|
||||||
@ -70,7 +74,7 @@ This method has no parameters.
|
|||||||
|
|
||||||
### baseProfileDirectory [[src]](src/java/net/i2p/i2pfirefox/I2PChromiumProfileBuilder.java#L75)
|
### baseProfileDirectory [[src]](src/java/net/i2p/i2pfirefox/I2PChromiumProfileBuilder.java#L75)
|
||||||
|
|
||||||
+ Description:
|
+ Description: get the base profile directory creating it if necessary
|
||||||
+ Access: public
|
+ Access: public
|
||||||
+ Modifiers: static
|
+ Modifiers: static
|
||||||
+ return: String
|
+ return: String
|
||||||
@ -80,29 +84,29 @@ This method has no parameters.
|
|||||||
|
|
||||||
### runtimeDirectory [[src]](src/java/net/i2p/i2pfirefox/I2PChromiumProfileBuilder.java#L99)
|
### runtimeDirectory [[src]](src/java/net/i2p/i2pfirefox/I2PChromiumProfileBuilder.java#L99)
|
||||||
|
|
||||||
+ Description:
|
+ Description: get the runtime directory creating it if create=true
|
||||||
+ Access: public
|
+ Access: public
|
||||||
+ Modifiers: static
|
+ Modifiers: static
|
||||||
+ return: File
|
+ return: the runtime directory or null if it could not be created
|
||||||
|
|
||||||
| Name | Type | Description |
|
| 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)
|
### runtimeDirectory [[src]](src/java/net/i2p/i2pfirefox/I2PChromiumProfileBuilder.java#L116)
|
||||||
|
|
||||||
+ Description:
|
+ Description: get the correct runtime directory
|
||||||
+ Access: public
|
+ Access: public
|
||||||
+ Modifiers: static
|
+ Modifiers: static
|
||||||
+ return: String
|
+ return: the runtime directory or null if it could not be created or found
|
||||||
|
|
||||||
This method has no parameters.
|
This method has no parameters.
|
||||||
|
|
||||||
|
|
||||||
### copyBaseProfiletoProfile [[src]](src/java/net/i2p/i2pfirefox/I2PChromiumProfileBuilder.java#L162)
|
### 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
|
+ Access: public
|
||||||
+ Modifiers: static
|
+ Modifiers: static
|
||||||
+ return: boolean
|
+ return: boolean
|
||||||
@ -151,10 +155,10 @@ This method has no parameters.
|
|||||||
|
|
||||||
### copyStrictOptions [[src]](src/java/net/i2p/i2pfirefox/I2PChromiumProfileBuilder.java#L227)
|
### 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
|
+ Access: public
|
||||||
+ Modifiers: static
|
+ Modifiers: static
|
||||||
+ return: boolean
|
+ return: true if successful false otherwise
|
||||||
|
|
||||||
This method has no parameters.
|
This method has no parameters.
|
||||||
|
|
||||||
|
@ -3,6 +3,10 @@
|
|||||||
> */
|
> */
|
||||||
|
|
||||||
Access: public
|
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
|
package: net.i2p.i2pfirefox
|
||||||
|
|
||||||
## Dependencies
|
## Dependencies
|
||||||
@ -22,7 +26,7 @@ package: net.i2p.i2pfirefox
|
|||||||
|
|
||||||
### main [[src]](src/java/net/i2p/i2pfirefox/I2PChromiumProfileChecker.java#L28)
|
### 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
|
+ Access: public
|
||||||
+ Modifiers: static
|
+ Modifiers: static
|
||||||
+ return: void
|
+ return: void
|
||||||
@ -34,22 +38,22 @@ package: net.i2p.i2pfirefox
|
|||||||
|
|
||||||
### validateProfileDirectory [[src]](src/java/net/i2p/i2pfirefox/I2PChromiumProfileChecker.java#L49)
|
### validateProfileDirectory [[src]](src/java/net/i2p/i2pfirefox/I2PChromiumProfileChecker.java#L49)
|
||||||
|
|
||||||
+ Description:
|
+ Description: Return true if the profile directory is valid.
|
||||||
+ Access: public
|
+ Access: public
|
||||||
+ Modifiers: static
|
+ Modifiers: static
|
||||||
+ return: boolean
|
+ return: true if the profile directory is valid false otherwise
|
||||||
|
|
||||||
| Name | Type | Description |
|
| Name | Type | Description |
|
||||||
| ----- | ----- | ----- |
|
| ----- | ----- | ----- |
|
||||||
| profileDirectory | String | |
|
| profileDirectory | String | the profile directory to check |
|
||||||
|
|
||||||
|
|
||||||
### validateFile [[src]](src/java/net/i2p/i2pfirefox/I2PChromiumProfileChecker.java#L80)
|
### validateFile [[src]](src/java/net/i2p/i2pfirefox/I2PChromiumProfileChecker.java#L80)
|
||||||
|
|
||||||
+ Description:
|
+ Description: Return true if the extension directory is valid.
|
||||||
+ Access: public
|
+ Access: public
|
||||||
+ Modifiers: static
|
+ Modifiers: static
|
||||||
+ return: boolean
|
+ return: true if the extension directory is valid false otherwise
|
||||||
|
|
||||||
| Name | Type | Description |
|
| Name | Type | Description |
|
||||||
| ----- | ----- | ----- |
|
| ----- | ----- | ----- |
|
||||||
@ -58,13 +62,13 @@ package: net.i2p.i2pfirefox
|
|||||||
|
|
||||||
### validateExtensionDirectory [[src]](src/java/net/i2p/i2pfirefox/I2PChromiumProfileChecker.java#L107)
|
### validateExtensionDirectory [[src]](src/java/net/i2p/i2pfirefox/I2PChromiumProfileChecker.java#L107)
|
||||||
|
|
||||||
+ Description:
|
+ Description: Return true if the extension directory is valid.
|
||||||
+ Access: public
|
+ Access: public
|
||||||
+ Modifiers: static
|
+ Modifiers: static
|
||||||
+ return: boolean
|
+ return: true if the extension directory is valid false otherwise
|
||||||
|
|
||||||
| Name | Type | Description |
|
| Name | Type | Description |
|
||||||
| ----- | ----- | ----- |
|
| ----- | ----- | ----- |
|
||||||
| extensionDirectory | String | |
|
| extensionDirectory | String | the extension directory to check |
|
||||||
|
|
||||||
|
|
||||||
|
@ -3,6 +3,10 @@
|
|||||||
> */
|
> */
|
||||||
|
|
||||||
Access: public
|
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
|
package: net.i2p.i2pfirefox
|
||||||
|
|
||||||
## Dependencies
|
## Dependencies
|
||||||
@ -39,9 +43,9 @@ package: net.i2p.i2pfirefox
|
|||||||
|
|
||||||
### unpackProfile [[src]](src/java/net/i2p/i2pfirefox/I2PChromiumProfileUnpacker.java#L44)
|
### unpackProfile [[src]](src/java/net/i2p/i2pfirefox/I2PChromiumProfileUnpacker.java#L44)
|
||||||
|
|
||||||
+ Description:
|
+ Description: unpack the profile directory
|
||||||
+ Access: public
|
+ Access: public
|
||||||
+ return: boolean
|
+ return: true if the profile directory was successfully unpacked
|
||||||
|
|
||||||
| Name | Type | Description |
|
| Name | Type | Description |
|
||||||
| ----- | ----- | ----- |
|
| ----- | ----- | ----- |
|
||||||
|
140
I2PFirefox.md
140
I2PFirefox.md
@ -3,6 +3,10 @@
|
|||||||
> */
|
> */
|
||||||
|
|
||||||
Access: public
|
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
|
package: net.i2p.i2pfirefox
|
||||||
|
|
||||||
## Dependencies
|
## Dependencies
|
||||||
@ -119,27 +123,27 @@ This method has no parameters.
|
|||||||
|
|
||||||
### onlyValidFirefoxes [[src]](src/java/net/i2p/i2pfirefox/I2PFirefox.java#L218)
|
### 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
|
+ Access: public
|
||||||
+ return: String[]
|
+ return: a list of usable Firefoxes or an empty list if none are found.
|
||||||
|
|
||||||
This method has no parameters.
|
This method has no parameters.
|
||||||
|
|
||||||
|
|
||||||
### topFirefox [[src]](src/java/net/i2p/i2pfirefox/I2PFirefox.java#L238)
|
### 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
|
+ Access: public
|
||||||
+ return: String
|
+ return: the path to the best available Firefox or null if none are found.
|
||||||
|
|
||||||
This method has no parameters.
|
This method has no parameters.
|
||||||
|
|
||||||
|
|
||||||
### topFirefox [[src]](src/java/net/i2p/i2pfirefox/I2PFirefox.java#L267)
|
### 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
|
+ Access: public
|
||||||
+ return: String
|
+ return: the path to the best available Firefox or null if none are found.
|
||||||
|
|
||||||
| Name | Type | Description |
|
| Name | Type | Description |
|
||||||
| ----- | ----- | ----- |
|
| ----- | ----- | ----- |
|
||||||
@ -148,79 +152,101 @@ This method has no parameters.
|
|||||||
|
|
||||||
### defaultProcessBuilder [[src]](src/java/net/i2p/i2pfirefox/I2PFirefox.java#L285)
|
### 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
|
+ Access: public
|
||||||
+ return: ProcessBuilder
|
+ return: a ProcessBuilder for the top Firefox binary and the default profile.
|
||||||
|
|
||||||
This method has no parameters.
|
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:
|
+ Description: Build a ProcessBuilder for the top Firefox binary and the default profile.
|
||||||
+ Access: public
|
|
||||||
+ return: ProcessBuilder
|
|
||||||
|
|
||||||
This method has no parameters.
|
|
||||||
|
|
||||||
|
|
||||||
### processBuilder [[src]](src/java/net/i2p/i2pfirefox/I2PFirefox.java#L313)
|
|
||||||
|
|
||||||
+ Description:
|
|
||||||
+ Access: public
|
+ Access: public
|
||||||
+ return: ProcessBuilder
|
+ return: ProcessBuilder
|
||||||
|
|
||||||
| Name | Type | Description |
|
| 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
|
+ Access: public
|
||||||
+ return: boolean
|
+ return: a ProcessBuilder for the top Firefox binary and the default profile.
|
||||||
|
|
||||||
This method has no parameters.
|
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
|
+ Access: public
|
||||||
+ return: boolean
|
+ return: ProcessBuilder
|
||||||
|
|
||||||
| Name | Type | Description |
|
| 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
|
+ 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 |
|
| Name | Type | Description |
|
||||||
| ----- | ----- | ----- |
|
| ----- | ----- | ----- |
|
||||||
| timeout | int | |
|
| args | String[] | the extended arguments to pass to the Firefox binary. |
|
||||||
| port | int | |
|
|
||||||
|
|
||||||
|
|
||||||
### 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
|
+ 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 |
|
| Name | Type | Description |
|
||||||
| ----- | ----- | ----- |
|
| ----- | ----- | ----- |
|
||||||
| timeout | int | |
|
| timeout | int | the number of seconds to wait for the proxy to be ready. |
|
||||||
| port | int | |
|
|
||||||
| host | String | |
|
|
||||||
|
|
||||||
|
|
||||||
### 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:
|
+ Description:
|
||||||
+ Access: private
|
+ Access: private
|
||||||
@ -232,9 +258,21 @@ This method has no parameters.
|
|||||||
| host | String | |
|
| 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
|
+ Access: public
|
||||||
+ return: void
|
+ return: void
|
||||||
|
|
||||||
@ -243,16 +281,28 @@ This method has no parameters.
|
|||||||
| privateWindow | boolean | |
|
| 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
|
+ Access: public
|
||||||
+ return: void
|
+ return: void
|
||||||
|
|
||||||
This method has no parameters.
|
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:
|
+ Description:
|
||||||
+ Access: public
|
+ Access: public
|
||||||
@ -264,7 +314,7 @@ This method has no parameters.
|
|||||||
| args | String[] | |
|
| args | String[] | |
|
||||||
|
|
||||||
|
|
||||||
### sleep [[src]](src/java/net/i2p/i2pfirefox/I2PFirefox.java#L472)
|
### sleep [[src]](src/java/net/i2p/i2pfirefox/I2PFirefox.java#L535)
|
||||||
|
|
||||||
+ Description:
|
+ Description:
|
||||||
+ Access: private
|
+ Access: private
|
||||||
|
@ -3,6 +3,10 @@
|
|||||||
> */
|
> */
|
||||||
|
|
||||||
Access: public
|
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
|
package: net.i2p.i2pfirefox
|
||||||
|
|
||||||
## Dependencies
|
## Dependencies
|
||||||
@ -48,7 +52,7 @@ package: net.i2p.i2pfirefox
|
|||||||
|
|
||||||
### profileDirectory [[src]](src/java/net/i2p/i2pfirefox/I2PFirefoxProfileBuilder.java#L43)
|
### profileDirectory [[src]](src/java/net/i2p/i2pfirefox/I2PFirefoxProfileBuilder.java#L43)
|
||||||
|
|
||||||
+ Description:
|
+ Description: get the profile directory creating it if necessary
|
||||||
+ Access: public
|
+ Access: public
|
||||||
+ Modifiers: static
|
+ Modifiers: static
|
||||||
+ return: String
|
+ return: String
|
||||||
@ -70,7 +74,7 @@ This method has no parameters.
|
|||||||
|
|
||||||
### baseProfileDirectory [[src]](src/java/net/i2p/i2pfirefox/I2PFirefoxProfileBuilder.java#L75)
|
### baseProfileDirectory [[src]](src/java/net/i2p/i2pfirefox/I2PFirefoxProfileBuilder.java#L75)
|
||||||
|
|
||||||
+ Description:
|
+ Description: get the base profile directory creating it if necessary
|
||||||
+ Access: public
|
+ Access: public
|
||||||
+ Modifiers: static
|
+ Modifiers: static
|
||||||
+ return: String
|
+ return: String
|
||||||
@ -80,29 +84,29 @@ This method has no parameters.
|
|||||||
|
|
||||||
### runtimeDirectory [[src]](src/java/net/i2p/i2pfirefox/I2PFirefoxProfileBuilder.java#L99)
|
### runtimeDirectory [[src]](src/java/net/i2p/i2pfirefox/I2PFirefoxProfileBuilder.java#L99)
|
||||||
|
|
||||||
+ Description:
|
+ Description: get the runtime directory creating it if create=true
|
||||||
+ Access: public
|
+ Access: public
|
||||||
+ Modifiers: static
|
+ Modifiers: static
|
||||||
+ return: File
|
+ return: the runtime directory or null if it could not be created
|
||||||
|
|
||||||
| Name | Type | Description |
|
| 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)
|
### runtimeDirectory [[src]](src/java/net/i2p/i2pfirefox/I2PFirefoxProfileBuilder.java#L116)
|
||||||
|
|
||||||
+ Description:
|
+ Description: get the correct runtime directory
|
||||||
+ Access: public
|
+ Access: public
|
||||||
+ Modifiers: static
|
+ Modifiers: static
|
||||||
+ return: String
|
+ return: the runtime directory or null if it could not be created or found
|
||||||
|
|
||||||
This method has no parameters.
|
This method has no parameters.
|
||||||
|
|
||||||
|
|
||||||
### copyBaseProfiletoProfile [[src]](src/java/net/i2p/i2pfirefox/I2PFirefoxProfileBuilder.java#L162)
|
### 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
|
+ Access: public
|
||||||
+ Modifiers: static
|
+ Modifiers: static
|
||||||
+ return: boolean
|
+ return: boolean
|
||||||
@ -151,10 +155,10 @@ This method has no parameters.
|
|||||||
|
|
||||||
### copyStrictOptions [[src]](src/java/net/i2p/i2pfirefox/I2PFirefoxProfileBuilder.java#L227)
|
### 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
|
+ Access: public
|
||||||
+ Modifiers: static
|
+ Modifiers: static
|
||||||
+ return: boolean
|
+ return: true if successful false otherwise
|
||||||
|
|
||||||
This method has no parameters.
|
This method has no parameters.
|
||||||
|
|
||||||
|
@ -3,6 +3,10 @@
|
|||||||
> */
|
> */
|
||||||
|
|
||||||
Access: public
|
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
|
package: net.i2p.i2pfirefox
|
||||||
|
|
||||||
## Dependencies
|
## Dependencies
|
||||||
@ -34,37 +38,37 @@ package: net.i2p.i2pfirefox
|
|||||||
|
|
||||||
### validateProfileDirectory [[src]](src/java/net/i2p/i2pfirefox/I2PFirefoxProfileChecker.java#L43)
|
### validateProfileDirectory [[src]](src/java/net/i2p/i2pfirefox/I2PFirefoxProfileChecker.java#L43)
|
||||||
|
|
||||||
+ Description:
|
+ Description: Return true if the profile directory is valid.
|
||||||
+ Access: public
|
+ Access: public
|
||||||
+ Modifiers: static
|
+ Modifiers: static
|
||||||
+ return: boolean
|
+ return: true if the profile directory is valid false otherwise
|
||||||
|
|
||||||
| Name | Type | Description |
|
| Name | Type | Description |
|
||||||
| ----- | ----- | ----- |
|
| ----- | ----- | ----- |
|
||||||
| profileDirectory | String | |
|
| profileDirectory | String | the profile directory to check |
|
||||||
|
|
||||||
|
|
||||||
### validateFile [[src]](src/java/net/i2p/i2pfirefox/I2PFirefoxProfileChecker.java#L82)
|
### validateFile [[src]](src/java/net/i2p/i2pfirefox/I2PFirefoxProfileChecker.java#L82)
|
||||||
|
|
||||||
+ Description:
|
+ Description: Return true if the file is valid.
|
||||||
+ Access: public
|
+ Access: public
|
||||||
+ Modifiers: static
|
+ Modifiers: static
|
||||||
+ return: boolean
|
+ return: true if the file is valid false otherwise
|
||||||
|
|
||||||
| Name | Type | Description |
|
| Name | Type | Description |
|
||||||
| ----- | ----- | ----- |
|
| ----- | ----- | ----- |
|
||||||
| file | String | |
|
| file | String | the file to check |
|
||||||
|
|
||||||
|
|
||||||
### validateExtensionDirectory [[src]](src/java/net/i2p/i2pfirefox/I2PFirefoxProfileChecker.java#L109)
|
### validateExtensionDirectory [[src]](src/java/net/i2p/i2pfirefox/I2PFirefoxProfileChecker.java#L109)
|
||||||
|
|
||||||
+ Description:
|
+ Description: Return true if the extension directory is valid.
|
||||||
+ Access: public
|
+ Access: public
|
||||||
+ Modifiers: static
|
+ Modifiers: static
|
||||||
+ return: boolean
|
+ return: true if the extension directory is valid false otherwise
|
||||||
|
|
||||||
| Name | Type | Description |
|
| Name | Type | Description |
|
||||||
| ----- | ----- | ----- |
|
| ----- | ----- | ----- |
|
||||||
| extensionDirectory | String | |
|
| extensionDirectory | String | the extension directory to check |
|
||||||
|
|
||||||
|
|
||||||
|
@ -3,6 +3,10 @@
|
|||||||
> */
|
> */
|
||||||
|
|
||||||
Access: public
|
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
|
package: net.i2p.i2pfirefox
|
||||||
|
|
||||||
## Dependencies
|
## Dependencies
|
||||||
@ -39,9 +43,9 @@ package: net.i2p.i2pfirefox
|
|||||||
|
|
||||||
### unpackProfile [[src]](src/java/net/i2p/i2pfirefox/I2PFirefoxProfileUnpacker.java#L45)
|
### unpackProfile [[src]](src/java/net/i2p/i2pfirefox/I2PFirefoxProfileUnpacker.java#L45)
|
||||||
|
|
||||||
+ Description:
|
+ Description: unpack the profile directory
|
||||||
+ Access: public
|
+ Access: public
|
||||||
+ return: boolean
|
+ return: true if the profile directory was successfully unpacked
|
||||||
|
|
||||||
| Name | Type | Description |
|
| Name | Type | Description |
|
||||||
| ----- | ----- | ----- |
|
| ----- | ----- | ----- |
|
||||||
|
144
report.log
144
report.log
@ -3,25 +3,13 @@ Generating documentation from src/java/net/i2p/i2pfirefox/
|
|||||||
|
|
||||||
[1;32mJavadoc errors for class [0mI2PChromiumProfileChecker
|
[1;32mJavadoc errors for class [0mI2PChromiumProfileChecker
|
||||||
File: [34msrc/java/net/i2p/i2pfirefox/I2PChromiumProfileChecker.java[0m
|
File: [34msrc/java/net/i2p/i2pfirefox/I2PChromiumProfileChecker.java[0m
|
||||||
[33m Missing description for method [0mmain (Line: 28)
|
|
||||||
[33m Javadoc parameter not found [0margs in method: main (Line: 28)
|
[33m Javadoc parameter not found [0margs in method: main (Line: 28)
|
||||||
[33m Missing description for method [0mvalidateProfileDirectory (Line: 49)
|
|
||||||
[33m Javadoc parameter not found [0mprofileDirectory in method: validateProfileDirectory (Line: 49)
|
|
||||||
[33m Missing description for method [0mvalidateFile (Line: 80)
|
|
||||||
[33m Javadoc parameter not found [0mfile in method: validateFile (Line: 80)
|
[33m Javadoc parameter not found [0mfile in method: validateFile (Line: 80)
|
||||||
[33m Missing description for method [0mvalidateExtensionDirectory (Line: 107)
|
|
||||||
[33m Javadoc parameter not found [0mextensionDirectory in method: validateExtensionDirectory (Line: 107)
|
|
||||||
|
|
||||||
[1;32mJavadoc errors for class [0mI2PFirefoxProfileChecker
|
[1;32mJavadoc errors for class [0mI2PFirefoxProfileChecker
|
||||||
File: [34msrc/java/net/i2p/i2pfirefox/I2PFirefoxProfileChecker.java[0m
|
File: [34msrc/java/net/i2p/i2pfirefox/I2PFirefoxProfileChecker.java[0m
|
||||||
[33m Missing description for method [0mmain (Line: 22)
|
[33m Missing description for method [0mmain (Line: 22)
|
||||||
[33m Javadoc parameter not found [0margs in method: main (Line: 22)
|
[33m Javadoc parameter not found [0margs in method: main (Line: 22)
|
||||||
[33m Missing description for method [0mvalidateProfileDirectory (Line: 43)
|
|
||||||
[33m Javadoc parameter not found [0mprofileDirectory in method: validateProfileDirectory (Line: 43)
|
|
||||||
[33m Missing description for method [0mvalidateFile (Line: 82)
|
|
||||||
[33m Javadoc parameter not found [0mfile in method: validateFile (Line: 82)
|
|
||||||
[33m Missing description for method [0mvalidateExtensionDirectory (Line: 109)
|
|
||||||
[33m Javadoc parameter not found [0mextensionDirectory in method: validateExtensionDirectory (Line: 109)
|
|
||||||
|
|
||||||
[1;32mJavadoc errors for class [0mI2PBrowser
|
[1;32mJavadoc errors for class [0mI2PBrowser
|
||||||
File: [34msrc/java/net/i2p/i2pfirefox/I2PBrowser.java[0m
|
File: [34msrc/java/net/i2p/i2pfirefox/I2PBrowser.java[0m
|
||||||
@ -35,32 +23,31 @@ File: [34msrc/java/net/i2p/i2pfirefox/I2PBrowser.java[0m
|
|||||||
[33m Missing return type for member variable [0mboolean chromium (Line: )
|
[33m Missing return type for member variable [0mboolean chromium (Line: )
|
||||||
[33m Missing description for member variable [0mboolean chromiumFirst (Line: )
|
[33m Missing description for member variable [0mboolean chromiumFirst (Line: )
|
||||||
[33m Missing return type for member variable [0mboolean chromiumFirst (Line: )
|
[33m Missing return type for member variable [0mboolean chromiumFirst (Line: )
|
||||||
[33m Missing description for method [0mlaunchFirefox (Line: 29)
|
[33m Missing description for method [0mlaunchFirefox (Line: 30)
|
||||||
[33m Javadoc parameter not found [0mprivateWindow in method: launchFirefox (Line: 29)
|
[33m Javadoc parameter not found [0mprivateWindow in method: launchFirefox (Line: 30)
|
||||||
[33m Missing description for method [0mlaunchChromium (Line: 33)
|
[33m Javadoc parameter not found [0murl in method: launchFirefox (Line: 30)
|
||||||
[33m Javadoc parameter not found [0mprivateWindow in method: launchChromium (Line: 33)
|
[33m Missing description for method [0mlaunchFirefox (Line: 34)
|
||||||
[33m Missing description for method [0m (Line: 43)
|
[33m Javadoc parameter not found [0mprivateWindow in method: launchFirefox (Line: 34)
|
||||||
[33m Missing description for method [0mhasChromium (Line: 52)
|
[33m Missing description for method [0mlaunchChromium (Line: 38)
|
||||||
[33m Missing description for method [0mhasFirefox (Line: 69)
|
[33m Javadoc parameter not found [0mprivateWindow in method: launchChromium (Line: 38)
|
||||||
[33m Missing description for method [0mlaunch (Line: 88)
|
[33m Javadoc parameter not found [0murl in method: launchChromium (Line: 38)
|
||||||
[33m Javadoc parameter not found [0mprivateWindow in method: launch (Line: 88)
|
[33m Missing description for method [0mlaunchChromium (Line: 42)
|
||||||
[33m Missing description for method [0mlaunch (Line: 120)
|
[33m Javadoc parameter not found [0mprivateWindow in method: launchChromium (Line: 42)
|
||||||
[33m Missing description for method [0mmain (Line: 124)
|
[33m Javadoc parameter not found [0mprivateWindow in method: launch (Line: 97)
|
||||||
[33m Javadoc parameter not found [0margs in method: main (Line: 124)
|
[33m Javadoc parameter not found [0murl in method: launch (Line: 97)
|
||||||
|
[33m Javadoc parameter not found [0mprivateWindow in method: launch (Line: 130)
|
||||||
|
[33m Missing description for method [0mValidURL (Line: 145)
|
||||||
|
[33m Javadoc parameter not found [0minUrl in method: ValidURL (Line: 145)
|
||||||
|
[33m Missing description for method [0mmain (Line: 155)
|
||||||
|
[33m Javadoc parameter not found [0margs in method: main (Line: 155)
|
||||||
|
|
||||||
[1;32mJavadoc errors for class [0mI2PFirefoxProfileBuilder
|
[1;32mJavadoc errors for class [0mI2PFirefoxProfileBuilder
|
||||||
File: [34msrc/java/net/i2p/i2pfirefox/I2PFirefoxProfileBuilder.java[0m
|
File: [34msrc/java/net/i2p/i2pfirefox/I2PFirefoxProfileBuilder.java[0m
|
||||||
[33m Missing description for member variable [0mstrict (Line: )
|
[33m Missing description for member variable [0mstrict (Line: )
|
||||||
[33m Missing description for method [0mprofileDir (Line: 33)
|
[33m Missing description for method [0mprofileDir (Line: 33)
|
||||||
[33m Javadoc parameter not found [0mfile in method: profileDir (Line: 33)
|
[33m Javadoc parameter not found [0mfile in method: profileDir (Line: 33)
|
||||||
[33m Missing description for method [0mprofileDirectory (Line: 43)
|
|
||||||
[33m Missing description for method [0mbaseProfileDir (Line: 55)
|
[33m Missing description for method [0mbaseProfileDir (Line: 55)
|
||||||
[33m Javadoc parameter not found [0mfile in method: baseProfileDir (Line: 55)
|
[33m Javadoc parameter not found [0mfile in method: baseProfileDir (Line: 55)
|
||||||
[33m Missing description for method [0mbaseProfileDirectory (Line: 75)
|
|
||||||
[33m Missing description for method [0mruntimeDirectory (Line: 99)
|
|
||||||
[33m Javadoc parameter not found [0mcreate in method: runtimeDirectory (Line: 99)
|
|
||||||
[33m Missing description for method [0mruntimeDirectory (Line: 116)
|
|
||||||
[33m Missing description for method [0mcopyBaseProfiletoProfile (Line: 162)
|
|
||||||
[33m Missing description for method [0mcopyDirectory (Line: 192)
|
[33m Missing description for method [0mcopyDirectory (Line: 192)
|
||||||
[33m Javadoc parameter not found [0msourceDirectory in method: copyDirectory (Line: 192)
|
[33m Javadoc parameter not found [0msourceDirectory in method: copyDirectory (Line: 192)
|
||||||
[33m Javadoc parameter not found [0mdestinationDirectory in method: copyDirectory (Line: 192)
|
[33m Javadoc parameter not found [0mdestinationDirectory in method: copyDirectory (Line: 192)
|
||||||
@ -70,10 +57,6 @@ File: [34msrc/java/net/i2p/i2pfirefox/I2PFirefoxProfileBuilder.java[0m
|
|||||||
[33m Missing description for method [0mcopyFile (Line: 210)
|
[33m Missing description for method [0mcopyFile (Line: 210)
|
||||||
[33m Javadoc parameter not found [0msourceFile in method: copyFile (Line: 210)
|
[33m Javadoc parameter not found [0msourceFile in method: copyFile (Line: 210)
|
||||||
[33m Javadoc parameter not found [0mdestinationFile in method: copyFile (Line: 210)
|
[33m Javadoc parameter not found [0mdestinationFile in method: copyFile (Line: 210)
|
||||||
[33m Missing description for method [0mcopyStrictOptions (Line: 227)
|
|
||||||
[33m Missing description for method [0m (Line: 264)
|
|
||||||
[33m Missing description for method [0m (Line: 274)
|
|
||||||
[33m Javadoc parameter not found [0mstrict in method: (Line: 274)
|
|
||||||
|
|
||||||
[1;32mJavadoc errors for class [0mI2PChromium
|
[1;32mJavadoc errors for class [0mI2PChromium
|
||||||
File: [34msrc/java/net/i2p/i2pfirefox/I2PChromium.java[0m
|
File: [34msrc/java/net/i2p/i2pfirefox/I2PChromium.java[0m
|
||||||
@ -81,7 +64,6 @@ File: [34msrc/java/net/i2p/i2pfirefox/I2PChromium.java[0m
|
|||||||
[33m Missing return type for member variable [0mString[] CHROMIUM_SEARCH_PATHS (Line: )
|
[33m Missing return type for member variable [0mString[] CHROMIUM_SEARCH_PATHS (Line: )
|
||||||
[33m Missing description for member variable [0mint DEFAULT_TIMEOUT (Line: )
|
[33m Missing description for member variable [0mint DEFAULT_TIMEOUT (Line: )
|
||||||
[33m Missing return type for member variable [0mint DEFAULT_TIMEOUT (Line: )
|
[33m Missing return type for member variable [0mint DEFAULT_TIMEOUT (Line: )
|
||||||
[33m Missing description for method [0m (Line: 33)
|
|
||||||
[33m Missing description for method [0mFIND_CHROMIUM_SEARCH_PATHS_UNIX (Line: 44)
|
[33m Missing description for method [0mFIND_CHROMIUM_SEARCH_PATHS_UNIX (Line: 44)
|
||||||
[33m Missing description for method [0mFIND_CHROMIUM_SEARCH_PATHS_OSX (Line: 57)
|
[33m Missing description for method [0mFIND_CHROMIUM_SEARCH_PATHS_OSX (Line: 57)
|
||||||
[33m Missing description for method [0mFIND_CHROMIUM_SEARCH_PATHS_WINDOWS (Line: 70)
|
[33m Missing description for method [0mFIND_CHROMIUM_SEARCH_PATHS_WINDOWS (Line: 70)
|
||||||
@ -90,47 +72,31 @@ File: [34msrc/java/net/i2p/i2pfirefox/I2PChromium.java[0m
|
|||||||
[33m Missing description for method [0mNEARBY_CHROMIUM_SEARCH_PATHS (Line: 133)
|
[33m Missing description for method [0mNEARBY_CHROMIUM_SEARCH_PATHS (Line: 133)
|
||||||
[33m Missing description for method [0mCHROMIUM_FINDER (Line: 177)
|
[33m Missing description for method [0mCHROMIUM_FINDER (Line: 177)
|
||||||
[33m Missing description for method [0mgetOperatingSystem (Line: 189)
|
[33m Missing description for method [0mgetOperatingSystem (Line: 189)
|
||||||
[33m Missing description for method [0monlyValidChromiums (Line: 211)
|
|
||||||
[33m Missing description for method [0mtopChromium (Line: 231)
|
|
||||||
[33m Missing description for method [0mtopChromium (Line: 260)
|
|
||||||
[33m Javadoc parameter not found [0moverrideChromium in method: topChromium (Line: 260)
|
[33m Javadoc parameter not found [0moverrideChromium in method: topChromium (Line: 260)
|
||||||
[33m Missing description for method [0mdefaultProcessBuilder (Line: 278)
|
[33m Javadoc parameter not found [0margs in method: defaultProcessBuilder (Line: 291)
|
||||||
[33m Missing description for method [0mprivateProcessBuilder (Line: 291)
|
[33m Missing description for method [0mcheckifPortIsOccupied (Line: 459)
|
||||||
[33m Missing description for method [0mprocessBuilder (Line: 328)
|
[33m Javadoc parameter not found [0mport in method: checkifPortIsOccupied (Line: 459)
|
||||||
[33m Javadoc parameter not found [0margs in method: processBuilder (Line: 328)
|
[33m Javadoc parameter not found [0mhost in method: checkifPortIsOccupied (Line: 459)
|
||||||
[33m Missing description for method [0mwaitForProxy (Line: 375)
|
[33m Javadoc parameter not found [0mprivateWindow in method: launch (Line: 479)
|
||||||
[33m Missing description for method [0mwaitForProxy (Line: 387)
|
[33m Javadoc parameter not found [0murl in method: launch (Line: 479)
|
||||||
[33m Javadoc parameter not found [0mtimeout in method: waitForProxy (Line: 387)
|
[33m Javadoc parameter not found [0mprivateWindow in method: launch (Line: 524)
|
||||||
[33m Missing description for method [0mwaitForProxy (Line: 399)
|
[33m Missing description for method [0mValidURL (Line: 539)
|
||||||
[33m Javadoc parameter not found [0mtimeout in method: waitForProxy (Line: 399)
|
[33m Javadoc parameter not found [0minUrl in method: ValidURL (Line: 539)
|
||||||
[33m Javadoc parameter not found [0mport in method: waitForProxy (Line: 399)
|
[33m Missing description for method [0mmain (Line: 549)
|
||||||
[33m Missing description for method [0mwaitForProxy (Line: 412)
|
[33m Javadoc parameter not found [0margs in method: main (Line: 549)
|
||||||
[33m Javadoc parameter not found [0mtimeout in method: waitForProxy (Line: 412)
|
[33m Missing description for method [0msleep (Line: 569)
|
||||||
[33m Javadoc parameter not found [0mport in method: waitForProxy (Line: 412)
|
[33m Javadoc parameter not found [0mmillis in method: sleep (Line: 569)
|
||||||
[33m Javadoc parameter not found [0mhost in method: waitForProxy (Line: 412)
|
|
||||||
[33m Missing description for method [0mcheckifPortIsOccupied (Line: 425)
|
|
||||||
[33m Javadoc parameter not found [0mport in method: checkifPortIsOccupied (Line: 425)
|
|
||||||
[33m Javadoc parameter not found [0mhost in method: checkifPortIsOccupied (Line: 425)
|
|
||||||
[33m Missing description for method [0mlaunch (Line: 444)
|
|
||||||
[33m Javadoc parameter not found [0mprivateWindow in method: launch (Line: 444)
|
|
||||||
[33m Missing description for method [0mlaunch (Line: 488)
|
|
||||||
[33m Missing description for method [0mmain (Line: 492)
|
|
||||||
[33m Javadoc parameter not found [0margs in method: main (Line: 492)
|
|
||||||
[33m Missing description for method [0msleep (Line: 505)
|
|
||||||
[33m Javadoc parameter not found [0mmillis in method: sleep (Line: 505)
|
|
||||||
|
|
||||||
[1;32mJavadoc errors for class [0mI2PFirefoxProfileUnpacker
|
[1;32mJavadoc errors for class [0mI2PFirefoxProfileUnpacker
|
||||||
File: [34msrc/java/net/i2p/i2pfirefox/I2PFirefoxProfileUnpacker.java[0m
|
File: [34msrc/java/net/i2p/i2pfirefox/I2PFirefoxProfileUnpacker.java[0m
|
||||||
[33m Missing description for method [0mmain (Line: 30)
|
[33m Missing description for method [0mmain (Line: 30)
|
||||||
[33m Javadoc parameter not found [0margs in method: main (Line: 30)
|
[33m Javadoc parameter not found [0margs in method: main (Line: 30)
|
||||||
[33m Missing description for method [0munpackProfile (Line: 45)
|
|
||||||
[33m Javadoc parameter not found [0mprofileDirectory in method: unpackProfile (Line: 45)
|
[33m Javadoc parameter not found [0mprofileDirectory in method: unpackProfile (Line: 45)
|
||||||
|
|
||||||
[1;32mJavadoc errors for class [0mI2PChromiumProfileUnpacker
|
[1;32mJavadoc errors for class [0mI2PChromiumProfileUnpacker
|
||||||
File: [34msrc/java/net/i2p/i2pfirefox/I2PChromiumProfileUnpacker.java[0m
|
File: [34msrc/java/net/i2p/i2pfirefox/I2PChromiumProfileUnpacker.java[0m
|
||||||
[33m Missing description for method [0mmain (Line: 29)
|
[33m Missing description for method [0mmain (Line: 29)
|
||||||
[33m Javadoc parameter not found [0margs in method: main (Line: 29)
|
[33m Javadoc parameter not found [0margs in method: main (Line: 29)
|
||||||
[33m Missing description for method [0munpackProfile (Line: 44)
|
|
||||||
[33m Javadoc parameter not found [0mprofileDirectory in method: unpackProfile (Line: 44)
|
[33m Javadoc parameter not found [0mprofileDirectory in method: unpackProfile (Line: 44)
|
||||||
|
|
||||||
[1;32mJavadoc errors for class [0mI2PChromiumProfileBuilder
|
[1;32mJavadoc errors for class [0mI2PChromiumProfileBuilder
|
||||||
@ -138,14 +104,8 @@ File: [34msrc/java/net/i2p/i2pfirefox/I2PChromiumProfileBuilder.java[0m
|
|||||||
[33m Missing description for member variable [0mstrict (Line: )
|
[33m Missing description for member variable [0mstrict (Line: )
|
||||||
[33m Missing description for method [0mprofileDir (Line: 33)
|
[33m Missing description for method [0mprofileDir (Line: 33)
|
||||||
[33m Javadoc parameter not found [0mfile in method: profileDir (Line: 33)
|
[33m Javadoc parameter not found [0mfile in method: profileDir (Line: 33)
|
||||||
[33m Missing description for method [0mprofileDirectory (Line: 43)
|
|
||||||
[33m Missing description for method [0mbaseProfileDir (Line: 55)
|
[33m Missing description for method [0mbaseProfileDir (Line: 55)
|
||||||
[33m Javadoc parameter not found [0mfile in method: baseProfileDir (Line: 55)
|
[33m Javadoc parameter not found [0mfile in method: baseProfileDir (Line: 55)
|
||||||
[33m Missing description for method [0mbaseProfileDirectory (Line: 75)
|
|
||||||
[33m Missing description for method [0mruntimeDirectory (Line: 99)
|
|
||||||
[33m Javadoc parameter not found [0mcreate in method: runtimeDirectory (Line: 99)
|
|
||||||
[33m Missing description for method [0mruntimeDirectory (Line: 116)
|
|
||||||
[33m Missing description for method [0mcopyBaseProfiletoProfile (Line: 162)
|
|
||||||
[33m Missing description for method [0mcopyDirectory (Line: 192)
|
[33m Missing description for method [0mcopyDirectory (Line: 192)
|
||||||
[33m Javadoc parameter not found [0msourceDirectory in method: copyDirectory (Line: 192)
|
[33m Javadoc parameter not found [0msourceDirectory in method: copyDirectory (Line: 192)
|
||||||
[33m Javadoc parameter not found [0mdestinationDirectory in method: copyDirectory (Line: 192)
|
[33m Javadoc parameter not found [0mdestinationDirectory in method: copyDirectory (Line: 192)
|
||||||
@ -155,10 +115,6 @@ File: [34msrc/java/net/i2p/i2pfirefox/I2PChromiumProfileBuilder.java[0m
|
|||||||
[33m Missing description for method [0mcopyFile (Line: 210)
|
[33m Missing description for method [0mcopyFile (Line: 210)
|
||||||
[33m Javadoc parameter not found [0msourceFile in method: copyFile (Line: 210)
|
[33m Javadoc parameter not found [0msourceFile in method: copyFile (Line: 210)
|
||||||
[33m Javadoc parameter not found [0mdestinationFile in method: copyFile (Line: 210)
|
[33m Javadoc parameter not found [0mdestinationFile in method: copyFile (Line: 210)
|
||||||
[33m Missing description for method [0mcopyStrictOptions (Line: 227)
|
|
||||||
[33m Missing description for method [0m (Line: 264)
|
|
||||||
[33m Missing description for method [0m (Line: 274)
|
|
||||||
[33m Javadoc parameter not found [0mstrict in method: (Line: 274)
|
|
||||||
|
|
||||||
[1;32mJavadoc errors for class [0mI2PFirefox
|
[1;32mJavadoc errors for class [0mI2PFirefox
|
||||||
File: [34msrc/java/net/i2p/i2pfirefox/I2PFirefox.java[0m
|
File: [34msrc/java/net/i2p/i2pfirefox/I2PFirefox.java[0m
|
||||||
@ -166,7 +122,6 @@ File: [34msrc/java/net/i2p/i2pfirefox/I2PFirefox.java[0m
|
|||||||
[33m Missing return type for member variable [0mString[] FIREFOX_SEARCH_PATHS (Line: )
|
[33m Missing return type for member variable [0mString[] FIREFOX_SEARCH_PATHS (Line: )
|
||||||
[33m Missing description for member variable [0mint DEFAULT_TIMEOUT (Line: )
|
[33m Missing description for member variable [0mint DEFAULT_TIMEOUT (Line: )
|
||||||
[33m Missing return type for member variable [0mint DEFAULT_TIMEOUT (Line: )
|
[33m Missing return type for member variable [0mint DEFAULT_TIMEOUT (Line: )
|
||||||
[33m Missing description for method [0m (Line: 33)
|
|
||||||
[33m Missing description for method [0mFIND_FIREFOX_SEARCH_PATHS_UNIX (Line: 44)
|
[33m Missing description for method [0mFIND_FIREFOX_SEARCH_PATHS_UNIX (Line: 44)
|
||||||
[33m Missing description for method [0mFIND_FIREFOX_SEARCH_PATHS_OSX (Line: 57)
|
[33m Missing description for method [0mFIND_FIREFOX_SEARCH_PATHS_OSX (Line: 57)
|
||||||
[33m Missing description for method [0mFIND_FIREFOX_SEARCH_PATHS_WINDOWS (Line: 70)
|
[33m Missing description for method [0mFIND_FIREFOX_SEARCH_PATHS_WINDOWS (Line: 70)
|
||||||
@ -175,33 +130,18 @@ File: [34msrc/java/net/i2p/i2pfirefox/I2PFirefox.java[0m
|
|||||||
[33m Missing description for method [0mNEARBY_FIREFOX_SEARCH_PATHS (Line: 140)
|
[33m Missing description for method [0mNEARBY_FIREFOX_SEARCH_PATHS (Line: 140)
|
||||||
[33m Missing description for method [0mFIREFOX_FINDER (Line: 184)
|
[33m Missing description for method [0mFIREFOX_FINDER (Line: 184)
|
||||||
[33m Missing description for method [0mgetOperatingSystem (Line: 196)
|
[33m Missing description for method [0mgetOperatingSystem (Line: 196)
|
||||||
[33m Missing description for method [0monlyValidFirefoxes (Line: 218)
|
|
||||||
[33m Missing description for method [0mtopFirefox (Line: 238)
|
|
||||||
[33m Missing description for method [0mtopFirefox (Line: 267)
|
|
||||||
[33m Javadoc parameter not found [0moverrideFirefox in method: topFirefox (Line: 267)
|
[33m Javadoc parameter not found [0moverrideFirefox in method: topFirefox (Line: 267)
|
||||||
[33m Missing description for method [0mdefaultProcessBuilder (Line: 285)
|
[33m Missing description for method [0mcheckifPortIsOccupied (Line: 422)
|
||||||
[33m Missing description for method [0mprivateProcessBuilder (Line: 299)
|
[33m Javadoc parameter not found [0mport in method: checkifPortIsOccupied (Line: 422)
|
||||||
[33m Missing description for method [0mprocessBuilder (Line: 313)
|
[33m Javadoc parameter not found [0mhost in method: checkifPortIsOccupied (Line: 422)
|
||||||
[33m Javadoc parameter not found [0margs in method: processBuilder (Line: 313)
|
[33m Javadoc parameter not found [0mprivateWindow in method: launch (Line: 441)
|
||||||
[33m Missing description for method [0mwaitForProxy (Line: 339)
|
[33m Javadoc parameter not found [0murl in method: launch (Line: 441)
|
||||||
[33m Missing description for method [0mwaitForProxy (Line: 351)
|
[33m Javadoc parameter not found [0mprivateWindow in method: launch (Line: 487)
|
||||||
[33m Javadoc parameter not found [0mtimeout in method: waitForProxy (Line: 351)
|
[33m Missing description for method [0mValidURL (Line: 503)
|
||||||
[33m Missing description for method [0mwaitForProxy (Line: 363)
|
[33m Javadoc parameter not found [0minUrl in method: ValidURL (Line: 503)
|
||||||
[33m Javadoc parameter not found [0mtimeout in method: waitForProxy (Line: 363)
|
[33m Missing description for method [0mmain (Line: 514)
|
||||||
[33m Javadoc parameter not found [0mport in method: waitForProxy (Line: 363)
|
[33m Javadoc parameter not found [0margs in method: main (Line: 514)
|
||||||
[33m Missing description for method [0mwaitForProxy (Line: 376)
|
[33m Missing description for method [0msleep (Line: 535)
|
||||||
[33m Javadoc parameter not found [0mtimeout in method: waitForProxy (Line: 376)
|
[33m Javadoc parameter not found [0mmillis in method: sleep (Line: 535)
|
||||||
[33m Javadoc parameter not found [0mport in method: waitForProxy (Line: 376)
|
|
||||||
[33m Javadoc parameter not found [0mhost in method: waitForProxy (Line: 376)
|
|
||||||
[33m Missing description for method [0mcheckifPortIsOccupied (Line: 389)
|
|
||||||
[33m Javadoc parameter not found [0mport in method: checkifPortIsOccupied (Line: 389)
|
|
||||||
[33m Javadoc parameter not found [0mhost in method: checkifPortIsOccupied (Line: 389)
|
|
||||||
[33m Missing description for method [0mlaunch (Line: 408)
|
|
||||||
[33m Javadoc parameter not found [0mprivateWindow in method: launch (Line: 408)
|
|
||||||
[33m Missing description for method [0mlaunch (Line: 454)
|
|
||||||
[33m Missing description for method [0mmain (Line: 458)
|
|
||||||
[33m Javadoc parameter not found [0margs in method: main (Line: 458)
|
|
||||||
[33m Missing description for method [0msleep (Line: 472)
|
|
||||||
[33m Javadoc parameter not found [0mmillis in method: sleep (Line: 472)
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
package net.i2p.i2pfirefox;
|
package net.i2p.i2pfirefox;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
|
||||||
/*
|
/**
|
||||||
* I2PBrowser.java
|
* I2PBrowser.java
|
||||||
* Copyright (C) 2022 idk <hankhill19580@gmail.com>
|
* Copyright (C) 2022 idk <hankhill19580@gmail.com>
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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 chromium = false;
|
||||||
public boolean chromiumFirst = 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) {
|
private void launchFirefox(boolean privateWindow) {
|
||||||
System.out.println("I2PFirefox");
|
System.out.println("I2PFirefox");
|
||||||
i2pFirefox.launch(privateWindow);
|
i2pFirefox.launch(privateWindow);
|
||||||
}
|
}
|
||||||
|
private void launchChromium(boolean privateWindow, String[] url) {
|
||||||
|
System.out.println("I2PChromium");
|
||||||
|
i2pChromium.launch(privateWindow, url);
|
||||||
|
}
|
||||||
private void launchChromium(boolean privateWindow) {
|
private void launchChromium(boolean privateWindow) {
|
||||||
System.out.println("I2PChromium");
|
System.out.println("I2PChromium");
|
||||||
i2pChromium.launch(privateWindow);
|
i2pChromium.launch(privateWindow);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/**
|
||||||
* Construct an I2PBrowser class which automatically determines which browser to use.
|
* Construct an I2PBrowser class which automatically determines which browser to use.
|
||||||
*
|
*
|
||||||
* @since 0.0.16
|
* @since 0.0.16
|
||||||
@ -43,7 +52,7 @@ public class I2PBrowser {
|
|||||||
public I2PBrowser() {
|
public I2PBrowser() {
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/**
|
||||||
* Return true if there is a Chromium available
|
* Return true if there is a Chromium available
|
||||||
*
|
*
|
||||||
* @return true if Chromium is available, false otherwise
|
* @return true if Chromium is available, false otherwise
|
||||||
@ -60,7 +69,7 @@ public class I2PBrowser {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/**
|
||||||
* Return true if there is a Firefox variant available
|
* Return true if there is a Firefox variant available
|
||||||
*
|
*
|
||||||
* @return true if Firefox variant is available, false otherwise
|
* @return true if Firefox variant is available, false otherwise
|
||||||
@ -77,7 +86,40 @@ public class I2PBrowser {
|
|||||||
return true;
|
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.
|
* Populates a profile directory with a proxy configuration.
|
||||||
* Waits for an HTTP proxy on the port 4444 to be ready.
|
* Waits for an HTTP proxy on the port 4444 to be ready.
|
||||||
* Launches either Firefox or Chromium with the profile directory.
|
* Launches either Firefox or Chromium with the profile directory.
|
||||||
@ -86,31 +128,10 @@ public class I2PBrowser {
|
|||||||
* @since 0.0.16
|
* @since 0.0.16
|
||||||
*/
|
*/
|
||||||
public void launch(boolean privateWindow){
|
public void launch(boolean privateWindow){
|
||||||
if ((chromium && firefox) || (!chromium && !firefox)) {
|
launch(privateWindow, null);
|
||||||
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;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/**
|
||||||
* Populates a profile directory with a proxy configuration.
|
* Populates a profile directory with a proxy configuration.
|
||||||
* Waits for an HTTP proxy on the port 4444 to be ready.
|
* Waits for an HTTP proxy on the port 4444 to be ready.
|
||||||
* Launches either Firefox or Chromium with the profile directory.
|
* Launches either Firefox or Chromium with the profile directory.
|
||||||
@ -121,10 +142,21 @@ public class I2PBrowser {
|
|||||||
launch(false);
|
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) {
|
public static void main(String[] args) {
|
||||||
boolean privateBrowsing = false;
|
boolean privateBrowsing = false;
|
||||||
System.out.println("I2PBrowser");
|
System.out.println("I2PBrowser");
|
||||||
I2PBrowser i2pBrowser = new I2PBrowser();
|
I2PBrowser i2pBrowser = new I2PBrowser();
|
||||||
|
ArrayList<String> visitURL = new ArrayList<String>();
|
||||||
if (args != null && args.length > 0) {
|
if (args != null && args.length > 0) {
|
||||||
for (String arg : args) {
|
for (String arg : args) {
|
||||||
if (arg.equals("-private")) {
|
if (arg.equals("-private")) {
|
||||||
@ -136,9 +168,12 @@ public class I2PBrowser {
|
|||||||
if (arg.equals("-firefox")) {
|
if (arg.equals("-firefox")) {
|
||||||
i2pBrowser.firefox = true;
|
i2pBrowser.firefox = true;
|
||||||
}
|
}
|
||||||
|
if (!arg.startsWith("-")){
|
||||||
|
visitURL.add(ValidURL(arg));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
i2pBrowser.launch(privateBrowsing);
|
}
|
||||||
|
i2pBrowser.launch(privateBrowsing, visitURL.toArray(new String[visitURL.size()]));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -5,7 +5,7 @@ import java.io.IOException;
|
|||||||
import java.net.Socket;
|
import java.net.Socket;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
||||||
/*
|
/**
|
||||||
* I2PChromium.java
|
* I2PChromium.java
|
||||||
* Copyright (C) 2022 idk <hankhill19580@gmail.com>
|
* Copyright (C) 2022 idk <hankhill19580@gmail.com>
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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 String[] CHROMIUM_SEARCH_PATHS = CHROMIUM_FINDER();
|
||||||
private final int DEFAULT_TIMEOUT = 200;
|
private final int DEFAULT_TIMEOUT = 200;
|
||||||
|
|
||||||
/*
|
/**
|
||||||
* Construct an I2PChromium class which manages an instance of Chromium and
|
* Construct an I2PChromium class which manages an instance of Chromium and
|
||||||
* an accompanying Chromium profile. This version includes Chromium variants
|
* an accompanying Chromium profile. This version includes Chromium variants
|
||||||
* and forks.
|
* and forks.
|
||||||
@ -200,7 +200,7 @@ public class I2PChromium {
|
|||||||
return "Unknown";
|
return "Unknown";
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/**
|
||||||
* Check our list of chrome paths for a valid chrome binary.
|
* Check our list of chrome paths for a valid chrome binary.
|
||||||
* Just an existence check for now, but should check versions
|
* Just an existence check for now, but should check versions
|
||||||
* in the future.
|
* in the future.
|
||||||
@ -222,7 +222,7 @@ public class I2PChromium {
|
|||||||
return validChromiums.toArray(new String[validChromiums.size()]);
|
return validChromiums.toArray(new String[validChromiums.size()]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/**
|
||||||
* Return the best available Chromium from the list of Chromiums we have.
|
* 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.
|
* @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.
|
* 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
|
* if override is passed it will be validated and if it validates, it will
|
||||||
* be used.
|
* be used.
|
||||||
@ -267,7 +267,7 @@ public class I2PChromium {
|
|||||||
return topChromium();
|
return topChromium();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/**
|
||||||
* Build a ProcessBuilder for the top Chromium binary and
|
* Build a ProcessBuilder for the top Chromium binary and
|
||||||
* the default profile.
|
* the default profile.
|
||||||
*
|
*
|
||||||
@ -279,11 +279,24 @@ public class I2PChromium {
|
|||||||
return processBuilder(new String[]{});
|
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
|
* Build a ProcessBuilder for the top Chromium binary and
|
||||||
* the default profile.
|
* the default profile.
|
||||||
*
|
*
|
||||||
* @param args the arguments to pass to the Chromium binary.
|
|
||||||
* @return a ProcessBuilder for the top Chromium binary and
|
* @return a ProcessBuilder for the top Chromium binary and
|
||||||
* the default profile. Always passes the --incognito flag.
|
* the default profile. Always passes the --incognito flag.
|
||||||
* @since 0.0.1
|
* @since 0.0.1
|
||||||
@ -292,7 +305,28 @@ public class I2PChromium {
|
|||||||
return processBuilder(new String[]{"--incognito"});
|
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" \
|
1 --user-data-dir="$CHROMIUM_I2P" \
|
||||||
2 --proxy-server="http://127.0.0.1:4444" \
|
2 --proxy-server="http://127.0.0.1:4444" \
|
||||||
3 --proxy-bypass-list=127.0.0.1:7657 \
|
3 --proxy-bypass-list=127.0.0.1:7657 \
|
||||||
@ -315,7 +349,7 @@ public class I2PChromium {
|
|||||||
20 --disable-file-system \
|
20 --disable-file-system \
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/**
|
||||||
* Build a ProcessBuilder for the top Chromium binary and
|
* Build a ProcessBuilder for the top Chromium binary and
|
||||||
* the default profile, with a specific set of extended
|
* the default profile, with a specific set of extended
|
||||||
* arguments.
|
* arguments.
|
||||||
@ -349,7 +383,7 @@ public class I2PChromium {
|
|||||||
newArgs[17] = "--disable-d3d11";
|
newArgs[17] = "--disable-d3d11";
|
||||||
newArgs[18] = "--disable-file-system";
|
newArgs[18] = "--disable-file-system";
|
||||||
newArgs[19] = "--load-extension="+new File(I2PChromiumProfileBuilder.profileDirectory(),"extensions/i2pchrome.js").getAbsolutePath();
|
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/ublock.js").getAbsolutePath()
|
||||||
+","+
|
+","+
|
||||||
new File(I2PChromiumProfileBuilder.profileDirectory(),"extensions/scriptsafe.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.
|
* Waits for an HTTP proxy on port 4444 to be ready.
|
||||||
* Returns false on timeout of 200 seconds.
|
* Returns false on timeout of 200 seconds.
|
||||||
*
|
*
|
||||||
@ -376,7 +410,7 @@ public class I2PChromium {
|
|||||||
return waitForProxy(DEFAULT_TIMEOUT);
|
return waitForProxy(DEFAULT_TIMEOUT);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/**
|
||||||
* Waits for an HTTP proxy on port 4444 to be ready.
|
* Waits for an HTTP proxy on port 4444 to be ready.
|
||||||
* Returns false on timeout of the specified number of seconds.
|
* Returns false on timeout of the specified number of seconds.
|
||||||
*
|
*
|
||||||
@ -387,7 +421,7 @@ public class I2PChromium {
|
|||||||
public boolean waitForProxy(int timeout) {
|
public boolean waitForProxy(int timeout) {
|
||||||
return waitForProxy(timeout, 4444);
|
return waitForProxy(timeout, 4444);
|
||||||
}
|
}
|
||||||
/*
|
/**
|
||||||
* Waits for an HTTP proxy on the specified port to be ready.
|
* Waits for an HTTP proxy on the specified port to be ready.
|
||||||
* Returns false on timeout of the specified number of seconds.
|
* Returns false on timeout of the specified number of seconds.
|
||||||
*
|
*
|
||||||
@ -399,7 +433,7 @@ public class I2PChromium {
|
|||||||
public boolean waitForProxy(int timeout, int port) {
|
public boolean waitForProxy(int timeout, int port) {
|
||||||
return waitForProxy(timeout, port, "localhost");
|
return waitForProxy(timeout, port, "localhost");
|
||||||
}
|
}
|
||||||
/*
|
/**
|
||||||
* Waits for an HTTP proxy on the specified port to be ready.
|
* Waits for an HTTP proxy on the specified port to be ready.
|
||||||
* Returns false on timeout of the specified number of seconds.
|
* 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.
|
* Populates a profile directory with a proxy configuration.
|
||||||
* Waits for an HTTP proxy on the port 4444 to be ready.
|
* Waits for an HTTP proxy on the port 4444 to be ready.
|
||||||
* Launches Chromium with the profile directory.
|
* Launches Chromium with the profile directory.
|
||||||
*
|
*
|
||||||
* @param bool if true, the profile will be ephemeral(i.e. a --private-window profile).
|
* @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();
|
String profileDirectory = I2PChromiumProfileBuilder.profileDirectory();
|
||||||
if (I2PChromiumProfileChecker.validateProfileDirectory(profileDirectory)) {
|
if (I2PChromiumProfileChecker.validateProfileDirectory(profileDirectory)) {
|
||||||
System.out.println("Valid profile directory: "+profileDirectory);
|
System.out.println("Valid profile directory: "+profileDirectory);
|
||||||
@ -457,9 +492,9 @@ public class I2PChromium {
|
|||||||
if (waitForProxy()){
|
if (waitForProxy()){
|
||||||
ProcessBuilder pb = null;
|
ProcessBuilder pb = null;
|
||||||
if (privateWindow) {
|
if (privateWindow) {
|
||||||
pb = this.privateProcessBuilder();
|
pb = this.privateProcessBuilder(url);
|
||||||
} else {
|
} else {
|
||||||
pb = this.defaultProcessBuilder();
|
pb = this.defaultProcessBuilder(url);
|
||||||
}
|
}
|
||||||
try{
|
try{
|
||||||
System.out.println(pb.command());
|
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.
|
* Populates a profile directory with a proxy configuration.
|
||||||
* Waits for an HTTP proxy on the port 4444 to be ready.
|
* Waits for an HTTP proxy on the port 4444 to be ready.
|
||||||
* Launches Chromium with the profile directory.
|
* Launches Chromium with the profile directory.
|
||||||
@ -489,18 +536,35 @@ public class I2PChromium {
|
|||||||
launch(false);
|
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) {
|
public static void main(String[] args) {
|
||||||
boolean privateBrowsing = false;
|
boolean privateBrowsing = false;
|
||||||
if (args != null && args.length > 0) {
|
|
||||||
System.out.println("checking for private browsing");
|
System.out.println("checking for private browsing");
|
||||||
if (args[0].equals("-private")) {
|
ArrayList<String> visitURL = new ArrayList<String>();
|
||||||
|
if (args != null && args.length > 0) {
|
||||||
|
for (String arg : args) {
|
||||||
|
if (arg.equals("-private")) {
|
||||||
privateBrowsing = true;
|
privateBrowsing = true;
|
||||||
System.out.println("private browsing is true, profile will be discarded at end of session");
|
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");
|
System.out.println("I2PChromium");
|
||||||
I2PChromium i2pChromium = new I2PChromium();
|
I2PChromium i2pChromium = new I2PChromium();
|
||||||
i2pChromium.launch(privateBrowsing);
|
i2pChromium.launch(privateBrowsing, visitURL.toArray(new String[visitURL.size()]));
|
||||||
}
|
}
|
||||||
private static void sleep(int millis) {
|
private static void sleep(int millis) {
|
||||||
try {
|
try {
|
||||||
|
@ -9,7 +9,7 @@ import java.io.OutputStream;
|
|||||||
import java.nio.file.Files;
|
import java.nio.file.Files;
|
||||||
import java.nio.file.StandardCopyOption;
|
import java.nio.file.StandardCopyOption;
|
||||||
|
|
||||||
/*
|
/**
|
||||||
* I2PChromiumProfileBuilder.java
|
* I2PChromiumProfileBuilder.java
|
||||||
* Copyright (C) 2022 idk <hankhill19580@gmail.com>
|
* Copyright (C) 2022 idk <hankhill19580@gmail.com>
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
@ -35,7 +35,7 @@ public class I2PChromiumProfileBuilder {
|
|||||||
return profileDir.getAbsolutePath();
|
return profileDir.getAbsolutePath();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/**
|
||||||
* get the profile directory, creating it if necessary
|
* get the profile directory, creating it if necessary
|
||||||
*
|
*
|
||||||
* @return the profile directory, or null if it could not be created
|
* @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
|
* get the base profile directory, creating it if necessary
|
||||||
*
|
*
|
||||||
* @return the base profile directory, or null if it could not be created
|
* @return the base profile directory, or null if it could not be created
|
||||||
@ -89,7 +89,7 @@ public class I2PChromiumProfileBuilder {
|
|||||||
return baseProfileDir(rtd);
|
return baseProfileDir(rtd);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/**
|
||||||
* get the runtime directory, creating it if create=true
|
* get the runtime directory, creating it if create=true
|
||||||
*
|
*
|
||||||
* @param create if true, create the runtime directory if it does not exist
|
* @param create if true, create the runtime directory if it does not exist
|
||||||
@ -107,7 +107,7 @@ public class I2PChromiumProfileBuilder {
|
|||||||
return new File(rtd);
|
return new File(rtd);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/**
|
||||||
* get the correct runtime directory
|
* get the correct runtime directory
|
||||||
*
|
*
|
||||||
* @return the runtime directory, or null if it could not be created or found
|
* @return the runtime directory, or null if it could not be created or found
|
||||||
@ -154,7 +154,7 @@ public class I2PChromiumProfileBuilder {
|
|||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/**
|
||||||
* Copy the inert base profile directory to the runtime profile directory
|
* Copy the inert base profile directory to the runtime profile directory
|
||||||
*
|
*
|
||||||
* @since 0.0.1
|
* @since 0.0.1
|
||||||
@ -218,7 +218,7 @@ public class I2PChromiumProfileBuilder {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/**
|
||||||
* Copy the strict options from the base profile to the profile
|
* Copy the strict options from the base profile to the profile
|
||||||
*
|
*
|
||||||
* @return true if successful, false otherwise
|
* @return true if successful, false otherwise
|
||||||
@ -256,7 +256,7 @@ public class I2PChromiumProfileBuilder {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/**
|
||||||
* Construct a new Profile Builder
|
* Construct a new Profile Builder
|
||||||
*
|
*
|
||||||
* @since 0.0.1
|
* @since 0.0.1
|
||||||
@ -265,7 +265,7 @@ public class I2PChromiumProfileBuilder {
|
|||||||
I2PChromiumProfileBuilder.strict = false;
|
I2PChromiumProfileBuilder.strict = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/**
|
||||||
* Construct a new Profile Builder
|
* Construct a new Profile Builder
|
||||||
* @param strict if true, the strict overrides will be copied to the profile
|
* @param strict if true, the strict overrides will be copied to the profile
|
||||||
*
|
*
|
||||||
|
@ -2,7 +2,7 @@ package net.i2p.i2pfirefox;
|
|||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
|
||||||
/*
|
/**
|
||||||
* I2PChromiumProfileChecker.java
|
* I2PChromiumProfileChecker.java
|
||||||
* Copyright (C) 2022 idk <hankhill19580@gmail.com>
|
* Copyright (C) 2022 idk <hankhill19580@gmail.com>
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
@ -19,7 +19,7 @@ import java.io.File;
|
|||||||
* @since 0.0.1
|
* @since 0.0.1
|
||||||
*/
|
*/
|
||||||
public class I2PChromiumProfileChecker {
|
public class I2PChromiumProfileChecker {
|
||||||
/*
|
/**
|
||||||
* Output feedback if the profile directory is valid or invalid
|
* Output feedback if the profile directory is valid or invalid
|
||||||
*
|
*
|
||||||
* @description 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");
|
System.out.println("Profile directory is invalid");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/*
|
/**
|
||||||
* Return true if the profile directory is valid.
|
* Return true if the profile directory is valid.
|
||||||
*
|
*
|
||||||
* @param profileDirectory the profile directory to check
|
* @param profileDirectory the profile directory to check
|
||||||
@ -70,7 +70,7 @@ public class I2PChromiumProfileChecker {
|
|||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
/*
|
/**
|
||||||
* Return true if the extension directory is valid.
|
* Return true if the extension directory is valid.
|
||||||
*
|
*
|
||||||
* @param extensionDirectory the extension directory to check
|
* @param extensionDirectory the extension directory to check
|
||||||
@ -97,7 +97,7 @@ public class I2PChromiumProfileChecker {
|
|||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
/*
|
/**
|
||||||
* Return true if the extension directory is valid.
|
* Return true if the extension directory is valid.
|
||||||
*
|
*
|
||||||
* @param extensionDirectory the extension directory to check
|
* @param extensionDirectory the extension directory to check
|
||||||
|
@ -7,7 +7,7 @@ import java.nio.file.StandardCopyOption;
|
|||||||
import java.util.zip.ZipEntry;
|
import java.util.zip.ZipEntry;
|
||||||
import java.util.zip.ZipInputStream;
|
import java.util.zip.ZipInputStream;
|
||||||
|
|
||||||
/*
|
/**
|
||||||
* I2PChromiumProfileUnpacker.java
|
* I2PChromiumProfileUnpacker.java
|
||||||
* Copyright (C) 2022 idk <hankhill19580@gmail.com>
|
* Copyright (C) 2022 idk <hankhill19580@gmail.com>
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
@ -35,7 +35,7 @@ public class I2PChromiumProfileUnpacker {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/**
|
||||||
* unpack the profile directory
|
* unpack the profile directory
|
||||||
*
|
*
|
||||||
* @return true if the profile directory was successfully unpacked
|
* @return true if the profile directory was successfully unpacked
|
||||||
|
@ -5,7 +5,7 @@ import java.io.IOException;
|
|||||||
import java.net.Socket;
|
import java.net.Socket;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
||||||
/*
|
/**
|
||||||
* I2PFirefox.java
|
* I2PFirefox.java
|
||||||
* Copyright (C) 2022 idk <hankhill19580@gmail.com>
|
* Copyright (C) 2022 idk <hankhill19580@gmail.com>
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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 String[] FIREFOX_SEARCH_PATHS = FIREFOX_FINDER();
|
||||||
private final int DEFAULT_TIMEOUT = 200;
|
private final int DEFAULT_TIMEOUT = 200;
|
||||||
|
|
||||||
/*
|
/**
|
||||||
* Construct an I2PFirefox class which manages an instance of Firefox and
|
* Construct an I2PFirefox class which manages an instance of Firefox and
|
||||||
* an accompanying Firefox profile. This version includes Firefox variants
|
* an accompanying Firefox profile. This version includes Firefox variants
|
||||||
* and forks.
|
* and forks.
|
||||||
@ -207,7 +207,7 @@ public class I2PFirefox {
|
|||||||
return "Unknown";
|
return "Unknown";
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/**
|
||||||
* Check our list of firefox paths for a valid firefox binary.
|
* Check our list of firefox paths for a valid firefox binary.
|
||||||
* Just an existence check for now, but should check versions
|
* Just an existence check for now, but should check versions
|
||||||
* in the future.
|
* in the future.
|
||||||
@ -229,7 +229,7 @@ public class I2PFirefox {
|
|||||||
return validFirefoxes.toArray(new String[validFirefoxes.size()]);
|
return validFirefoxes.toArray(new String[validFirefoxes.size()]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/**
|
||||||
* Return the best available Firefox from the list of Firefoxes we have.
|
* 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.
|
* @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.
|
* 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
|
* if override is passed it will be validated and if it validates, it will
|
||||||
* be used.
|
* be used.
|
||||||
@ -274,7 +274,7 @@ public class I2PFirefox {
|
|||||||
return topFirefox();
|
return topFirefox();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/**
|
||||||
* Build a ProcessBuilder for the top Firefox binary and
|
* Build a ProcessBuilder for the top Firefox binary and
|
||||||
* the default profile.
|
* the default profile.
|
||||||
*
|
*
|
||||||
@ -286,7 +286,19 @@ public class I2PFirefox {
|
|||||||
return processBuilder(new String[]{});
|
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
|
* Build a ProcessBuilder for the top Firefox binary and
|
||||||
* the default profile. Pass the --private-window flag to
|
* the default profile. Pass the --private-window flag to
|
||||||
* open a private window.
|
* open a private window.
|
||||||
@ -300,7 +312,28 @@ public class I2PFirefox {
|
|||||||
return processBuilder(new String[]{"--private-window"});
|
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
|
* Build a ProcessBuilder for the top Firefox binary and
|
||||||
* the default profile, with a specific set of extended
|
* the default profile, with a specific set of extended
|
||||||
* arguments.
|
* arguments.
|
||||||
@ -317,7 +350,7 @@ public class I2PFirefox {
|
|||||||
newArgs[0] = firefox;
|
newArgs[0] = firefox;
|
||||||
newArgs[1] = "--profile";
|
newArgs[1] = "--profile";
|
||||||
newArgs[2] = I2PFirefoxProfileBuilder.profileDirectory();
|
newArgs[2] = I2PFirefoxProfileBuilder.profileDirectory();
|
||||||
if (args.length > 0) {
|
if (args != null && args.length > 0) {
|
||||||
for (int i = 0; i < args.length; i++) {
|
for (int i = 0; i < args.length; i++) {
|
||||||
newArgs[i+3] = args[i];
|
newArgs[i+3] = args[i];
|
||||||
}
|
}
|
||||||
@ -329,7 +362,7 @@ public class I2PFirefox {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/**
|
||||||
* Waits for an HTTP proxy on port 4444 to be ready.
|
* Waits for an HTTP proxy on port 4444 to be ready.
|
||||||
* Returns false on timeout of 200 seconds.
|
* Returns false on timeout of 200 seconds.
|
||||||
*
|
*
|
||||||
@ -340,7 +373,7 @@ public class I2PFirefox {
|
|||||||
return waitForProxy(DEFAULT_TIMEOUT);
|
return waitForProxy(DEFAULT_TIMEOUT);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/**
|
||||||
* Waits for an HTTP proxy on port 4444 to be ready.
|
* Waits for an HTTP proxy on port 4444 to be ready.
|
||||||
* Returns false on timeout of the specified number of seconds.
|
* Returns false on timeout of the specified number of seconds.
|
||||||
*
|
*
|
||||||
@ -351,7 +384,7 @@ public class I2PFirefox {
|
|||||||
public boolean waitForProxy(int timeout) {
|
public boolean waitForProxy(int timeout) {
|
||||||
return waitForProxy(timeout, 4444);
|
return waitForProxy(timeout, 4444);
|
||||||
}
|
}
|
||||||
/*
|
/**
|
||||||
* Waits for an HTTP proxy on the specified port to be ready.
|
* Waits for an HTTP proxy on the specified port to be ready.
|
||||||
* Returns false on timeout of the specified number of seconds.
|
* Returns false on timeout of the specified number of seconds.
|
||||||
*
|
*
|
||||||
@ -363,7 +396,7 @@ public class I2PFirefox {
|
|||||||
public boolean waitForProxy(int timeout, int port) {
|
public boolean waitForProxy(int timeout, int port) {
|
||||||
return waitForProxy(timeout, port, "localhost");
|
return waitForProxy(timeout, port, "localhost");
|
||||||
}
|
}
|
||||||
/*
|
/**
|
||||||
* Waits for an HTTP proxy on the specified port to be ready.
|
* Waits for an HTTP proxy on the specified port to be ready.
|
||||||
* Returns false on timeout of the specified number of seconds.
|
* 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.
|
* Populates a profile directory with a proxy configuration.
|
||||||
* Waits for an HTTP proxy on the port 4444 to be ready.
|
* Waits for an HTTP proxy on the port 4444 to be ready.
|
||||||
* Launches Firefox with the profile directory.
|
* Launches Firefox with the profile directory.
|
||||||
*
|
*
|
||||||
* @param bool if true, the profile will be ephemeral(i.e. a --private-window profile).
|
* @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();
|
String profileDirectory = I2PFirefoxProfileBuilder.profileDirectory();
|
||||||
if (I2PFirefoxProfileChecker.validateProfileDirectory(profileDirectory)) {
|
if (I2PFirefoxProfileChecker.validateProfileDirectory(profileDirectory)) {
|
||||||
System.out.println("Valid profile directory: "+profileDirectory);
|
System.out.println("Valid profile directory: "+profileDirectory);
|
||||||
@ -421,9 +454,9 @@ public class I2PFirefox {
|
|||||||
if (waitForProxy()){
|
if (waitForProxy()){
|
||||||
ProcessBuilder pb;
|
ProcessBuilder pb;
|
||||||
if (privateWindow) {
|
if (privateWindow) {
|
||||||
pb = privateProcessBuilder();
|
pb = privateProcessBuilder(url);
|
||||||
} else {
|
} else {
|
||||||
pb = defaultProcessBuilder();
|
pb = defaultProcessBuilder(url);
|
||||||
}
|
}
|
||||||
try{
|
try{
|
||||||
System.out.println(pb.command());
|
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.
|
* Populates a profile directory with a proxy configuration.
|
||||||
* Waits for an HTTP proxy on the port 4444 to be ready.
|
* Waits for an HTTP proxy on the port 4444 to be ready.
|
||||||
* Launches Firefox with the profile directory. Uses a semi-permanent
|
* Launches Firefox with the profile directory. Uses a semi-permanent
|
||||||
@ -455,18 +500,36 @@ public class I2PFirefox {
|
|||||||
launch(false);
|
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) {
|
public static void main(String[] args) {
|
||||||
boolean privateBrowsing = false;
|
boolean privateBrowsing = false;
|
||||||
if (args != null && args.length > 0) {
|
|
||||||
System.out.println("checking for private browsing");
|
System.out.println("checking for private browsing");
|
||||||
if (args[0].equals("-private")) {
|
ArrayList<String> visitURL = new ArrayList<String>();
|
||||||
|
if (args != null && args.length > 0) {
|
||||||
|
for (String arg : args) {
|
||||||
|
if (arg.equals("-private")) {
|
||||||
privateBrowsing = true;
|
privateBrowsing = true;
|
||||||
System.out.println("private browsing is true, profile will be discarded at end of session");
|
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");
|
System.out.println("I2PFirefox");
|
||||||
I2PFirefox i2pFirefox = new I2PFirefox();
|
I2PFirefox i2pFirefox = new I2PFirefox();
|
||||||
i2pFirefox.launch(privateBrowsing);
|
i2pFirefox.launch(privateBrowsing, visitURL.toArray(new String[visitURL.size()]));
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void sleep(int millis) {
|
private static void sleep(int millis) {
|
||||||
|
@ -9,7 +9,7 @@ import java.io.OutputStream;
|
|||||||
import java.nio.file.Files;
|
import java.nio.file.Files;
|
||||||
import java.nio.file.StandardCopyOption;
|
import java.nio.file.StandardCopyOption;
|
||||||
|
|
||||||
/*
|
/**
|
||||||
* I2PFirefoxProfileBuilder.java
|
* I2PFirefoxProfileBuilder.java
|
||||||
* Copyright (C) 2022 idk <hankhill19580@gmail.com>
|
* Copyright (C) 2022 idk <hankhill19580@gmail.com>
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
@ -35,7 +35,7 @@ public class I2PFirefoxProfileBuilder {
|
|||||||
return profileDir.getAbsolutePath();
|
return profileDir.getAbsolutePath();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/**
|
||||||
* get the profile directory, creating it if necessary
|
* get the profile directory, creating it if necessary
|
||||||
*
|
*
|
||||||
* @return the profile directory, or null if it could not be created
|
* @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
|
* get the base profile directory, creating it if necessary
|
||||||
*
|
*
|
||||||
* @return the base profile directory, or null if it could not be created
|
* @return the base profile directory, or null if it could not be created
|
||||||
@ -89,7 +89,7 @@ public class I2PFirefoxProfileBuilder {
|
|||||||
return baseProfileDir(rtd);
|
return baseProfileDir(rtd);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/**
|
||||||
* get the runtime directory, creating it if create=true
|
* get the runtime directory, creating it if create=true
|
||||||
*
|
*
|
||||||
* @param create if true, create the runtime directory if it does not exist
|
* @param create if true, create the runtime directory if it does not exist
|
||||||
@ -107,7 +107,7 @@ public class I2PFirefoxProfileBuilder {
|
|||||||
return new File(rtd);
|
return new File(rtd);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/**
|
||||||
* get the correct runtime directory
|
* get the correct runtime directory
|
||||||
*
|
*
|
||||||
* @return the runtime directory, or null if it could not be created or found
|
* @return the runtime directory, or null if it could not be created or found
|
||||||
@ -154,7 +154,7 @@ public class I2PFirefoxProfileBuilder {
|
|||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/**
|
||||||
* Copy the inert base profile directory to the runtime profile directory
|
* Copy the inert base profile directory to the runtime profile directory
|
||||||
*
|
*
|
||||||
* @since 0.0.1
|
* @since 0.0.1
|
||||||
@ -218,7 +218,7 @@ public class I2PFirefoxProfileBuilder {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/**
|
||||||
* Copy the strict options from the base profile to the profile
|
* Copy the strict options from the base profile to the profile
|
||||||
*
|
*
|
||||||
* @return true if successful, false otherwise
|
* @return true if successful, false otherwise
|
||||||
@ -256,7 +256,7 @@ public class I2PFirefoxProfileBuilder {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/**
|
||||||
* Construct a new Profile Builder
|
* Construct a new Profile Builder
|
||||||
*
|
*
|
||||||
* @since 0.0.1
|
* @since 0.0.1
|
||||||
@ -265,7 +265,7 @@ public class I2PFirefoxProfileBuilder {
|
|||||||
I2PFirefoxProfileBuilder.strict = false;
|
I2PFirefoxProfileBuilder.strict = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/**
|
||||||
* Construct a new Profile Builder
|
* Construct a new Profile Builder
|
||||||
* @param strict if true, the strict overrides will be copied to the profile
|
* @param strict if true, the strict overrides will be copied to the profile
|
||||||
*
|
*
|
||||||
|
@ -2,7 +2,7 @@ package net.i2p.i2pfirefox;
|
|||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
|
||||||
/*
|
/**
|
||||||
* I2PFirefoxProfileChecker.java
|
* I2PFirefoxProfileChecker.java
|
||||||
* Copyright (C) 2022 idk <hankhill19580@gmail.com>
|
* Copyright (C) 2022 idk <hankhill19580@gmail.com>
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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");
|
System.out.println("Profile directory is invalid");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/*
|
/**
|
||||||
* Return true if the profile directory is valid.
|
* Return true if the profile directory is valid.
|
||||||
*
|
*
|
||||||
* @param profileDirectory the profile directory to check
|
* @param profileDirectory the profile directory to check
|
||||||
@ -72,7 +72,7 @@ public class I2PFirefoxProfileChecker {
|
|||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
/*
|
/**
|
||||||
* Return true if the file is valid.
|
* Return true if the file is valid.
|
||||||
*
|
*
|
||||||
* @param file the file to check
|
* @param file the file to check
|
||||||
@ -99,7 +99,7 @@ public class I2PFirefoxProfileChecker {
|
|||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
/*
|
/**
|
||||||
* Return true if the extension directory is valid.
|
* Return true if the extension directory is valid.
|
||||||
*
|
*
|
||||||
* @param extensionDirectory the extension directory to check
|
* @param extensionDirectory the extension directory to check
|
||||||
|
@ -7,7 +7,7 @@ import java.nio.file.StandardCopyOption;
|
|||||||
import java.util.zip.ZipEntry;
|
import java.util.zip.ZipEntry;
|
||||||
import java.util.zip.ZipInputStream;
|
import java.util.zip.ZipInputStream;
|
||||||
|
|
||||||
/*
|
/**
|
||||||
* I2PFirefoxProfileUnpacker.java
|
* I2PFirefoxProfileUnpacker.java
|
||||||
* Copyright (C) 2022 idk <hankhill19580@gmail.com>
|
* Copyright (C) 2022 idk <hankhill19580@gmail.com>
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
@ -36,7 +36,7 @@ public class I2PFirefoxProfileUnpacker {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/**
|
||||||
* unpack the profile directory
|
* unpack the profile directory
|
||||||
*
|
*
|
||||||
* @return true if the profile directory was successfully unpacked
|
* @return true if the profile directory was successfully unpacked
|
||||||
|
@ -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
35
test.sh
@ -1,8 +1,33 @@
|
|||||||
#! /usr/bin/env sh
|
#! /usr/bin/env sh
|
||||||
|
|
||||||
GITHUB_USER=eyedeekay
|
|
||||||
GITHUB_REPO=i2p.plugins.firefox
|
|
||||||
ant distclean
|
ant distclean
|
||||||
cd src && \
|
ant jar
|
||||||
ant && cd ../
|
echo "Testing auto-selector with no private and no URL parameters."
|
||||||
./i2pbrowser.cmd
|
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"
|
Reference in New Issue
Block a user