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.)