Skip to content

Add Android popup support; add popupNavigate event for both platforms#29

Open
modos189 wants to merge 1 commit into
nativescript-community:masterfrom
modos189:feat/android-popup
Open

Add Android popup support; add popupNavigate event for both platforms#29
modos189 wants to merge 1 commit into
nativescript-community:masterfrom
modos189:feat/android-popup

Conversation

@modos189
Copy link
Copy Markdown
Contributor

Android

Introduces PopupWebChromeClient - a delegating wrapper around the existing WebChromeClient that intercepts onCreateWindow and presents the popup in a bottom-sheet-style Dialog. BottomSheetDialog (Material Components) was intentionally avoided to preserve the project's stated Android 19+ support; swipe-to-dismiss is implemented manually using VelocityTracker and touch event interception on both the toolbar and the WebView content area (when scrolled to top). The popup WebView inherits the parent's user-agent string.

target="_blank" links opened from inside an already-open popup are forwarded to the system browser rather than nesting another sheet.

A new optional createWebChromeClient factory is added alongside the existing createWebViewClient, using the same (webview, clientClass) => Client pattern.

iOS

A WKNavigationDelegate is attached to the popup WKWebView so that navigation events are now surfaced through the shared popupNavigate event, consistent with Android.

New API

name description
supportPopups Now works on Android in addition to iOS. Defaults to true.
popupNavigate event Fired on every navigation inside the popup. Set args.cancel = true to close it and handle the URL in app code.
createWebChromeClient Android: optional factory to provide a custom WebChromeClient, same pattern as createWebViewClient.

@modos189 modos189 marked this pull request as draft May 25, 2026 07:56
@modos189 modos189 force-pushed the feat/android-popup branch from 02f004a to ec6b738 Compare May 25, 2026 08:11
@modos189 modos189 marked this pull request as ready for review May 25, 2026 08:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant