WebkitGTK API调用“不建议使用:2.22:改用JavaScriptCore API”

时间:2019-04-27 17:18:44

标签: c++ webkitgtk

我已经在稳定的Debian(9)上使用WebkitGTK编写了一些代码。我最近将代码移到了Buster / Testing Debian(10)。从Debian 9更改为10时,WebkitGTK版本也进行了更改。现在,当我编译我的代码时,会收到很多不推荐使用的警告。问题是提供的用于重写代码的信息不足以让我确定如何完成重写。具体来说,不建议使用WebkitGTK API调用,而指令是改用JavaScriptCore API。我已经搜索过,找不到任何提供重写代码示例的内容。因此,我包含了一小段说明问题的代码。

两个API调用“ webkit_dom_html_collection_get_length”和“ webkit_dom_html_collection_item”均已弃用。

void Process_HTMLCollection(WebKitWebPage *web_page, WebKitDOMHTMLCollection *element)
{  
    gulong iItems = webkit_dom_html_collection_get_length (element); //deprecated
    for(int i=0; i<iItems; i++)
    {
        WebKitDOMNode *node = webkit_dom_html_collection_item (element, i); //deprecated
        //Do something with the node
    }
}

我有兴趣学习如何使用JavaScriptCore API重写此代码。

任何帮助将不胜感激。 谢谢!

0 个答案:

没有答案