Search code examples
c++oopmfcchromiumchromium-embedded

Chromium embedded framework - attaching/injecting CSS/JS to page (C++ - MFC)


I would like to know if it is possible to attach CSS or JS file to page before opening in CEF( Chromium embedded framework ) in C++ ?

Why i need it is because i have some pages to open via CEF, but the pages's design is too bad, i want to change some styles there.

any tips will be appreciated.

thanks Gofur.


Solution

  • Javascript code can be injected in CefLoadHandler::OnLoadStart by calling frame->ExecuteJavascript.