react-native-view-shot
react-native-view-shot copied to clipboard
Unable To take a screenshot of a website's graph (Canvas) loaded inside Web view in React native
bug report
Unable To take a screenshot of a website's graph (Canvas) loaded inside Webview in React native
Version & Platform
"react-native-view-shot": "^3.1.2" "react-native": "0.61.5"
Platform: Android
Expected behavior
As the library supports web view screenshot. It was expected that it will be able to take a screenshot of a website chart inside a web view.
Actual behavior
There was no chart (canvas ) in the screenshot image generated.
Steps to reproduce the behavior
Are you sure you wait long enough before the screenshot? The web page might takes time to render the graph 🤔
There is the same problem with Google Earth and any video player in webview, the terrain model/video are just blank in screenshots.
I have the same problem using RNMapboxGL, does anyone have any idea what it is?
@gre I'm seeing the same thing, compare android with iOS:
Android

iOS

Setting androidHardwareAccelerationDisabled={true} on the WebView fixed it for me, not sure if it is a good solution though. EDIT: this cause serious performance issues (not a surprise) so it is not a viable workaround in my context.
hello, any updates?
Same issue here, trying to capture chart.js charts (rendered in a canvas tag) on Android and it doesn't work, on iOS it's fine though. Have tried androidHardwareAccelerationDisabled, and capturing the View container not the WebView directly, but no joy.
Same issue here, trying to capture chart.js charts (rendered in a canvas tag) on Android and it doesn't work, on iOS it's fine though. Have tried
androidHardwareAccelerationDisabled, and capturing the View container not the WebView directly, but no joy.
Same here
Same issue here, trying to capture chart.js charts (rendered in a canvas tag) on Android and it doesn't work, on iOS it's fine though. Have tried
androidHardwareAccelerationDisabled, and capturing the View container not the WebView directly, but no joy.
Has the problem been solved?
Same issue here, trying to capture chart.js charts (rendered in a canvas tag) on Android and it doesn't work, on iOS it's fine though. Have tried
androidHardwareAccelerationDisabled, and capturing the View container not the WebView directly, but no joy.Has the problem been solved?
No, I use injected script instead.
Same issue here, trying to capture chart.js charts (rendered in a canvas tag) on Android and it doesn't work, on iOS it's fine though. Have tried
androidHardwareAccelerationDisabled, and capturing the View container not the WebView directly, but no joy.Has the problem been solved?
No, I use injected script instead.
Can you share how you did that?
Same issue here, trying to capture chart.js charts (rendered in a canvas tag) on Android and it doesn't work, on iOS it's fine though. Have tried
androidHardwareAccelerationDisabled, and capturing the View container not the WebView directly, but no joy.Has the problem been solved?
No, I use injected script instead.
Can you share how you did that?
https://github.com/tiamed/bog-nimingban/blob/57aa63e90a1800984caa1658ed866e98001bdf85/screens/SketchScreen.tsx#L24