React Native WebView 11.0 adds setSupportMultipleWindows on Android
React Native WebView version 11.0.0 was released on 2020-11-24. The release contains a single feature, which is also a breaking change for Android users.
New prop: setSupportMultipleWindows
The release introduces the setSupportMultipleWindows prop for Android. It sets the underlying Android WebView setting of the same name, setSupportMultipleWindows. The prop defaults to true (previously false), and its purpose is to mitigate the security advisory CVE-2020-6506.
<WebView
// ...
setSupportMultipleWindows={true} // default: true
/>
Breaking change on Android
According to the release notes, the main way this changes existing React Native WebView implementations on Android concerns links that open in new tabs or windows, such as <a target="_blank">. These links will now prompt to open in the system browser instead of re-using the current WebView.
Developers who do not want this behavior can set the new prop to false. The release notes warn that doing so exposes an app to the security vulnerability described in the advisory, and recommend reading and understanding the whole advisory and its relevant links before making that change.
iOS and Windows are unaffected by this change.
Credits
The change was contributed in #1747 by @mrcoinbase and @kelset, with the release notes also thanking @Titozzz for work on it.
Links
Source: github.com