Documentation
¶
Overview ¶
Package browser is the main entry point for Gost, helping create a window initialized with a script enging, connected to a server.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Browser ¶
type Browser struct {
Client http.Client
ScriptHost ScriptHost
Logger log.Logger
// contains filtered or unexported fields
}
Pretty stupid right now, but should _probably_ allow handling multiple windows/tabs. This used to be the case for _some_ identity providers, but I'm not sure if that even work anymore because of browser security.
func New ¶
func New(options ...BrowserOption) *Browser
New initialises a new Browser with the default script engine.
func NewBrowser
deprecated
func NewBrowser() *Browser
Deprecated: NewBrowser should not be called. Call New instead.
This method will selfdestruct in 10 commits
func NewBrowserFromHandler
deprecated
func NewFromHandler
deprecated
NewFromHandler initialises a new Browser with with an http.Handler
Deprecated: Prefer browser.New(browser.WithHandler(...)) instead.
func (*Browser) Open ¶
Open will open a new html.Window, loading the specified location. If the server does not respons with a 200 status code, an error is returned.
See html.NewWindowReader about the return value, and when the window returns.
type BrowserOption ¶ added in v0.5.1
type BrowserOption func(*browserConfig)
func WithHandler ¶ added in v0.5.1
func WithHandler(h http.Handler) BrowserOption
WithHandler configures the browser's http.Client to use an http.Roundtripper that bypasses the TCP stack and calls directly into the specified handler as a normal function call.
Note: There is a current limitation that NO requests from the browser will be sent when using this. So sites will not work if they
- Depend on content from CDN
- Depend on an external service, e.g., an identity provider.
That is a limitation that was the result of prioritising more important, and higher risk features.
func WithLogger ¶ added in v0.5.1
func WithLogger(l *slog.Logger) BrowserOption
Directories
¶
| Path | Synopsis |
|---|---|
|
browser
module
|
|
|
Package dom provides the fundamental DOM implementation for Gost-DOM.
|
Package dom provides the fundamental DOM implementation for Gost-DOM. |
|
event
Package event contains core browser event behavior
|
Package event contains core browser event behavior |
|
Package html works on top of the DOM to implement specific HTML elements.
|
Package html works on top of the DOM to implement specific HTML elements. |
|
internal
|
|
|
clock
Package clock provides a simulated time for Gost-DOM.
|
Package clock provides a simulated time for Gost-DOM. |
|
constants
Package constants is a collection of values that are used many times in the implementation, but has no relevance to users of the library, e.g., a link to where you can file an issue when you encounter a not-implemented feature; or a feature that is not fully implemented, e.g.
|
Package constants is a collection of values that are used many times in the implementation, but has no relevance to users of the library, e.g., a link to where you can file an issue when you encounter a not-implemented feature; or a feature that is not fully implemented, e.g. |
|
interfaces
Package interfaces contains go interfaces generated from IDL specs
|
Package interfaces contains go interfaces generated from IDL specs |
|
interfaces/url-interfaces
Package urlinterfaces contains internal code representing the IDL interfaces in the URL API
[URL API]: https://developer.mozilla.org/en-US/docs/Web/API/URL_API
|
Package urlinterfaces contains internal code representing the IDL interfaces in the URL API [URL API]: https://developer.mozilla.org/en-US/docs/Web/API/URL_API |
|
log
Package log contains functions used internally for logging to a default logger implementing slog.Logger.
|
Package log contains functions used internally for logging to a default logger implementing slog.Logger. |
|
test/integration/test-app-main
command
|
|
|
test/scripttests
Package scripttests contains a specification of the behaviour of client-side scripting.
|
Package scripttests contains a specification of the behaviour of client-side scripting. |
|
testing/gomega-matchers
Package gomegamatchers just exposes gomega matchers for easier importing.
|
Package gomegamatchers just exposes gomega matchers for easier importing. |
|
testing/htmltest
Package htmltest contains test helpers when working with the html package
|
Package htmltest contains test helpers when working with the html package |
|
Package logger provides the basic functionality of supplying a custom logger.
|
Package logger provides the basic functionality of supplying a custom logger. |
|
gojahost
The gojahost package provides functionality to execute client-scripts in gost-dom.
|
The gojahost package provides functionality to execute client-scripts in gost-dom. |
|
v8host
The v8host packages provides functionality to execute client-side scripts in gost-dom.
|
The v8host packages provides functionality to execute client-side scripts in gost-dom. |
|
testing
|
|
|
gomega-matchers
Package matchers contains custom matches for use with the [Gomega] assertion library.
|
Package matchers contains custom matches for use with the [Gomega] assertion library. |
|
Package url contains types defined in the url web IDL spec.
|
Package url contains types defined in the url web IDL spec. |