-
Notifications
You must be signed in to change notification settings - Fork 4
feat: allow passing active prop that allows preventing inactive webivews from showing JS alerts
#16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: allow passing active prop that allows preventing inactive webivews from showing JS alerts
#16
Conversation
…siblity of showing alerts if a webview is inactive
📝 WalkthroughWalkthroughAdds an Changes
Sequence Diagram(s)mermaid 🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In
`@android/src/main/java/com/reactnativecommunity/webview/RNCWebChromeClient.java`:
- Around line 485-513: Fix the minor typo in the JavaDoc comment above onJsAlert
in RNCWebChromeClient: change "webiew" to "webview" so the comment reads
"Security: Prevent dialogs from being presented when webview is inactive." Leave
the implementation of onJsAlert, onJsConfirm, and onJsPrompt unchanged.
android/src/main/java/com/reactnativecommunity/webview/RNCWebChromeClient.java
Show resolved
Hide resolved
adf5e8f to
ef14789
Compare
ef14789 to
176afdb
Compare
This PR introduces a new native prop for the webview.
The new prop is
active: boolean.When webview is marked
active={false}JS alerts will be prevented from being shown to the user.When webview is marked
active={true}or the prop is not passed at all, alerts will show like they normally do.Summary by CodeRabbit
New Features
activeproperty to control whether a WebView is considered active.Chores
✏️ Tip: You can customize this high-level summary in your review settings.