void ClientHandler::OnLoadStart(CefRefPtr<CefBrowser> browser,
CefRefPtr<CefFrame> frame) {
REQUIRE_UI_THREAD();
std::string js = "var headID = document.head;"
"var styleNode = document.createElement('style');"
"styleNode.type='text/css';"
"styleNode.appendChild(document.createTextNode('::-webkit-scrollbar {width:17px; } ::-webkit-scrollbar-thumb { background: rgba(255,0,0,0.8); }'));"
"document.head.appendChild(styleNode);";
frame->ExecuteJavaScript(js, frame->GetURL(), 0);
//"styleNode.appendChild(document.createTextNode('::-webkit-scrollbar {width:38px; height:38px;} ::-webkit-scrollbar-track {-webkit-box-shadow:inset 0 0 6px rgba(0,0,0,0.3); } ::-webkit-scrollbar-thumb { border-radius: 10px; -webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.5); }'));"
}
Set cef srcoll bar's css style
最新推荐文章于 2022-08-13 19:27:15 发布