I've been experiencing behaviour on, at least my iPhone 6 Plus, when using the <input type="file">
to let the user upload an image.
<div class="add__from-camera"> <button class="add__from-camera__btn"> <i class="fa fa-fw fa-camera"></i> Add with Camera </button> <input class="add__from-camera__input" type="file"> </div>
This rest case results in crashes of the tab about 50% of the time, and in my app about 90% of the time.
I was 'lucky' enough to get all of Safari to crash once when the error happened, and this was part of the log:
Exception Type: EXC_BAD_ACCESS (SIGSEGV) Exception Subtype: KERN_INVALID_ADDRESS at 0x00030000006467ba Triggered by Thread: 0 Thread 0 name: Dispatch queue: com.apple.main-thread Thread 0 Crashed: 0 WebKit 0x000000018a48566c WebKit::WebPageProxy::didChooseFilesForOpenPanelWithDisplayStringAndIcon(WTF::Vector<WTF::String, 0ul, WTF::CrashOnOverflow> const&, WTF::String const&, API::Data const*) + 44 1 WebKit 0x000000018a461648 WebKit::WebOpenPanelResultListenerProxy::chooseFiles(API::Array*, API::String*, API::Data const*) + 100 2 WebKit 0x000000018a461648 WebKit::WebOpenPanelResultListenerProxy::chooseFiles(API::Array*, API::String*, API::Data const*) + 100 3 WebKit 0x000000018a413020 -[WKFileUploadPanel _chooseFiles:displayString:iconImage:] + 468
It seems to indicate an (overflow?) error in display the little thumbnail preview? Is there a way to prevent Safari from crashing when using file input, or at least don't render the thumbnail preview?
Clear Out History & Web Data in Safari Safari accumulates caches, browsing history, cookies, and other data in the iPhone or iPad. Sometimes that data can interfere with app functionality, so clearing it out can be a remedy to problems with the app crashing or stalling on some web sites.
The best ways to fix Safari Crashing on iPhone problem are, to restart your iPhone, update the latest iOS, Clear Safari History, and Website Data, Turn off Java Script Option, and Disable iCloud and Safari Syncing.
Try this:
<input class="add__from-camera__input" type="file" accept="image/*;capture=camera">
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With