194c6a2335
BREAKING CHANGE: This release introduces the `setSupportMultipleWindows` prop for Android. This sets the underlying Android WebView setting `setSupportMultipleWindows`. This prop defaults to `true` (previously `false`), and serves to mitigate the security advisory [CVE-2020-6506](https://github.com/react-native-webview/react-native-webview/security/advisories/GHSA-36j3-xxf7-4pqg). The primary way this new behavior changes existing React Native WebView implementations on Android is that links that open in new tabs/windows (such as `<a target="_blank">`) will now prompt to open in the system browser, rather than re-using the current WebView. If this behavior is not desirable, you can set this new prop to `false`, but be aware that this exposes your app to the security vulnerability listed above. Make sure you have read and understand the whole advisory and relevant links. iOS & Windows are unaffected. ```jsx <WebView // ... setSupportMultipleWindows={true} // default: true /> ``` Thanks to @mrcoinbase, @kelset, and @Titozzz for their work on this. |
||
---|---|---|
.. | ||
Contributing.md | ||
Custom-Android.md | ||
Custom-iOS.md | ||
Debugging.md | ||
Getting-Started.md | ||
Guide.md | ||
README.portuguese.md | ||
Reference.md |
README.portuguese.md
React Native WebView - Um moderno, multiplataforma WebView para React Native
React Native WebView é um moderno, bem apoiado, e multiplataforma WebView para React Native. É projetado para substituir o WebView embutido(que sera removido do core).
Mantenedores principais - Empresas Patrocinadoras
Esse projeto é mantido gratuitamente por essas pessoas usando ambos seu tempo livre e tempo de trabalho na empresa.
- Thibault Malbranche (Twitter @titozzz) from Brigad
- Jamon Holmgren (Twitter @jamonholmgren) from Infinite Red
Plataformas suportadas
- iOS
- Android
- macOS
- Windows
Nota: O suporte da Expo para o React Native WebView começou com Expo SDK v33.0.0.
Começando
Leia nosso Getting Started Guide. Se algum passo não ficou claro, por favor, crie um issue detalhado.
Versionamento
Esse projeto segue versionamento semântico. Não hesitamos em lançar as alterações mais recentes, mas elas estarão em uma versão principal.
Histórico:
-
8.0.0 - onNavigationStateChange agora é disparado quando alterado o hash da URL.
-
7.0.1 - UIWebView removido.
-
6.0.2 - Update para AndroidX. Tenha certeza de habilitar no
android/gradle.properties
do seu projeto. Veja o Getting Started Guide. -
5.0.1 - Refatorou a antiga implementação postMessage para comunicação da visualização da webview para nativa.
-
4.0.0 - Cache adicionada(habilitada por padrão).
-
3.0.0 - WKWebview: Adicionado um pool de processos compartilhados para que os cookies e o localStorage sejam compartilhados nas webviews no iOS (habilitadas por padrão)
-
2.0.0 - Primeiro lançamento, esta é uma réplica do componente principal do webview.
Seguinte:
- remoção do this.webView.postMessage() ( nunca documentado e menos flexível que o injectJavascript) -> Como migrar
- Reescrita em Kotlin
- talvez reescrita em Swift
Uso
Importe o componente WebView
de react-native-webview
e use assim:
import React, { Component } from 'react';
import { StyleSheet, Text, View } from 'react-native';
import { WebView } from 'react-native-webview';
// ...
class MyWebComponent extends Component {
render() {
return <WebView source={{ uri: 'https://reactnative.dev/' }} />;
}
}
Para mais informações, leia a API Reference e o Guia. Se você está interessado em contribuir, confira o Guia de contribuição.
Problemas comuns
- Se você está recebendo
Invariant Violation: Native component for "RNCWebView does not exist"
provavelmente significa que você esqueceu de rodarreact-native link
ou houve algum erro no processo de linking.
Contribuindo
Veja Contributing.md
Contribuidores
Obrigado vai a essas pessoas maravilhosas (emoji key):
Esse projeto segue a especificação all-contributors. Contribuições de qualquer tipo são bem-vindas!
Licença
MIT
Traduções
Esse readme está disponível em: