tuarua / WebViewANE

WebView Adobe Air Native Extension for macOS 10.10+, Windows Desktop, iOS 9.0+ and Android 19+. This ANE provides access to a more modern webview from AIR.
Apache License 2.0
183 stars 53 forks source link

Is there a way to close open popups? #170

Closed treylok closed 6 years ago

treylok commented 6 years ago

Thanks so much for developing, maintaining and offering this ANE to the community. I have a question rather than an issue and wasn't sure where else to post. I am want to use the ANE on a full screen windows kiosk environment and wanted to allow links on some web pages that appear as popups. I know popups are offered and they can be set to block, open a new window or be in the same window. I would like to have them open in a new window, but if a user continually selects a link that triggers a popup, they can potentially open hundreds of them and eat up memory or crash the app. Is there any way to close all open popups or have all popups open in the same new window?

Thanks in advance

tuarua commented 6 years ago

If you control opening the popup windows via JS then you can store a reference to the window and call window.close() in JS.

If you don't control that then no it's not possible without custom code added to the ANE. If you want to discuss that then please contact info@tuarua.co.uk for a quote.

tuarua commented 6 years ago

@treylok Please see latest release 1.8.2

settings.popup.behaviour = Behaviour.REPLACE;