Package fcw wraps a Firefox process from start-to-finish, and allows the user to pass a profile directory to that process where it will find pre-configured settings. It’s useful for using Firefox as an interface to applications, and for applying specific settings for use when browsing overlay networks like Tor or I2P.
FirefoxExecutable returns a string which points to the preferred Firefox executable file as calculated by the LocateFirefox variable
var FirefoxExecutable = LocateFirefox
func LocateFirefox() string
LocateFirefox returns a path to the Firefox binary, or an empty string if Firefox installation is not found.
func MessageBox(title, text string) bool
MessageBox creates a dialog box which prompts the user to download and install Firefox if they have not already.
func PortablePath() string
PortablePath determines if there is a “Portable” Firefox in a sub-directory of the runtime directory
func PromptDownload()
PromptDownload asks user if they want to download and install Firefox, and opens a download web page if the user agrees.
func Run() error
Run creates a basic instance of the Firefox manager with a default profile directory and launches duckduckgo.com
func UnpackApp(profileDir string) (string, error)
UnpackApp unpacks a “App” mode profile into the “profileDir” and returns the path to the profile and possibly, an error if something goes wrong. If everything works, the error will be nil
type UI interface { ... }
UI is a wrapper/manager for a Firefox external process.
func BasicFirefox(userdir string, private bool, args ...string) (UI, error)
BasicFirefox sets up a new Firefox instance, and creates the profile directory if it does not already exist.
func NewFirefox(url, dir string, width, height int, customArgs ...string) (UI, error)
NewFirefox creates a new instance of the Firefox manager.
func WebAppFirefox(userdir string, private bool, args ...string) (UI, error)
WebAppFirefox sets up a new Firefox instance, and creates the profile directory if it does not already exist. It turns Firefox into a WebApp-Viewer with the provided profile
Readme created from Go doc with goreadme
MIT License
Copyright (c) 2020 idk
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Hide license