这似乎是一个很愚蠢的问题,但我不知道该如何处理Google。我想要xkcd悬停文字,它是title
标签的img
属性。 WebKitHitTestResult
具有get_link_uri
,get_link_title
和get_image_uri
,但没有get_image_title
。我该怎么办?
编辑:这是来自surf
浏览器的源代码,该代码获取链接,图像或媒体URI,但忽略title属性(如果有)
void
mousetargetchanged(WebKitWebView *v, WebKitHitTestResult *h, guint modifiers,
Client *c)
{
WebKitHitTestResultContext hc = webkit_hit_test_result_get_context(h);
/* Keep the hit test to know where is the pointer on the next click */
c->mousepos = h;
if (hc & OnLink)
c->targeturi = webkit_hit_test_result_get_link_uri(h);
else if (hc & OnImg)
c->targeturi = webkit_hit_test_result_get_image_uri(h);
else if (hc & OnMedia)
c->targeturi = webkit_hit_test_result_get_media_uri(h);
else
c->targeturi = NULL;
c->overtitle = c->targeturi;
updatetitle(c);
}