- r - 以节省内存的方式增长 data.frame
- ruby-on-rails - ruby/ruby on rails 内存泄漏检测
- android - 无法解析导入android.support.v7.app
- UNIX 域套接字与共享内存(映射文件)
我在客户端的应用程序上发生了崩溃,除了在 WTFCrash
发生了很多次,我没有从堆栈跟踪中得到太多用处。
我正在使用 WKWebView
实例来显示具有一些基于 CSS 的动画和视频的网页。这些问题出现在 iOS 8 和 9 上的各种设备上(iPhone 5c 到 6s 和类似的 iPad)。
WKWebView
在它自己的进程中运行,而不是应用程序的进程。当崩溃发生时,会留下一个覆盖主应用程序的白色层,即使它的进程没有受到影响,也无法访问它。
查看设备日志,我发现 com.apple.WebKit.WebContent
进程崩溃,并且它们都具有完全相同的崩溃线程日志。
Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0 JavaScriptCore 0x0000000184c9f22c WTFCrash + 72
1 JavaScriptCore 0x0000000184c9f224 WTFCrash + 64
2 WebKit 0x0000000188ecd850 WebKit::RemoteLayerTreeDrawingArea::acceleratedAnimationDidStart(unsigned long long, WTF::String const&, double) + 0
3 WebCore 0x0000000184f2e70c WebCore::ThreadTimers::sharedTimerFiredInternal() + 148
4 WebCore 0x0000000184f2e64c WebCore::timerFired(__CFRunLoopTimer*, void*) + 36
5 CoreFoundation 0x000000018107d81c __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 28
6 CoreFoundation 0x000000018107d4c0 __CFRunLoopDoTimer + 884
7 CoreFoundation 0x000000018107abd4 __CFRunLoopRun + 1520
8 CoreFoundation 0x0000000180fa4d10 CFRunLoopRunSpecific + 384
9 Foundation 0x00000001819b4d8c -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 308
10 Foundation 0x0000000181a09ff8 -[NSRunLoop(NSRunLoop) run] + 88
11 libxpc.dylib 0x0000000180d68cf8 _xpc_objc_main + 660
12 libxpc.dylib 0x0000000180d6aa2c xpc_main + 200
13 com.apple.WebKit.WebContent 0x0000000100057924 0x100054000 + 14628
14 libdyld.dylib 0x0000000180b428b8 start + 4
这是我们用来重现问题的一些示例 html/css。
var initialWidth = 100;
window.addEventListener('load', function() {
var div = document.getElementById('mytest');
div.className = '';
setInterval(function() {
initialWidth += 10;
if (initialWidth > 1000) {
initialWidth = 1;
}
div.style.height = initialWidth + 'px';
}, 40);
}, false);
body {
background-color: #4cb9e4;
}
div#mytest {
position: absolute;
top: 0;
width: 100%;
height: 5000px;
background-color: rgba(0, 0, 0, 0.7);
text-align: center;
overflow-y: hidden;
-webkit-transition-property: height;
-moz-transition-property: height;
transition-property: height;
-webkit-transition-duration: 0.5s;
-moz-transition-duration: 0.5s;
transition-duration: 0.5s;
-webkit-transition-timing-function: ease;
-moz-transition-timing-function: ease;
transition-timing-function: ease;
}
div#mytest.hidden {
height: 0;
}
<body>
<div class="hidden" id="mytest">
This is sample test
</div>
</body>
有人觉得这很眼熟吗?关于动画,有什么我应该告诉网络工程师更改的吗?
最佳答案
你应该在主线程中创建 webView
- (void)createWebView{
if (![NSThread isMainThread]) {
dispatch_async(dispatch_get_main_queue(), ^{
[self createWebView];
});
return;
}
self.webView = [[UIWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 320)];
//Rest of my code
}
关于ios - WKWebView 在 acceleratedAnimationDidStart 中崩溃,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37172795/
我遇到了死胡同。我只是想不出在用户关闭应用程序后恢复 WKWebView 的方法。当他重新打开它时,他访问过的所有网页都必须在那里。 有什么建议吗? 最佳答案 All the web pages he
有没有办法让 WKWebView 加载完整的 URL对于每个请求? webView:didFinishNavigation: 仅适用于 mainFrame导航并且不提供 URL 请求参数。 我如何获得
我想复制 Facebook 应用程序的行为,当您单击外部链接时,它会在新浏览器中打开(但它不在 Safari 中)。 我目前有一个加载我的网站的 WKWebView。我可以在点击事件中捕获用户并打开它
我正在尝试将所有加载的数据从一个 WKWebView 复制到一个新的 WKWebView 以便在新的 webView 加载时加载所有内容提出了。关于如何执行此操作或对此的最佳方法有何建议? 最佳答案
WKWebView 允许您通过 Safari 打开外部链接(与基本 url 不同的链接)。 但是,有时您想打开 WKWebView 本身内的所有链接. 例如,假设您有一个基本网址 "https://t
我已经发布了我使用的委托(delegate)方法,如果没有按钮操作事件,我如何使用 javascript 添加该事件。我如何在我的 View Controller 中使用功能主义者。 func web
我正在制作一个应用程序,用户可以在其中单击一个按钮以禁用所有 JavaScript 在下一个页面加载时(而不是重新启动应用程序才能生效)。我尝试了以下代码,但首选项没有保存。 JavaScript 在
我知道我们可以初始化一个 UIWebView 或 WKWebView 然后注入(inject) JavaScript 来获取 navigator.userAgent 的值,但是这需要初始化UIWebV
目标:网站加载完成后对WKWebView进行截图 采用的方法: 在 UIViewController 中定义了一个 WKWebView 变量 创建了一个名为 screen capture() 的扩展方
服务人员在 WKWebView 中可用在 iOS 11.3 测试版中,但似乎在 iOS 11.3 的最终 GM 版本中不可用。 有谁知道如何在 WKWebView 中重新启用 Service Work
我有 44 个 UIButtons,每个按钮都应该连接到带有本地 html 的 wkwebview 的 vc。 有没有办法在一个 vc 中实现所有 44 个按钮? 这是 wkwebview 示例 vc
我正在尝试在 App WebView 中实现“真正的”全屏,这意味着无论如何我都希望网页内容完全显示在屏幕下方。 这是我面临的当前情况,当将 WebView 构建到 superviews 边界时: 红
我正在尝试使用带有单个按钮的简单 WKWebView,单击该按钮后应通过 JavaScript 回调到 Swift。但是,我在 Xcode 控制台中看到以下日志,并且 View 加载了空的 WKWeb
我正在尝试使用带有单个按钮的简单 WKWebView,单击该按钮后应通过 JavaScript 回调到 Swift。但是,我在 Xcode 控制台中看到以下日志,并且 View 加载了空的 WKWeb
我正在使用一个 MacOS 应用程序,它需要使用 WKUserScript 功能将消息从网页发送回 MacOS 应用程序。我正在处理文章 https://medium.com/capital-one-
对于UIWebView,我们可以通过以下方式获取内容高度: [webView stringByEvaluatingJavaScriptFromString:@"document.body.offset
优化背景 众所周知,H5 的部分优势(开发快,迭代快,热更新)是很明显的,公司客户端的部分业务都是由 H5 来实现的,网络好的情况下体验也是很不错的 但是其实 H5 的体验是比原生
由于Xcode8发布之后,编译器开始不支持iOS 7了,这样我们的app也改为最低支持iOS 8.0,既然需要与web交互,那自然也就选择使用了 iOS 8.0之后 才推出的新控件 WKWebVie
下图中的这个“up up up up”是使用wkwebview加载的html字符串 webView?.loadHTMLString((currentLock?.text)!, baseURL: nil
我的应用程序有 1 个 ViewController,它加载一个使用 Auth0 处理登录的网络应用程序 url。在 iOS 13.3 中,webView 已停止在登录后加载其他页面。 但是,当我尝试
我是一名优秀的程序员,十分优秀!