Closed awulkan closed 2 years ago
I too am wondering this, having to bind quite a lot of Go functions. Perhaps chrome.bind()
could be modified so that it accepts an optional argument, which would specify the global variable to bind()
to? Are there any potential issues with this?
https://github.com/zserge/lorca/blob/0261ab7a85a37f49374cf86665bf1dee7b9086ab/chrome.go#L396
I don't think it's a good idea to bind functions to the global
window
object, there's a large chance that people will be overriding browser functionality by naming things the same as existing functionality.Is there any way to prevent this by default? Maybe everything could be bound to a sub-object of
window
? So that it could be accessible through something likelorca.myFunction()
.