feat(webview): add proxy support and per-extension profile lifecycle (#1517)

This commit is contained in:
Levi authored and GitHub committed 2026-09-16 23:17:43 +08:00
1 parent e99ef6c7f4
commit 21702d5d46
32 files changed
+1708 -45

No files matched your search

+12
View File
@@ -5,6 +5,7 @@ import "encoding/json"
const RPCEndpointPath = "/webview"
const (
MethodProfileRemove = "profile.remove"
MethodIsAvailable = "webview.isAvailable"
MethodPageOpen = "page.open"
MethodPageAddInitScript = "page.addInitScript"
@@ -68,6 +69,9 @@ type IsAvailableResult struct {
}
type PageOpenParams struct {
ProfileID string `json:"profileId,omitempty"`
DataPath string `json:"dataPath,omitempty"`
ProxyURL string `json:"proxyUrl,omitempty"`
Headless bool `json:"headless,omitempty"`
Debug bool `json:"debug,omitempty"`
Title string `json:"title,omitempty"`
@@ -78,6 +82,9 @@ type PageOpenParams struct {
func NewPageOpenParams(opts OpenOptions) PageOpenParams {
return PageOpenParams{
ProfileID: opts.ProfileID,
DataPath: opts.DataPath,
ProxyURL: opts.ProxyURL,
Headless: opts.Headless,
Debug: opts.Debug,
Title: opts.Title,
@@ -141,3 +148,8 @@ type PageCloseParams struct {
}
type EmptyResult struct{}
// ProfileRemoveParams belongs to the private host RPC.
type ProfileRemoveParams struct {
ProfileID string `json:"profileId"`
}