mirror of
https://github.com/GopeedLab/gopeed.git
synced 2026-11-19 06:43:42 +00:00
feat(extension): add host environment and WebView page events (#1527)
This commit is contained in:
31 files changed
+1480
-184
No files matched your search
@@ -181,3 +181,11 @@ func (d *Downloader) removeExtensionWebViewProfile(identity string) error {
|
||||
}
|
||||
return os.RemoveAll(path)
|
||||
}
|
||||
|
||||
func (p *extensionWebViewPage) On(event string, handler func(enginewebview.Event)) (func(), error) {
|
||||
source, ok := p.Page.(enginewebview.EventSource)
|
||||
if !ok {
|
||||
return nil, fmt.Errorf("WebView provider does not support events")
|
||||
}
|
||||
return source.On(event, handler)
|
||||
}
|
||||
Reference in new issue
Block a user