0

这似乎是一个非常愚蠢的问题,但我无法弄清楚谷歌的内容。我想要 xkcd hovertext,它是标签的title属性。有,和, 但没有. 我该怎么办?imgWebKitHitTestResultget_link_uriget_link_titleget_image_uriget_image_title

编辑:这是现有代码,来自surf浏览器的源代码,它获取链接、图像或媒体 URI,但忽略标题属性(如果有)

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);
}
4

0 回答 0