以下是包含完整日誌的回報範本:
Title: WKWebView File Upload Causes App Crash When Selecting Camera or Recording Options
Body:
Hello,
I am experiencing a critical issue with WKWebView in our iOS app when handling file uploads. We are using the following HTML element to allow users to capture images or videos, select from their photo library, or choose a file from the file system:
<input type="file" accept="image/*;capture=camera" id="cameraInput">
Issue Description:
When a user selects the camera or recording option, the app immediately crashes and returns to the WKWebView screen. This issue does not occur when selecting a file from the photo library or file system.
Logs:
Below are the relevant logs captured when the issue occurs:
Presenting view controller <_UIContextMenuActionsOnlyViewController: 0x1034349e0> from detached view controller <MailVwCtl: 0x103838800> is not supported, and may result in incorrect safe area insets and a corrupt root presentation. Make sure <MailVwCtl: 0x103838800> is in the view controller hierarchy before presenting from it. Will become a hard exception in a future release.
RotateN2:<MailVwCtl: 0x103838800>
RotateN2:<MailVwCtl: 0x103838800>
RotateN1:<Mail2000ViewController: 0x10350b780>
RotateN2:<Mail2000ViewController: 0x10350b780>
RotateN2:<MailVwCtl: 0x103838800>
RotateN2:<MailVwCtl: 0x103838800>
RotateN2:<Mail2000ViewController: 0x10350b780>
RotateN1:<Mail2000ViewController: 0x10350b780>
RotateN2:<Mail2000ViewController: 0x10350b780>
RotateN2:<Mail2000ViewController: 0x10350b780>
RotateN2:<Mail2000ViewController: 0x10350b780>
RotateN2:<Mail2000ViewController: 0x10350b780>
Unknown chipRevisionID (0xffffffff)
Attempted to change to mode Portrait with an unsupported device (BackWideDual). Auto device for both positions unsupported, returning Auto device for same position anyway (BackAuto).
Attempted to change to mode Portrait with an unsupported device (BackWideDual). Auto device for both positions unsupported, returning Auto device for same position anyway (BackAuto).
Attempted to change to mode Portrait with an unsupported device (BackAuto). Auto device for both positions unsupported, returning Auto device for same position anyway (BackAuto).
Attempted to change to mode Portrait with an unsupported device (BackWideDual). Auto device for both positions unsupported, returning Auto device for same position anyway (BackAuto).
RotateN2:<Mail2000ViewController: 0x10350b780>
RotateN2:<Mail2000ViewController: 0x10350b780>
RotateN2:<Mail2000ViewController: 0x10350b780>
WillDsAr:<MailVwCtl: 0x103838800>
RotateN1:<Mail2000ViewController: 0x10350b780>
RotateN2:<Mail2000ViewController: 0x10350b780>
DidDsAr:<MailVwCtl: 0x103838800>
<Mail2000ViewController: 0x10350b780>:VwWillAppear:1:x0
willAr:1,Fm:0,20,375,792-<MailVwCtl: 0x103838800>
willAr:1,Bd:0,0,375,792-<MailVwCtl: 0x103838800>
<MailVwCtl: 0x103838800>:VwDidAP:
VwDidAP:Bd:0,0,375,792-<MailVwCtl: 0x103838800>
VwDidAP:Fm:0,20,375,792-<MailVwCtl: 0x103838800>
VwDiDAP:SetFm:0,20,375,792-<MailVwCtl: 0x103838800>
ToolVwSetVwSize0:main,0,24,w=375,h=668,stepInd=0
ToolVwSetVwSize0:toobar_self,0,692,w=375,h=66
ToolVwSetVwSize:w=375,h=792
ToolVwSetVwSize1:main,0,0,w=375,h=727
ToolVwSetVwSize1:ToolBar,0,727,w=375,h=792
RotateN2:<Mail2000ViewController: 0x10350b780>
RotateN2:<Mail2000ViewController: 0x10350b780>
<Mail2000ViewController: 0x10350b780>:VwDidAppear:1:x0
M2KVC_DidAp0:0.000000 0.000000 375.000000 812.000000
Additional Context:
This issue is critical as it affects the user experience severely. Notably, we have a similar issue in our Android app using WebView. In that case, the file upload options for camera, recording, and file selection do not appear at all, restricting users to only upload files from the phone's storage.
We would like to inquire whether there have been recent changes to the APIs related to WKWebView and WebView or any known issues that could be causing this behavior. We are also concerned this might be a side effect of recent bug fixes or updates to WKWebView.
Additional Context:
This issue appears to be specific to iOS 17. We have tested the same functionality on devices running iOS versions below 17, and the camera and recording options work as expected without any crashes. This suggests that the issue may be introduced in iOS 17.
You can view a video demonstrating the issue at this link:
https://share.icloud.com/photos/001voevXriVXsEUmhzGsFBtSA
Environment:
iOS version: 17.6.1&17.5.1
Device: iPhone 15 Pro Max& iPhone 12
WKWebView version: [Your WKWebView version, if known]
App platform: iOS
Xcode version: 15.1
We appreciate any insights or guidance you can provide on this matter.
Thank you.
HTML
RSS for tagHypertext Markup Language (HTML) is the standard markup language for documents designed to be displayed in a web browser.
Posts under HTML tag
35 Posts
Sort by:
Post
Replies
Boosts
Views
Activity
I wonder why that happens.
When opened on Mac.
Acceptance of files with the '.hwp' extension is applied. But not on ipad
I'd like to know why, where can I get information?
here is the code
<!DOCTYPE html>
<html>
<body>
<h1>The input accept attribute</h1>
<form action="/action_page.php">
<label for="img">Select file:</label>
<input type="file" accept=".pdf, .hwp">
</form>
</body>
</html>
I had to close all application vs code xcode simulator and reboot everything and it started working.
Thanks!
Our iOS 17.4.1 users are experiencing a crash when we try to convert Markdowns to HTML. We're wondering what could be the trigger for this crash 💥. we would love to get some help.
Here is the full stack:
Crashed: WebThread
0 WebCore 0x2ee8 <redacted> + 20
1 WebCore 0x15df7d0 <redacted> + 11068
2 WebCore 0x191b6b0 <redacted> + 264
3 WebCore 0x15e0e7c <redacted> + 784
4 WebCore 0x1e1a01c WebCore::LocalFrame::~LocalFrame() + 548
5 WebCore 0x1e1a760 WebCore::LocalFrame::~LocalFrame() + 16
6 WebCore 0x1e5470c WebCore::Page::~Page() + 7264
7 WebKitLegacy 0xb65e8 __29-[WebView(WebPrivate) _close]_block_invoke + 372
8 WebCore 0x214d070 <redacted> + 648
9 CoreFoundation 0x3762c __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 28
10 CoreFoundation 0x368a8 __CFRunLoopDoSource0 + 176
11 CoreFoundation 0x350b8 __CFRunLoopDoSources0 + 340
12 CoreFoundation 0x33d88 __CFRunLoopRun + 828
13 CoreFoundation 0x33968 CFRunLoopRunSpecific + 608
14 WebCore 0xe90110 <redacted> + 780
15 libsystem_pthread.dylib 0x2a90 _pthread_start + 136
16 libsystem_pthread.dylib 0x1fcc thread_start + 8
com.apple.uikit.datasource.diffing
0 libsystem_kernel.dylib 0x249c __psynch_cvwait + 8
1 libsystem_pthread.dylib 0x1590 _pthread_cond_wait + 1228
2 JavaScriptCore 0x7d5f8 WTF::ThreadCondition::timedWait(WTF::Mutex&, WTF::WallTime) + 160
3 JavaScriptCore 0x51d78 WTF::ParkingLot::parkConditionallyImpl(void const*, WTF::ScopedLambda<bool ()> const&, WTF::ScopedLambda<void ()> const&, WTF::TimeWithDynamicClockType const&) + 2072
4 JavaScriptCore 0x42468 WTF::LockAlgorithm<unsigned char, (unsigned char)1, (unsigned char)2, WTF::EmptyLockHooks<unsigned char> >::lockSlow(WTF::Atomic<unsigned char>&) + 216
5 WebCore 0xe8da54 <redacted> + 280
6 WebCore 0xe8ea38 WebThreadLock + 132
7 UIFoundation 0xdb68c -[NSHTMLReader _loadUsingWebKit] + 1448
8 UIFoundation 0xdc234 -[NSHTMLReader attributedString] + 24
9 UIFoundation 0x83c88 _NSReadAttributedStringFromURLOrDataCommon + 6440
10 UIFoundation 0x7ed34 _NSReadAttributedStringFromURLOrData + 288
11 UIFoundation 0x7ebac -[NSAttributedString(NSAttributedStringUIFoundationAdditions) initWithData:options:documentAttributes:error:] + 148
...
【現象】
Safariブラウザでcanvasに対して任意の描画をした後、clearRect()を実行します。
その後、canvasの親divに対して visibility: hidden を設定すると、消したはずの描画が復活します。
但し、親divは正常に visibility: hidden が働いているので描画されなくなります。
また、この現象はブラウザの拡大率が影響をしているようです。
少なくとも後述のリスト内のMacbookAirでは、拡大率が100%の場合にのみ発生しています。
この現象は過去のバージョンでは起きてないようです。
このバグを修正する予定はありますか?
【機種】
機種は以下のリストを確認してください。
Model
OS&Version
Y/N
version
MacbookAir M2 2022
macOS Sonoma 14.4.1
y
17.4.1
Mac Studio 2022 Apple M1 Max
macOS Monterey 12.5
n
16.0
MacBook Air M1 2020
macOS Sonoma 14.3.1
n
17.3.1
iPadPro gen6
iPadOS 17.4.1
y
-
iPad gen10
iPadOS 17.4.1
n
-
【デモ】
現象を確認するためのデモは以下のHTMLファイルを保存してブラウザで開いてください。
再現手順はボタンを draw -> clear -> hide の順番に押してください。
黄色の親divが非表示になるのに対し、canvasからclearしたはずの黒い四角が表示されます。
<html>
<body onload="onLoad()">
<div id="parent" style="background-color: yellow;">
<canvas id="canvas"></canvas>
</div>
<button onclick="drawCanvas()">draw</button>
<button onclick="clearCanvas()">clear</button>
<button onclick="showCanvas()">show</button>
<button onclick="hideCanvas()">hide</button>
<script>
let parent
let canvas
let context2d
function onLoad() {
parent = document.getElementById("parent")
canvas = document.getElementById("canvas")
context2d = canvas.getContext('2d')
}
function drawCanvas() {
context2d.fillRect(0, 0, 100, 100)
}
function clearCanvas() {
context2d.clearRect(0, 0, canvas.width, canvas.height)
}
function showCanvas() {
parent.style.visibility = "visible"
}
function hideCanvas() {
parent.style.visibility = "hidden"
}
</script>
</body>
</html>
If I set an input text box connected to a datalist-options, in order to suggest pre-coded values, this is what happens:
The text field shows properly.
When I start typing, one or more coincident "options" from the datalist are shown at the bottom of the available screen.
When one option is selected, the data contained in it is NOT transcript to the input field.
The same webtest works fine on Ipad mini w/ios 15.
Try this simple code, it doesn't work:
<label for="browser">Choose your browser from the list:</label>
<input list="browsers" name="browser" id="browser">
<datalist id="browsers">
<option value="Edge">
<option value="Firefox">
<option value="Chrome">
<option value="Opera">
<option value="Safari">
</datalist>
I'm not sure if I just missed a recent breaking change, but we are having an issue with the camera in our single page app on iOS 17.4.1 in Safari. We can open the camera and display it to the user using getUserMedia. However, if the path of the site changes at all (for example, the user clicks a button to opens a sidepanel which results in the path in the browser changing) the camera goes black, even if the video element is still being displayed.
I can see in the browser that the camera has stopped, and the user has to re-enable it manually by tapping "Start Using Camera".
Any idea's what could be going on here?
In iOS version 17.4 and above, we have observed that the following code works fine upon the initial opening. However, after minimizing the page and reopening it, there is a chance of encountering issues with abnormal lines.
Please note the reproduction conditions: try minimizing the page, opening other apps, and then reopening it multiple times.
The code is in the comments section.
first time:
After minimizing and reopening...
I am developing a web application that works on webview.
From iOS 13, users could set a specific language for each individual app, and every webview-based application knew the application language through navigator.language.
However, in iOS 17.4, this API returns the system language instead of the individual app's language in web applications.
Is this an official change in iOS 17.4 or a bug?
Even when iOS's '"." Shortcut' keyboard setting is enabled, double-tapping the spacebar in WKWebView doesn't insert a period.
While making WKWebView editable , "." shortcut is not working. It works fine when any other external keyboard is used. I am facing this issue in WKWebView using apple keyboard. Even forceful adding javascript to replace double tap of space bar to period character logic is not working.
Application:
HTML,Javascript,Angular web Application
Issue:
In Iphone/Ipad while trying to enter English characters using Japanese keyboard in the input field
the japanese keyboard freezes and stops working after entering the first character.
Root Cause:
Two validations given in the onInput call back method causes the issue.
when the validation are removed keyboard is working fine
1.for converting lowercase letters to uppercase
2.Some Character are not allowed so they are replaced after input
I have a wind map web application developed using HTML canvas 2D. However, after iOS 16.X (I'm not sure of the exact version), the streamlines have changed and now appear as below. They no longer disappear as they did previously.
This issue is not limited to a specific browser.
Before:
After:
Wondering if anyone has had any luck with getting the geo-location while viewing a web page in mobile Safari on Watch OS? I've updated my phone and watch to the latest versions.
The code I'm using is standard Javascript for geolocation such as
navigator.geolocation.getCurrentPosition(showPosition, showPositionError);
Works fine when I run it in Safari on my laptop, but when I try to run the same thing on apple watch in embedded web browser, get an "Access Denied" error, which would imply that I have some permission set wrong either on the watch or the paired iPhone. I've messed with many of those settings and nothing seems to be working.
Wondering if it's stated somewhere that it simply won't work so I don't continue chasing my tail on something that was designed not to work.
Hello, I'm trying to learn swift and making the Landmarks tutorial I found a problem with the map view. The error read as follow: "'init(coordinateRegion:interactionModes:showsUserLocation:userTrackingMode:)' was deprecated in iOS 17.0: Use Map initializers that take a MapContentBuilder instead."
My code is:
import MapKit
struct MapView: View {
@State private var region = MKCoordinateRegion(
center: CLLocationCoordinate2D(latitude: 34.011_286, longitude: -116.166_868),
span: MKCoordinateSpan(latitudeDelta: 0.2, longitudeDelta: 0.2)
)
// The error happens here!
var body: some View {
Map(coordinateRegion: $region)
}
}
#Preview {
MapView()
}
Any suggestions about hot to solve this will be appreciate it.
Thanks,
BR
Skalex
Good morning!
I am developing an iOS app that gets its data from an API and displays it in a list. The list item view has NavigationLink embedded in it that sends users to a detail view. In this detail view, I have some Text views but the issue I am running into is a WKWebView that I have implemented to display some HTML that's is retrieved from the API call.
The WKWebView displays the HTML just how I want it to. The issue I have is in the HyperLinks that are displayed in the WKWebView. When a user taps on a link, it opens inside of the web view. Instead of opening in the web view, I would like this link to open in the user's default web browser. I have searched and found ways of doing this in older versions of Swift using classes but my web view is initialized inside of a struct that conforms to the UIViewRepresentable protocol.
I don't know how to get links to open in the browser instead of the WebView so any help would be appreciated. Here is the code for my WebView that is being used on the details page.
struct NewsItemWebView: UIViewRepresentable {
// HTML from API Call
var text: String
// Method to create the View
func makeUIView(context: Context) -> WKWebView {
return WKWebView()
}
// Method to update the View by changing properties of the WebView
func updateUIView(_ uiView: WKWebView, context: Context) {
uiView.isOpaque = false
uiView.backgroundColor = UIColor.white
uiView.loadHTMLString(text, baseURL: nil)
}
}
Here is how I am implementing the WebView on DetailView
NewsItemWebView(text: item.PageContent)
.frame(height: 450)
Any help on how I can make links open in a browser would be great. Thanks in advance.