mirror of
https://github.com/GopeedLab/gopeed.git
synced 2026-11-17 13:53:41 +00:00
feat(extension): expose host version and WebView page events
This commit is contained in:
1 parent
7c1447f659
commit
dfe8e9a3fd
27 files changed
+1230
-191
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