在 OS X 10.6 上的 Cocoa 应用程序中调试 WebVIew

发布于 2024-12-27 04:32:33 字数 580 浏览 2 评论 0原文

我正在 Xcode 4 中开发一个非常简单的 Cocoa 应用程序,其目标是 OS X 10.6。

基本上,该应用程序包含一个加载外部 URL 的 WebView。该应用程序为此网页创建一个简单的桌面包装。

应用程序启动并开始加载 URL,但看起来某些框架未加载(整个页面未加载)。通过 Safari 查看该页面时效果良好。

调试应用程序不会显示任何错误,尽管我不确定是否应该专门侦听来自 WebKit 的错误。

所以,我的问题是,有人可以推荐调试此类问题的方法吗?基本上,在可可应用程序中嵌入的 WebView 视图中,网页没有按预期呈现?

我找到了一种解决方案,它允许您在嵌入式 WebView 中使用 Web 检查器:

有没有办法从 Cocoa WebView 对象使用 WebKit Web 检查器?

我还解决了与用户差异有关的问题代理人服务器期望的字符串。

I am working on a very simple Cocoa app in Xcode 4 which targets OS X 10.6.

Basically, the app contains a WebView which loads an external URL. The app creates a simple desktop wrapper for this webpage.

The app launches and begins to load the URL, but it looks like some of the frames are not being loaded (the entire page doesnt load). The page works fine when viewed via Safari.

Debugging the app doesnt show any errors, although I am not sure if I should be listening specifically for ones from WebKit.

So, my question is, can anyone recommend approaches for debugging an issue like this? Basically, where a web page is not rendering as expected in a WebView view embedded in a cocoa app?

I found one solution, which allows you to use the web inspector in an embedded WebView:

Is there a way to use the WebKit web inspector from a Cocoa WebView object?

I also solved my problems which had to do with differences in the user agent string that the server was expecting.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

垂暮老矣 2025-01-03 04:32:33

通常,在这种情况下,最好的方法是尝试尽可能减少测试用例,同时仍然重现错误。例如,您可以尝试简化和缩短正在加载的页面,以确定是否有标记的某些部分触发了问题。您可以尝试简化应用程序以确定应用程序的某些部分是否触发了问题。等等。

Usually the best approach in cases like this is to try to reduce the test case as far as possible while still reproducing the bug. For example, you can try simplifying and shortening the page you're loading to determine if there's some part of the markup that's triggering the problem. You can try simplifying your application to determine if there's some part of your application that's triggering the problem. And so on.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文