Skip to content

Conversation

@Nodonisko
Copy link

@Nodonisko Nodonisko commented Jan 15, 2026

Add two new props:

allowFileDownloads - block all downloads that could be triggered by WebView (could be toggled during runtime)
suppressJavaScriptDialogs - block all JS dialogs (alert/prompt/confirm) (could be toggled during runtime)

I also added code to test these props to example app and fixed some TS errors by creating proper tsconfig.json for example app.


Note

Adds new runtime-configurable props and wires them through native code and types.

  • New props: suppressJavaScriptDialogs (Android, iOS) to block alert/confirm/prompt; allowFileDownloads (Android) to disable all downloads
  • Android: gate downloads in RNCWebView, RNCWebViewManagerImpl DownloadListener, and BlobFileDownloader; add JS dialog suppression via RNCWebChromeClient (onJsAlert/Confirm/Prompt) with shouldSuppressDialogs(); expose props via old/new arch managers
  • iOS: suppress JS dialogs in RNCWebViewImpl by short-circuiting alert/confirm/prompt handlers; export prop in RNCWebViewManager.mm and map in RNCWebView.mm
  • Types/bridge: add props to RNCWebViewNativeComponent.ts and WebViewTypes.ts
  • Docs/examples: document both props in docs/Reference.md; add toggles and demos in example/examples/Alerts.tsx and Downloads.tsx; add example tsconfig.json and update metro.config.js

Written by Cursor Bugbot for commit 9e9ec5e. This will update automatically on new commits. Configure here.

@Nodonisko Nodonisko changed the title Feat/improve security feat: add allowFileDownloads and suppressJavaScriptDialogs props Jan 15, 2026
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