I’ve done virtually all of my plug-in work on Windows. Under Windows, whenever one shows a WD, the html page fires a ‘window load’ or ‘document DOMContentLoaded’ event. Additionally, a ‘window unload’ event fires whenever the WD is closed.
On a Mac, from various forum posts and ThomThom’s guide, it’s my impression that the ‘window load’ and ‘document DOMContentLoaded’ events fire after one sets the html for the WD. So, on a Mac –
Do any DOM events fire when the WD is shown?
If not, can one set DOM properties immediately after the WD is shown, or is it best to do so via the block passed to WD.show?
Do any DOM events fire when the WD is closed?
if not, can one query the DOM (or call WD.execute_script) when the WD.set_on_close block is called?
Just thought of something. If, on a Mac, the DOM fires events after one sets the html for the WD, the implication is that the DOM is accessible regardless of whether the WD is visible or not.
Hence, do callbacks and execute_script work all the time?
Yea, the webdialogs act differently depending on the platform. This is due to the different implementations of a web view for the different web engines. Unfortunate and confusing.
Just be aware that on Mac, show_modal doesn’t do everything you might expect. It pops the window to the front, but does not lock input to that window the way one expects from a “modal” dialog.
Yes, I use dialog#show_modal just because the window always stay on front. dialog#show on mac doesn’t do that.
In my case I don’t need to lock input too.