cef框架下問題處理匯總

1、忽略證書錯誤提示,cef默認為false,但是并沒有彈窗提示要去選擇操作,所以會導致某一些需要驗證證書的界面打不開。
解決:

settings.ignore_certificate_errors = true;

2、本地化問題
解決:

  const char* loc = "zh-CN";
  CefString(&settings.locale).FromASCII(loc);
  CefString(&settings.accept_language_list).FromASCII(loc);
  cef_string_from_ascii(loc, strlen(loc), &settings.locale);

3、cef70中flash無法自動打開問題

void QCefRenderApp::OnBeforeCommandLineProcessing(const CefString &process_type, CefRefPtr<CefCommandLine> command_line)
{
    //flash
    command_line->AppendSwitchWithValue("enable-system-flash", "1");        //這一句就夠了
//    command_line->AppendSwitchWithValue("ppapi-flash-version", "99.0.0.999");
//    command_line->AppendSwitchWithValue("ppapi-flash-path", "plugins\\pepflashplayer64_32_0_0_344.dll");
}

4、編譯cef出錯

錯誤  1   error MSB3073: 命令“setlocal
mt.exe -nologo -manifest "E:/CEF_Source/cef81/tests/cefclient/resources/win/cefclient.exe.manifest" "E:/CEF_Source/cef81/tests/cefclient/resources/win/compatibility.manifest" -outputresource:"E:/CEF_Source/cef81/out/tests/cefclient/Debug/cefclient.exe";#1
if %errorlevel% neq 0 goto :cmEnd
:cmEnd
endlocal & call :cmErrorLevel %errorlevel% & goto :cmDone
:cmErrorLevel
exit /b %1
:cmDone
if %errorlevel% neq 0 goto :VCEnd
setlocal
D:\CMake\bin\cmake.exe -E copy_if_different E:/CEF_Source/cef81/Debug/chrome_elf.dll E:/CEF_Source/cef81/out/tests/cefclient/Debug/chrome_elf.dll
if %errorlevel% neq 0 goto :cmEnd ...

解決辦法:根據(jù)
image.png

拷貝該文件下所有文件到指定文件夾即可。

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務。

友情鏈接更多精彩內(nèi)容