Not working on iOS devices
See original GitHub issueHello,
I´m using html2canvas with Wordpress. It works fine on every desktop/android device but iOS is not working. I have tested iPhone SE (iOS 11.2.1) Safari/Chrome and iPad 2 (iOS 9.3.5) Safari/Chrome. I´m using 1.0.0-alpha.9 html2canvas. It returns only white background as img. You can test it here - http://konf.inforadar.sk - “Uložit do galerie” is a save to gallery button and in top right corner is a gallery (galeria).
Code:
<script src="inc/html2canvas.min.js"></script>
<script type="text/javascript">
jQuery(document).on("click", "#vpc-add-to-cart", function(event) { takeScreenshot(); event.stopImmediatePropagation(); } );
function takeScreenshot() {
var element = jQuery("#vpc-preview")[0];
html2canvas(element, { "background": "#FFFFFF" }).then(function(canvas) {
var imgData = canvas.toDataURL('image/jpeg',1.0);
jQuery.ajax({
url: 'gallery/save.php',
type: 'post',
dataType: 'text',
data: { base64data: imgData }
});
window.alert('Uloženo!');
});
}
</script>
Any advice? Thank you very much!
Issue Analytics
- State:
- Created 6 years ago
- Reactions:2
- Comments:15
Top Results From Across the Web
If your iPhone or iPad won't connect to a Wi-Fi network
If you're using iOS or iPadOS 15 or later, tap Settings > General > Transfer or Reset [Device] > Reset > Reset Network...
Read more >A device attached to the system is not functioning? Easy fix here!
The first thing to check ... In some cases, the error can occur because of a connectivity issue between the USB device (in...
Read more >Troubleshoot managed iOS devices for users - Google Support
If the user's device is set up correctly, make sure that iOS Sync is enabled for the device: Sign in to your Google...
Read more >[Solved] How to Fix Move to iOS Not Working - iMobie Help
How to Fix Move to iOS Not Working · 1. Check and Download the latest firmware on both devices. · 2. Set your...
Read more >iOS 16 Problems: 11 Common iPhone Issues and How to Fix ...
Simply restarting the iPhone may resolve wi-fi issues. Also, make sure the wi-fi network is active and online for other devices. If all...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
found this solution.
https://cdnjs.cloudflare.com/ajax/libs/html2canvas/0.5.0-alpha1/html2canvas.min.js
seems to be working on safari/IOS devices but not on chrome/android@msbir
Thanks for sharing this solution. For Safari, it’s working now with [ 1.0.0-rc.7 js]
Is there is any generic library for both browsers? Currently, I’m using this library for Android and IOS [ Chrome and Safari ] for hybrid mobile application.
Now to achieve this I’m loading 2 different html2canvas.min.js. If you could share common js [ CDN link ] which support both platforms it will be very helpful to optimize the app.