Documentation
¶
Overview ¶
Package debugger implements a general purpose debugger server.
The current implementation supports the ability to build a Chrome DevTools compatible server.
There are plans to support VSCode at some point.
Usage:
See cmd/fake/fake.go for a fake debugger server.
Index ¶
- func Handler(d Driver) http.Handler
- type Dispatcher
- type Driver
- type FakeNetwork
- func (FakeNetwork) ClearBrowserCache() error
- func (FakeNetwork) ClearBrowserCookies() error
- func (FakeNetwork) DeleteCookies(req *nw.DeleteCookiesParams) error
- func (FakeNetwork) Disable() error
- func (FakeNetwork) EmulateNetworkConditions(req *nw.EmulateNetworkConditionsParams) error
- func (FakeNetwork) Enable() (*nw.EnableParams, error)
- func (FakeNetwork) GetAllCookies() (*nw.GetAllCookiesReturns, error)
- func (FakeNetwork) GetCertificate(req *nw.GetCertificateParams) (*nw.GetCertificateReturns, error)
- func (FakeNetwork) GetCookies(req *nw.GetCookiesParams) (*nw.GetCookiesReturns, error)
- func (FakeNetwork) GetRequestPostData(req *nw.GetRequestPostDataParams) (*nw.GetRequestPostDataReturns, error)
- func (FakeNetwork) GetResponseBody(req *nw.GetResponseBodyParams) (*nw.GetResponseBodyReturns, error)
- func (FakeNetwork) ReplayXHR(req *nw.ReplayXHRParams) error
- func (FakeNetwork) SearchInResponseBody(req *nw.SearchInResponseBodyParams) (*nw.SearchInResponseBodyReturns, error)
- func (FakeNetwork) SetBlockedURLs(req *nw.SetBlockedURLSParams) error
- func (FakeNetwork) SetBypassServiceWorker(req *nw.SetBypassServiceWorkerParams) error
- func (FakeNetwork) SetCacheDisabled(req *nw.SetCacheDisabledParams) error
- func (FakeNetwork) SetCookie(req *nw.SetCookieParams) (*nw.SetCookieReturns, error)
- func (FakeNetwork) SetCookies(req *nw.SetCookiesParams) error
- func (FakeNetwork) SetDataSizeLimitsForTest(req *nw.SetDataSizeLimitsForTestParams) error
- func (FakeNetwork) SetExtraHTTPHeaders(req *nw.SetExtraHTTPHeadersParams) error
- type Network
- type Target
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Dispatcher ¶
Dispatcher dispatches a message to the driver. The response is also just filled in directly.
type Driver ¶
type Driver interface {
Name() string
List() ([]*Target, error)
Network() Network
Dispatcher
}
Driver is the actual implementation that drivers need to implement.
type FakeNetwork ¶
type FakeNetwork struct{}
func (FakeNetwork) ClearBrowserCache ¶
func (FakeNetwork) ClearBrowserCache() error
func (FakeNetwork) ClearBrowserCookies ¶
func (FakeNetwork) ClearBrowserCookies() error
func (FakeNetwork) DeleteCookies ¶
func (FakeNetwork) DeleteCookies(req *nw.DeleteCookiesParams) error
func (FakeNetwork) Disable ¶
func (FakeNetwork) Disable() error
func (FakeNetwork) EmulateNetworkConditions ¶
func (FakeNetwork) EmulateNetworkConditions(req *nw.EmulateNetworkConditionsParams) error
func (FakeNetwork) Enable ¶
func (FakeNetwork) Enable() (*nw.EnableParams, error)
func (FakeNetwork) GetAllCookies ¶
func (FakeNetwork) GetAllCookies() (*nw.GetAllCookiesReturns, error)
func (FakeNetwork) GetCertificate ¶
func (FakeNetwork) GetCertificate(req *nw.GetCertificateParams) (*nw.GetCertificateReturns, error)
func (FakeNetwork) GetCookies ¶
func (FakeNetwork) GetCookies(req *nw.GetCookiesParams) (*nw.GetCookiesReturns, error)
func (FakeNetwork) GetRequestPostData ¶
func (FakeNetwork) GetRequestPostData(req *nw.GetRequestPostDataParams) (*nw.GetRequestPostDataReturns, error)
func (FakeNetwork) GetResponseBody ¶
func (FakeNetwork) GetResponseBody(req *nw.GetResponseBodyParams) (*nw.GetResponseBodyReturns, error)
func (FakeNetwork) ReplayXHR ¶
func (FakeNetwork) ReplayXHR(req *nw.ReplayXHRParams) error
func (FakeNetwork) SearchInResponseBody ¶
func (FakeNetwork) SearchInResponseBody(req *nw.SearchInResponseBodyParams) (*nw.SearchInResponseBodyReturns, error)
func (FakeNetwork) SetBlockedURLs ¶
func (FakeNetwork) SetBlockedURLs(req *nw.SetBlockedURLSParams) error
func (FakeNetwork) SetBypassServiceWorker ¶
func (FakeNetwork) SetBypassServiceWorker(req *nw.SetBypassServiceWorkerParams) error
func (FakeNetwork) SetCacheDisabled ¶
func (FakeNetwork) SetCacheDisabled(req *nw.SetCacheDisabledParams) error
func (FakeNetwork) SetCookie ¶
func (FakeNetwork) SetCookie(req *nw.SetCookieParams) (*nw.SetCookieReturns, error)
func (FakeNetwork) SetCookies ¶
func (FakeNetwork) SetCookies(req *nw.SetCookiesParams) error
func (FakeNetwork) SetDataSizeLimitsForTest ¶
func (FakeNetwork) SetDataSizeLimitsForTest(req *nw.SetDataSizeLimitsForTestParams) error
func (FakeNetwork) SetExtraHTTPHeaders ¶
func (FakeNetwork) SetExtraHTTPHeaders(req *nw.SetExtraHTTPHeadersParams) error
type Network ¶
type Network interface {
ClearBrowserCache() error
ClearBrowserCookies() error
DeleteCookies(req *nw.DeleteCookiesParams) error
Disable() error
EmulateNetworkConditions(req *nw.EmulateNetworkConditionsParams) error
Enable() (*nw.EnableParams, error)
GetAllCookies() (*nw.GetAllCookiesReturns, error)
GetCertificate(req *nw.GetCertificateParams) (*nw.GetCertificateReturns, error)
GetCookies(req *nw.GetCookiesParams) (*nw.GetCookiesReturns, error)
GetResponseBody(req *nw.GetResponseBodyParams) (*nw.GetResponseBodyReturns, error)
GetRequestPostData(req *nw.GetRequestPostDataParams) (*nw.GetRequestPostDataReturns, error)
ReplayXHR(req *nw.ReplayXHRParams) error
SearchInResponseBody(req *nw.SearchInResponseBodyParams) (*nw.SearchInResponseBodyReturns, error)
SetBlockedURLs(req *nw.SetBlockedURLSParams) error
SetBypassServiceWorker(req *nw.SetBypassServiceWorkerParams) error
SetCacheDisabled(req *nw.SetCacheDisabledParams) error
SetCookie(req *nw.SetCookieParams) (*nw.SetCookieReturns, error)
SetCookies(req *nw.SetCookiesParams) error
SetDataSizeLimitsForTest(req *nw.SetDataSizeLimitsForTestParams) error
SetExtraHTTPHeaders(req *nw.SetExtraHTTPHeadersParams) error
}
See https://github.com/chromedp/cdproto/blob/master/network/network.go
type Target ¶
type Target struct {
// these fields are filled in by calling Init(prefix, ID)
ID string `json:"id"`
FrontEndURL string `json:"devtoolsFrontendUrl"`
FrontEndURLCompat string `json:"devtoolsFrontendUrlCompat"`
DebuggerURL string `json:"webSocketDebuggerUrl"`
// Optional fields
Description string `json:"description"`
FaviconURL string `json:"faviconUrl"`
Title string `json:"title"`
Type string `json:"type"`
URL string `json:"url"`
}
Target is a debugger target. Use Init() to fill in the required fields.
func (*Target) Init ¶
Init must be called with a prefix like "http://localhost:9222/"
Directories
¶
| Path | Synopsis |
|---|---|
|
cmd
|
|
|
fake
command
Package main illustrates how to run a debugger server that chrome dev tools can connect to.
|
Package main illustrates how to run a debugger server that chrome dev tools can connect to. |
|
proxy
command
nolint: gochecknoglobals chromedp-proxy provides a cli utility that will proxy requests from a Chrome DevTools Protocol client to a browser instance.
|
nolint: gochecknoglobals chromedp-proxy provides a cli utility that will proxy requests from a Chrome DevTools Protocol client to a browser instance. |
Click to show internal directories.
Click to hide internal directories.