tishion / qcefview Goto Github PK
View Code? Open in Web Editor NEWMoved to CefView/QCefView
Home Page: https://cefview.github.io/QCefView/
License: GNU Lesser General Public License v3.0
Moved to CefView/QCefView
Home Page: https://cefview.github.io/QCefView/
License: GNU Lesser General Public License v3.0
How to add widget on QCefview?
'QCefViewTest.exe' (Win32): Loaded 'C:\Windows\SysWOW64\DataExchange.dll'. Cannot find or open the PDB file.
'QCefViewTest.exe' (Win32): Loaded 'C:\Windows\SysWOW64\dcomp.dll'. Cannot find or open the PDB file.
'QCefViewTest.exe' (Win32): Loaded 'C:\Windows\SysWOW64\twinapi.appcore.dll'. Cannot find or open the PDB file.
'QCefViewTest.exe' (Win32): Loaded 'C:\Windows\SysWOW64\rmclient.dll'. Cannot find or open the PDB file.
'QCefViewTest.exe' (Win32): Loaded 'C:\Windows\SysWOW64\TextInputFramework.dll'. Cannot find or open the PDB file.
'QCefViewTest.exe' (Win32): Loaded 'C:\Windows\SysWOW64\CoreUIComponents.dll'. Cannot find or open the PDB file.
'QCefViewTest.exe' (Win32): Loaded 'C:\Windows\SysWOW64\CoreMessaging.dll'. Cannot find or open the PDB file.
'QCefViewTest.exe' (Win32): Loaded 'C:\Windows\SysWOW64\ntmarta.dll'. Cannot find or open the PDB file.
'QCefViewTest.exe' (Win32): Loaded 'C:\Windows\SysWOW64\WinTypes.dll'. Cannot find or open the PDB file.
'QCefViewTest.exe' (Win32): Loaded 'C:\Windows\SysWOW64\WinTypes.dll'. Cannot find or open the PDB file.
'QCefViewTest.exe' (Win32): Unloaded 'C:\Windows\SysWOW64\WinTypes.dll'
QWidget: Must construct a QApplication before a QWidget
Unhandled exception at 0x0FC69F67 (QCefView.dll) in QCefViewTest.exe: Fatal program exit requested.
有时候不能正常退出,阻塞在close_cv_.wait(lock);
直接在QDialog原生窗口上点关闭,出现情况比较少,但是通过this->reject()等一直都是阻塞状态。
What is the difference between QCefView and QtWebEngine?
在OnBeforeCommandLineProcessing添加command_line->AppendSwitch("enable-system-flash");不生效
Hi. Can you built QCefView project binaries with Visual Studio 2015 x64 Release, Multi-threaded DLL (/MD), because I get compiler errors. I can send prebuilt libcef_dll_wrapper.lib x64 (Multi-threaded DLL (/MD)). Thanks.
高分屏下嵌入qcefview 显示不正确
Submmited by @Connlaio
tishion: I cloned your code from the github and build it with Qt5.3.1 + MSVC2013,the cef version is 2556,when I tried to run the project Test,it will crashed in the error is "Debug Assertion Failed! Expression: _pFirstBlock == pHead", and I tried to debug it ,found the error is in the CCefSetting construct fuction. Did you fixed it ?
Add QCefQuery/QCefQueryCancel feature
你好,我让一个QPushButton绝对定位在cef网页上,但是永远都是被网页遮挡,请问有啥解决方案吗?
When my test program exits, it will block. When I debug, I found that after executing the "close_cv_.wait(lock);" statement of QCefViewBrowserHandler::CloseAllBrowsers(bool force_close), the program is blocked, and the program does not enter "void OnBeforeClose( CefRefPtr browser)" this function.
I am building the entire project using Qt5.6.3 +VS2013
Add QCef url request feature
attach file is a transparent html page, QCefView don't support render transparent backgroud.
Hi, sorry my english is bad.
For enable show page with Self signed certificates or invalid certificates, follow theses steps:
1 - change file: QCefViewBrowserHandler.h
#ifndef QCEFVIEWHANDLER_H_
#define QCEFVIEWHANDLER_H_
#pragma once
#include
#include
#include
#include
#include
#include
#include "include/cef_client.h"
#include "include/wrapper/cef_message_router.h"
#include "../../inc/QCefView.h"
class QCefQueryHandler;
// ADD BY RPA -> 28-02-2017
typedef cef_errorcode_t ErrorCode;
class QCefViewBrowserHandler
: public CefClient
, public CefContextMenuHandler
//, public CefDialogHandler
, public CefDisplayHandler
//, public CefDownloadHandler
, public CefDragHandler
//, public CefGeolocationHandler
, public CefJSDialogHandler
, public CefKeyboardHandler
, public CefLifeSpanHandler
, public CefLoadHandler
, public CefRequestHandler
{
typedef CefRefPtr MessageRouterPtr;
typedef std::setCefMessageRouterBrowserSide::Handler* MessageHandlerSet;
typedef std::list<CefRefPtr > BrowserList;
public:
QCefViewBrowserHandler(QCefView* host);
~QCefViewBrowserHandler();
//////////////////////////////////////////////////////////////////////////
// CefClient methods:
virtual CefRefPtr<CefContextMenuHandler> GetContextMenuHandler()
{
return this;
}
//virtual CefRefPtr<CefDialogHandler> GetDialogHandler()
//{
// return this;
//}
virtual CefRefPtr<CefDisplayHandler> GetDisplayHandler()
{
return this;
}
//virtual CefRefPtr<CefDownloadHandler> GetDownloadHandler()
//{
// return this;
//}
virtual CefRefPtr<CefDragHandler> GetDragHandler()
{
return this;
}
//virtual CefRefPtr<CefGeolocationHandler> GetGeolocationHandler()
//{
// return this;
//}
virtual CefRefPtr<CefJSDialogHandler> GetJSDialogHandler()
{
return this;
}
virtual CefRefPtr<CefKeyboardHandler> GetKeyboardHandler()
{
return this;
}
virtual CefRefPtr<CefLifeSpanHandler> GetLifeSpanHandler()
{
return this;
}
virtual CefRefPtr<CefLoadHandler> GetLoadHandler()
{
return this;
}
virtual CefRefPtr<CefRequestHandler> GetRequestHandler()
{
return this;
}
virtual bool OnProcessMessageReceived(
CefRefPtr<CefBrowser> browser,
CefProcessId source_process,
CefRefPtr<CefProcessMessage> message);
// ADD BY RPA -> 28-02-2017 ---->>> ADD FOR USE INVALID SSL CERTIFICATE
virtual bool OnCertificateError(
CefRefPtr<CefBrowser> browser,
ErrorCode cert_error,
const CefString& request_url,
CefRefPtr<CefSSLInfo> ssl_info,
CefRefPtr<CefRequestCallback> callback);
// CefContextMenuHandler methods
virtual void OnBeforeContextMenu(
CefRefPtr<CefBrowser> browser,
CefRefPtr<CefFrame> frame,
CefRefPtr<CefContextMenuParams> params,
CefRefPtr<CefMenuModel> model);
virtual bool OnContextMenuCommand(
CefRefPtr<CefBrowser> browser,
CefRefPtr<CefFrame> frame,
CefRefPtr<CefContextMenuParams> params,
int command_id,
EventFlags event_flags);
// CefDialogHandler methods
//virtual bool OnFileDialog(
// CefRefPtr<CefBrowser> browser,
// FileDialogMode mode,
// const CefString& title,
// const CefString& default_file_name,
// const std::vector<CefString>& accept_types,
// CefRefPtr<CefFileDialogCallback> callback);
// CefDisplayHandler methods
virtual void OnAddressChange(
CefRefPtr<CefBrowser> browser,
CefRefPtr<CefFrame> frame,
const CefString& url);
virtual void OnTitleChange(
CefRefPtr<CefBrowser> browser,
const CefString& title);
virtual bool OnConsoleMessage(
CefRefPtr<CefBrowser> browser,
const CefString& message,
const CefString& source,
int line);
// CefDownloadHandler methods
//virtual void OnBeforeDownload(
// CefRefPtr<CefBrowser> browser,
// CefRefPtr<CefDownloadItem> download_item,
// const CefString& suggested_name,
// CefRefPtr<CefBeforeDownloadCallback> callback);
//virtual void OnDownloadUpdated(
// CefRefPtr<CefBrowser> browser,
// CefRefPtr<CefDownloadItem> download_item,
// CefRefPtr<CefDownloadItemCallback> callback);
//CefDragHandler methods
virtual bool OnDragEnter(
CefRefPtr<CefBrowser> browser,
CefRefPtr<CefDragData> dragData,
CefDragHandler::DragOperationsMask mask);
// CefGeolocationHandler methods
//virtual bool OnRequestGeolocationPermission(
// CefRefPtr<CefBrowser> browser,
// const CefString& requesting_url,
// int request_id,
// CefRefPtr<CefGeolocationCallback> callback);
// CefJSDialogHandler methods
virtual bool OnJSDialog(
CefRefPtr<CefBrowser> browser,
const CefString& origin_url,
const CefString& accept_lang,
JSDialogType dialog_type,
const CefString& message_text,
const CefString& default_prompt_text,
CefRefPtr<CefJSDialogCallback> callback,
bool& suppress_message);
virtual bool OnBeforeUnloadDialog(
CefRefPtr<CefBrowser> browser,
const CefString& message_text,
bool is_reload,
CefRefPtr<CefJSDialogCallback> callback);
virtual void OnResetDialogState(
CefRefPtr<CefBrowser> browser);
// CefKeyboardHandler methods
virtual bool OnPreKeyEvent(
CefRefPtr<CefBrowser> browser,
const CefKeyEvent& event,
CefEventHandle os_event,
bool* is_keyboard_shortcut);
// CefLifeSpanHandler methods:
virtual bool OnBeforePopup(CefRefPtr<CefBrowser> browser,
CefRefPtr<CefFrame> frame,
const CefString& target_url,
const CefString& target_frame_name,
CefLifeSpanHandler::WindowOpenDisposition target_disposition,
bool user_gesture,
const CefPopupFeatures& popupFeatures,
CefWindowInfo& windowInfo,
CefRefPtr<CefClient>& client,
CefBrowserSettings& settings,
bool* no_javascript_access);
virtual void OnAfterCreated(CefRefPtr<CefBrowser> browser);
virtual bool DoClose(CefRefPtr<CefBrowser> browser);
virtual void OnBeforeClose(CefRefPtr<CefBrowser> browser);
// CefLoadHandler methods
virtual void OnLoadingStateChange(
CefRefPtr<CefBrowser> browser,
bool isLoading,
bool canGoBack,
bool canGoForward);
virtual void OnLoadStart(
CefRefPtr<CefBrowser> browser,
CefRefPtr<CefFrame> frame);
virtual void OnLoadEnd(
CefRefPtr<CefBrowser> browser,
CefRefPtr<CefFrame> frame,
int httpStatusCode);
virtual void OnLoadError(
CefRefPtr<CefBrowser> browser,
CefRefPtr<CefFrame> frame,
ErrorCode errorCode,
const CefString& errorText,
const CefString& failedUrl);
// CefRequestHandler methods
virtual bool OnBeforeBrowse(
CefRefPtr<CefBrowser> browser,
CefRefPtr<CefFrame> frame,
CefRefPtr<CefRequest> request,
bool is_redirect);
virtual bool OnOpenURLFromTab(CefRefPtr<CefBrowser> browser,
CefRefPtr<CefFrame> frame,
const CefString& target_url,
CefRequestHandler::WindowOpenDisposition target_disposition,
bool user_gesture);
virtual CefRefPtr<CefResourceHandler> GetResourceHandler(
CefRefPtr<CefBrowser> browser,
CefRefPtr<CefFrame> frame,
CefRefPtr<CefRequest> request);
virtual bool OnQuotaRequest(
CefRefPtr<CefBrowser> browser,
const CefString& origin_url,
int64 new_size,
CefRefPtr<CefRequestCallback> callback);
virtual void OnProtocolExecution(
CefRefPtr<CefBrowser> browser,
const CefString& url,
bool& allow_os_execution);
virtual void OnRenderProcessTerminated(
CefRefPtr<CefBrowser> browser,
TerminationStatus status);
//////////////////////////////////////////////////////////////////////////
void setHostWidget(QCefView* host);
CefRefPtr<CefBrowser> GetBrowser() const;
int GetBrowserId() const;
// Request that all existing browser windows close.
void CloseAllBrowsers(bool force_close);
void CloseAllPopupBrowsers(bool force_close);
bool IsClosing() const;
bool TriggerEvent(const CefRefPtr<CefProcessMessage> msg);
bool ResponseQuery(int64_t query,
bool success, const CefString& response, int error);
bool DispatchNotifyRequest(CefRefPtr<CefBrowser> browser,
CefProcessId source_process,
CefRefPtr<CefProcessMessage> message);
private:
int browser_count_;
int main_browser_id_;
bool is_closing_;
mutable std::mutex mtx_;
CefRefPtr<CefBrowser> main_browser_;
QPointer<QCefView> hostWidget_;
MessageRouterPtr message_router_;
//MessageHandlerSet message_handler_set_;
QCefQueryHandler* cefquery_handler_;
// List of existing browser windows. Only accessed on the CEF UI thread.
BrowserList popup_browser_list_;
// Include the default reference counting implementation.
IMPLEMENT_REFCOUNTING(QCefViewBrowserHandler);
};
#endif
2 - Add this Routine in QCefBrowserHandler.cpp:
bool QCefViewBrowserHandler::OnCertificateError(
CefRefPtr browser,
ErrorCode cert_error,
const CefString& request_url,
CefRefPtr ssl_info,
CefRefPtr callback) {
CEF_REQUIRE_UI_THREAD();
callback->Continue(true);
return true;
}
Done, now, you embedded browser show invalid self signed certificate.
compile it with visual studio 2015 , and complier print the error that cannot open the file "include/cef_app.h"
我完全按照您的步骤,构建并生成了QCefViewTest.exe,但是运行失败,VS2015报错如下
线程 0x6678 已退出,返回值为 0 (0x0)。
“QCefViewTest.exe”(Win32): 已加载“D:\MySpace\IDE\QT\5.10.0\msvc2015\plugins\styles\qwindowsvistastyled.dll”。无法查找或打开 PDB 文件。
“QCefViewTest.exe”(Win32): 已卸载“D:\MySpace\IDE\QT\5.10.0\msvc2015\plugins\styles\qwindowsvistastyled.dll”
“QCefViewTest.exe”(Win32): 已加载“D:\MySpace\IDE\QT\5.10.0\msvc2015\plugins\styles\qwindowsvistastyled.dll”。无法查找或打开 PDB 文件。
[0910/174300.590:WARNING:resource_bundle.cc(358)] locale_file_path.empty() for locale
[0910/174300.590:ERROR:main_delegate.cc(715)] Could not load locale pak for en-US
[0910/174300.590:ERROR:main_delegate.cc(722)] Could not load cef.pak
[0910/174300.591:ERROR:main_delegate.cc(739)] Could not load cef_100_percent.pak
[0910/174300.591:ERROR:main_delegate.cc(748)] Could not load cef_200_percent.pak
[0910/174300.591:ERROR:main_delegate.cc(758)] Could not load cef_extensions.pak
“QCefViewTest.exe”(Win32): 已加载“C:\Windows\SysWOW64\msctf.dll”。已加载符号。
“QCefViewTest.exe”(Win32): 已加载“C:\Windows\SysWOW64\nlaapi.dll”。已加载符号。
线程 0x6b7c 已退出,返回值为 0 (0x0)。
“QCefViewTest.exe”(Win32): 已加载“C:\Windows\SysWOW64\dhcpcsvc6.dll”。已加载符号。
[0910/174300.654:ERROR:content_client.cc(276)] No data resource available for id 101
[0910/174300.655:FATAL:service_manager_context.cc(205)] Check failed: !contents.empty().
QCefViewTest.exe 已触发了一个断点。
0x02B9AF89 (libcef.dll)处(位于 QCefViewTest.exe 中)引发的异常: 0xC000001D: Illegal Instruction。
0x02B9AF89 (libcef.dll) (QCefViewTest.exe 中)处有未经处理的异常: 0xC000001D: Illegal Instruction。
/************************************************/
求解决方案,我用的cef是cef_binary_3.3440.1806.g65046b7_windows32.tar 这个版本
@tishion Hey gay, i'm here again for asking whether the QCefView supports playing mp3 and mp4 files?
请问是否支持老版本cef,我分别编译了2526 2623 3440的warpper,但是在编译QCefView的时候只有3440才能编译通过
I change the CEF version to 3163
but the QCefView auto reload
sub-process always crash
Help me think about where the bug
我按照网上说的方法,在你的QCefViewBrowserApp::OnBeforeCommandLineProcessing函数中加入了以下代码:
command_line->AppendSwitchWithValue("ppapi-flash-version", "22.0.0.209");
command_line->AppendSwitchWithValue("ppapi-flash-path", "PepperFlash\pepflashplayer.dll");
但是好像flash未能正常加载。是否是因为我加代码的地方有问题还是你的项目需要另外的配置。这两行代码我直接加在cef的测试例子里面是可以正常加载flash的。
Can you help me ? Now I have a serious problem, the program crash when close the browser window on debug mode. the fail message is "[0905/100719:FATAL:browser_main.cc(203)] Check failed: 0 == CefURLRequestContext::DebugObjCt (0 vs. 1)"
I can see only a
window_info.SetAsChild((HWND)winId(), rc);
and no bindings for other platforms.
我在我的Application裏使用了多個QCefView實例,但是當我刪除其中一個實例時,QMainWindow的closeEvent會被調用,然後程序退出。
1.可以看到工程里面有4个头文件分别是(QCefView.h/QCefSetting.h/QCefQuery.h/QCefEvent.h),
表示不知道这4个头文件的意义是什么,作用是什么,
2.我在自己创建的QT工程中,直接引入以上4个头文件,还是说需要指定的功能时候就去修改QCefView的源码,来实现?这块有点迷糊,如果是通过QCefView源码来修改,那么上面的4个文件存在的意义是什么?我就可以直接修改QCefView源码即可实现.
3.如果不是修改QCefView源码,而是通过上面4个文件实现功能修改和扩展的话,那么,提供的案例程序(QCefViewTest),是否可以多丰富些内容,比如JS回调处理,下载回调处理,键盘回调处理,等等相关回调的案例.谢谢.
网页中给元素设置title属性,title属性的内容没有tooltip显示
refactor the custom schema request handler
Hi:
Thank you for opening the code.
I have problems using QCefView, When I Change Windows operating system default font size, For example, zoom in 120% Or 150%, The QCefViewTest program interface appears to be flashing;
Run the Test examples in the CEF library, cefsimple.exe is Running normally;
The environment is as follows:
Qt 5.7.1 Win32
cef_binary_3.2623.1401.gb90a3be_windows32
You plugin settings (class---QCefView::Implementation, line---39, code---browserSettings.plugins = STATE_DISABLED) was wrong, this prevents users from using other plugins. Maybe you could choose a more friendly way to control this.
Failed to compile release version due to missing header file.
Refer to: #19
I compiled successfully the
libcef_dll_wrapper.lib and this project
but when i try to start the test app QCefViewTest
when is coming to : ...\cef_binary_3.3396.1775.g5340bb0_windows32\libcef_dll\wrapper\libcef_dll_wrapper.cc
// Execute
int _retval = cef_initialize(
&args, &settings, CefAppCppToC::Wrap(application), windows_sandbox_info);
its just throw exception that looks like this in VS :
Any help will be appreciated
Also i see it is looking for the source in :
The debugger could not locate the source file 'Y:\work\CEF3_git\chromium\src\base\debug\debugger_win.cc'.
which i guess its your drive ...
More info ,
i Tryed in the second run to compile the QCefView using MultiThreadedDebug (Multi-threaded Debug (/MTd))
as this is the default compilation state the libcef_dll_wrapper compiled with
i changed all the projects to Multi-threaded Debug (/MTd)
but now i have this error :
3>qtmaind.lib(qtmain_win.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MDd_DynamicDebug' doesn't match value 'MTd_StaticDebug' in customcefview.obj
3>LIBCMTD.lib(initializers.obj) : warning LNK4098: defaultlib 'msvcrtd.lib' conflicts with use of other libs; use /NODEFAULTLIB:library
3>D:\Dev\my\cpp\cef\Qt\QCefView-master\QCefViewSDK\bin\Debug\\QCefViewTest.exe : fatal error LNK1319: 1 mismatches detected
3>Done building project "QCefViewTest.vcxproj" -- FAILED.
looking in the vcxproj files for example this : QCefView.vcxproj
i still can see that there is section that is using : MultiThreadedDLL
Even though i changed every thing to Multi-threaded Debug (/MTd)
i guess it have to do with the Qt compilation
<AdditionalIncludeDirectories>.\GeneratedFiles;.;$(QTDIR)\include;.\GeneratedFiles\$(ConfigurationName);$(QTDIR)\include\QtCore;$(QTDIR)\include\QtGui;$(QTDIR)\include\QtWidgets;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<DebugInformationFormat />
<TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>
<PrecompiledHeader>Use</PrecompiledHeader>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<OutputFile>$(OutDir)\$(ProjectName).dll</OutputFile>
<AdditionalLibraryDirectories>$(QTDIR)\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>true</GenerateDebugInformation>
Improve the build tools to make it easier to use.
could you tell me how to use the chrome devtool in QCefview.
Thank you!
Add Triggering event logical to QCefView widget
write documents about usage
publish gh-pages
我需要在QCefView上覆盖一个QT真窗口,但是几经尝试都无法成功
QCefView总是会遮盖其他真窗口的展示
并且会多出一个莫名其妙的窗口
Hi
I'm trying to use a static qt lib using static runtime to link against your QCefView. But it fails. First of all we turned of Iterator debugging in VS. Thus the sandbox librarys devlivered by cef dows not link.
Is it possible to use cef in a dll and the QCefView as static lib with static runtime?
您好,我在内嵌的html页面内有<select>标签,用该cef封装无法显示下拉框里的内容。
例如:"<select><option>11</option><option>22</option></select>" ,
想咨询下是什么问题呢?谢谢。
file: QCefView.cpp
func: QCefView::Implementation::browserGoForward()
line: 122
details: wrong cef function ( CanGoForward() ) called, it should be GoForward() instead. please check.
error message:
ERROR:sandbox_linux.cc(364)] InitializeSandbox() called with multiple threads in process gpu-process.
Linux os : CentOS 7 x86_x64
identifier "CefGeolocationHandler" is undefined on file QCefViewBrowserHandler.h
@tishion
First of all thanks for your great example.
I've a problem. In the latest version of CEF the "LoadString" has been deprecated.
Do you know how to deal with that?
pQCefViewHandler_->GetBrowser()->GetMainFrame()->LoadString(strContent, strUrl);
Hello,
I update cef to version 3.3239.1706.gcd33baa
I compiled cef wrapper like indicated in the doc
I copied the files
Release version of QCefViewTest is OK but Debug version of QCefViewTest failed with
[1220/173505.334:ERROR:icc_profile.cc(282)] Failed to accurately approximate transfer function, error: 26.4684/256
[1220/173509.715:FATAL:frame_ctocpp.cc(182)] Check failed: !url.empty().
in the output.
What am I doing wrong ?
I am using Visual Studio 2013
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.