Hi,
I'm using a popup menu on a WebViewGadget to provide a context menu. The problem is, when the menu is open, the WebViewGadget still responds to the mouse moving, etc., causing issues. I tried DisableGadget, but it didn't work. Is it possible to temporarily disable JavaScript while the menu is open? I imagine I'd then need a way to detect when the menu closes.
I found this: https://developer.apple.com/documentati ... references, but I don't really know how to access it using CocoaMessage.
Disable JavaScript
Re: Disable JavaScript
I figured it out:
Code: Select all
webview = CocoaMessage(0, GadgetID(0), "contentView")
config = CocoaMessage(0, webview, "configuration")
preferences = CocoaMessage(0, config, "preferences")
CocoaMessage(0, preferences, "setJavaScriptEnabled:", #False)