Skip to content
This repository has been archived by the owner on Nov 20, 2018. It is now read-only.

Chrome in iOS8 GM crashes after clicking file chooser button #1283

Closed
rnicholus opened this issue Sep 10, 2014 · 9 comments
Closed

Chrome in iOS8 GM crashes after clicking file chooser button #1283

rnicholus opened this issue Sep 10, 2014 · 9 comments

Comments

@rnicholus
Copy link
Member

The following is the content of bug reports I filed with Apple and Google. A workaround for Fine Uploader is to set the multiple option to true for iOS. If your app has existing validation values that prevent videos from being selected, this option will be set to false for you already, and this is not configurable unfortunately.

If you do set the multiple option to true then video uploads will not work due to the existing iOS issue with the multiple attribute, described in #990.

Summary:
If a simple file input element is included on the page, Chrome will crash after clicking the button.

Steps to Reproduce:

  1. Click on the element in Chrome - iOS8 GM
  2. Select either "Choose Existing" or "Choose Photo or Video"

Expected Results:
File chooser dialog appears.

Actual Results:
Chrome crashes

Version:
8.0 (12A365)

Notes:

Configuration:
iPad

@rnicholus
Copy link
Member Author

Here's the Chrome issue I filed: https://code.google.com/p/chromium/issues/detail?id=412847.

Unfortunately, Apple doesn't expose issue links, or allow anyone outside of Apple to see issues filed, other than the filer. So, I can't provide a link to the iOS bug I filed with Apple.

@rnicholus
Copy link
Member Author

A new release of Chrome that addresses this issue before iOS8 launches on Wednesday seems like a longshot at this point.

We should probably work around this issue, since a browser crash is a significant problem for users. The only way to prevent this is to force the multiple option to false in iOS8 Chrome. The side effect here is that we will need to disable another workaround (described in #1039), so videos will be uploaded as empty files due to another outstanding bug in iOS, described in #990. Still, this is better than a browser crash. Once this issue is fixed, we can release a new hotfix that disables this workaround.

@rnicholus
Copy link
Member Author

Sounds like this will be fixed in Chrome 38 based on the changes to the issue I filed. I'm not sure yet if this will release before iOS8.

@rnicholus
Copy link
Member Author

Since the Chromium team won't give a release date, we'll have to code a workaround into Fine Uploader 5.0.5, forcing a multiple attribute on the underlying <input type="file"> element. This means that videos will upload 0-sized, but there's not much we can do about that. At least users will be able to upload images in one iOS browser.

rnicholus pushed a commit that referenced this issue Sep 16, 2014
@rnicholus
Copy link
Member Author

Workaround added to 5.0.5-7 pre-release.

@ChaplinWang
Copy link

Hi rnicholus,

This issue seems no longer valid in newer ios 8 version, IOS 8.1+ etc, I have found this fix is introducing new problems for later versions,

In my phonegap app, having multiple in my input field is preventing accessing camera on ios 8+

Cheers,
Chaplin

@rnicholus
Copy link
Member Author

@ChaplinWang That is expected behavior for iOS and is unrelated to any Fine Uploader code. iOS will not permit access to the camera when the underlying file input element contains the multiple attribute.

@ChaplinWang
Copy link

Thanks @rnicholus for quick response,

should the ios8BrowserCrashWorkaround, only be applied to ios 8.0.0 rather than all ios 8 versions? since apple has already fixed the crash issue on later versions.

        // Temporary workaround for bug in in iOS8 UIWebView that causes the browser to crash
        // before the file chooser appears if the file input doesn't contain a multiple attribute.
        // See #1283.
        if (options.ios8BrowserCrashWorkaround && qq.ios8() && (qq.iosChrome() || qq.iosSafariWebView())) {
            input.setAttribute("multiple", "");
        }

setting ios8BrowserCrashWorkaround to true in my case disable ios 8.1.2 from using camera, but setting it to false will almost gurantee it to crash on ios 8.0.0.

maybe it should be :

     if (options.ios8BrowserCrashWorkaround && qq.ios800() && (qq.iosChrome() || qq.iosSafariWebView())) {
            input.setAttribute("multiple", "");
     }

Cheers,
Chaplin

@rnicholus
Copy link
Member Author

The logic in place in Fine Uploader appears to be correct to me. The crash issue is specific to Chrome or any app that launches UIWebView, and may occur in any version of iOS8, depending on the installed version of Chrome or the version of the app using UIWebView.

You can disable this workaround if you are certain your users are using a current version of Chrome or a current version of your app in iOS8 that was compiled using the iOS8 SDK.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants