WebKit JS extension (2)

How to add a global function in JS?

 

1. DOMWindow.h

    void test();

 

2. DOMWindow.cpp

    void test()

    {

        runTest();

    }

 

3. Implement runTest in the following files:

    Chrome.h(.cpp)

    ChromeClient.h

    WebChromeClient.h(.cpp)

    WebInspectorDelegate.h

    IWebUIDelegate.idl (this delegate can be replaced if you want to implement this function in another delegate.)

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章