Webkit的GTK:确定当文档加载完毕 [英] Webkit GTK: Determine when a document is finished loading

查看:433
本文介绍了Webkit的GTK:确定当文档加载完毕的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有StackOverflow上这是其他问题的关闭的到我想知道什么,像<一个href=\"http://stackoverflow.com/questions/5724088/webkit-gtk-how-to-detect-when-a-download-has-finished\">Webkit GTK ::如何当下载完成检测,但我觉得我要求的东西有点不同:

There are other questions on StackOverflow which are close to what I want to know, like Webkit GTK :: How to detect when a download has finished?, but I think I'm asking something a bit different:

在一般情况下,事件驱动ÇWebkit的GTK API中有很多可能涉及到当一些文档完成加载的理念事件。问题是文档是pretty稀疏,这种想法加载完成并不一定清楚,因为它可以指很多东西。请问加载完成意味着该文件已完成的下载的?它的完成创建DOM树?它的完成下载包括的所有的其他资源(如CSS,JS和图片文件?)

In general, in the event-driven C Webkit-GTK API there are a lot of events which may relate to the idea of when some document is finished "loading". The problem is the documentation is pretty sparse, and the idea of "finished loading" isn't necessarily clear, because it can refer to a lot of things. Does "finished loading" mean that the document is finished downloading? That it's finished creating the DOM tree? That it's finished downloading including all other resources (like CSS, JS and image files?)

相关信号信号::通知::负载状态文档加载完成资源负载成品

负载状态信号火灾每次负载状态的变化,所以你需要手动调用 webkit_web_view_get_load_status 和检查每次的状态。即便如此,当状态总算是 WEBKIT_LOAD_FINISHED ,我不知道这意味着什么 - 它意味着WebKit是完成的下载的资源,或它的创建完DOM树,还是什么?

The load-status signal fires everytime the load status changes, so you need to manually call webkit_web_view_get_load_status and check the status each time. Even so, when the status finally is WEBKIT_LOAD_FINISHED, I'm not sure what that means - does it mean WebKit is done downloading the resource, or that it's finished creating the DOM tree, or what?

问:

之间有什么不同的完成信号的差异,是否有相当于标准的JavaScript DOM事件的任何信号的window.onload

What is the difference between the various "finished" signals, and is there any signal that is equivalent to the standard Javascript DOM event window.onload?

推荐答案

我相信<一个href=\"http://webkitgtk.org/reference/webkitgtk/stable/webkitgtk-webkitwebview.html#WebKitWebView-document-load-finished\"相对=nofollow> 文档加载完成信号是您正在寻找的,因为它似乎什么(在我看来)更密切地你是什么匹配试图测试。

I believe the document-load-finished signal is what you are looking for as it seems (in my opinion) to match more closely what you are trying to test for.

一个想法,以测试这就是做这将是测试各种方式有测试一个文档装手动的正确方法。即尝试一个我联系到上面,并输出字符串到终端当值为true。如果说之前的页面完全显示的所有内容的价值是真实的,机会是,它不是你一前一后。然后移动到下一个,直到你有正确的。

One idea to test which is the correct way to do this would be to test the various ways there are to test if a document has "loaded" manually. I.e. Try the one I linked to above, and output a string to the Terminal when the value is true. If the value is true before the page has completely displayed all of its contents, chances are that it's not the one you're after. Then move on to the next, until you've got the right one.

除此之外,我真的不知道你可以做些什么,因为正如你提到的,定义不是很清楚。这就像这些的时候,我想的Gtk文档是一个小更详细。

Other than that, I'm not really sure what else you can do, since as you mentioned, the definition isn't very clear. It's times like these I wish Gtk documentation was a little more verbose.

这篇关于Webkit的GTK:确定当文档加载完毕的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆