v8 execute not being called?

Having problems with building or using CEF's C/C++ APIs? This forum is here to help. Please do not post bug reports or feature requests here.

v8 execute not being called?

Postby nickak2003 » Sat Jul 15, 2017 1:02 pm

Hi ive refactored an old cef program but now it seems the v8 execute is not being called and i cant figure why.
Code: Select all
class CefAppRenderer : public CefApp, public CefRenderProcessHandler:
 ::OnContextCreated
    CefRefPtr<CefV8Value> object = context->GetGlobal();
    CefRefPtr<CefV8Handler> handler = new MyV8Handler(browser, &mGuiSheetManagerRenderer);
    mGuiSheetManagerRenderer.generateV8Bindings(object, handler);

class GuiSheetManagerRenderer :
  ::generateV8Bindings(CefRefPtr<CefV8Value> object, CefRefPtr<CefV8Handler> handler) {
   for (RendererBindingsMap::iterator it = rbindings.begin(); it != rbindings.end(); it++) {
      std::string funcName = it->first; // this string is correct ("test1")
      CefRefPtr<CefV8Value> func = CefV8Value::CreateFunction(funcName, handler);
      object->SetValue(funcName, func, V8_PROPERTY_ATTRIBUTE_NONE); //object should be the global context
   }

class MyV8Handler : public CefV8Handler :
  ::execute
   //not called when javascript is correct

javascript:
<html>
<head>
    <script type="text/javascript">
        function func1() {
            window.test1();
        }
    </script>
</head>
<body>
    <div onclick="func1();" style="background-color:red"> adfasf</div>
</body>
</html>

the mouse/key event is passed as i tested on an inputbox.
nickak2003
Techie
 
Posts: 43
Joined: Fri Apr 10, 2015 6:53 pm

Re: v8 execute not being called?

Postby nickak2003 » Sat Jul 15, 2017 4:41 pm

OK so it works...
problem was ?? some sort of white spaces in the html file that made it not work?!!
I had to rewrite the html file from scratch in notepad then it worked. ??
nickak2003
Techie
 
Posts: 43
Joined: Fri Apr 10, 2015 6:53 pm


Return to Support Forum

Who is online

Users browsing this forum: No registered users and 66 guests