Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[0.56] WebView source={html: "<div>test<div>"} return error #19986

Closed
3 tasks
tamirrab opened this issue Jun 30, 2018 · 4 comments
Closed
3 tasks

[0.56] WebView source={html: "<div>test<div>"} return error #19986

tamirrab opened this issue Jun 30, 2018 · 4 comments
Labels
Component: WebView Related to the WebView component. Resolution: Locked This issue was locked by the bot.

Comments

@tamirrab
Copy link

Environment

React Native Environment Info:
System:
OS: macOS 10.14
CPU: x64 Intel(R) Core(TM) i7-4870HQ CPU @ 2.50GHz
Memory: 97.80 MB / 16.00 GB
Shell: 5.3 - /bin/zsh
Binaries:
Node: 8.9.4 - /usr/local/bin/node
Yarn: 1.7.0 - /usr/local/bin/yarn
npm: 6.1.0 - /usr/local/bin/npm
Watchman: 4.7.0 - /usr/local/bin/watchman
SDKs:
iOS SDK:
Platforms: iOS 11.4, macOS 10.13, tvOS 11.4, watchOS 4.3
IDEs:
Android Studio: 3.1 AI-173.4819257
Xcode: 9.4.1/9F2000 - /usr/bin/xcodebuild
npmPackages:
react: ^16.4.1 => 16.4.1
react-native: 0.56.0-rc.4 => 0.56.0-rc.4
npmGlobalPackages:
create-react-native-app: 1.0.0
react-native-cli: 2.0.1
react-native-communications: 2.2.1
react-native-debugger-open: 0.3.11
react-native-fetch-blob: 0.10.5
react-native-git-upgrade: 0.2.7

Description

WebView source={html: <div>test<div>} return error:

YellowBox.js:67 Possible Unhandled Promise Rejection (id: 0):
Error: Unable to open URL: about:blank
Error: Unable to open URL: about:blank
at createErrorFromErrorData (blob:http://localhost:8081/dba704fb-6fe0-4995-81aa-6f0f037a217c:2270:17)
at blob:http://localhost:8081/dba704fb-6fe0-4995-81aa-6f0f037a217c:2222:27
at MessageQueue.__invokeCallback (blob:http://localhost:8081/dba704fb-6fe0-4995-81aa-6f0f037a217c:2658:18)
at blob:http://localhost:8081/dba704fb-6fe0-4995-81aa-6f0f037a217c:2409:18
at MessageQueue.__guard (blob:http://localhost:8081/dba704fb-6fe0-4995-81aa-6f0f037a217c:2561:13)
at MessageQueue.invokeCallbackAndReturnFlushedQueue (blob:http://localhost:8081/dba704fb-6fe0-4995-81aa-6f0f037a217c:2408:14)
at http://localhost:8081/debugger-ui/debuggerWorker.js:72:58
console.warn @ YellowBox.js:67
onUnhandled @ Promise.js:43
onUnhandled @ rejection-tracking.js:71
(anonymous) @ JSTimers.js:255
_callTimer @ JSTimers.js:151
callTimers @ JSTimers.js:404
__callFunction @ MessageQueue.js:344
(anonymous) @ MessageQueue.js:107
__guard @ MessageQueue.js:291
callFunctionReturnFlushedQueue @ MessageQueue.js:106
(anonymous) @ debuggerWorker.js:72

Reproducible Demo

<WebView source={{html: "<div>test</div>"}}/>

@react-native-bot react-native-bot added the Component: WebView Related to the WebView component. label Jun 30, 2018
@francisco-sanchez-molina

Can you test this line?
<WebView originWhitelist={['*']} source={{ html: "<div>test</div>", baseUrl: '' }} />

@tamirrab
Copy link
Author

tamirrab commented Jul 2, 2018

Working perfect after adding originWhitelist={['*']}
Thanks! 👍

@tamirrab tamirrab closed this as completed Jul 2, 2018
iou90 added a commit to iou90/react-native-autoheight-webview that referenced this issue Jul 12, 2018
@msageryd
Copy link

Thank you @francisco-sanchez-molina !
This made react-native-signature-pad working with RN 0.56.

I'm sorry for posting in a closed issue. But if you have answers to my below questions I fell that they belong in this thread for clarification.

  • why do we need to whitelist * now and not before?
  • what is the webView trying to open when failing the whitelist test? "about:blank" is kind of hard to debug.

@rodrigobdz
Copy link

WebView documentation is very lacking. I spent endless hours figuring this out.

dmitryn added a commit to status-im/status-mobile that referenced this issue Sep 5, 2018
dmitryn added a commit to status-im/status-mobile that referenced this issue Sep 5, 2018
@facebook facebook locked as resolved and limited conversation to collaborators Jul 2, 2019
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Jul 2, 2019
mnramo added a commit to mnramo/react-native-autoheight-webview that referenced this issue May 13, 2023
idealdev00000 added a commit to idealdev00000/WebView-ReactNative that referenced this issue Apr 25, 2024
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
Component: WebView Related to the WebView component. Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

5 participants