hlwhl / webview_cef Goto Github PK
View Code? Open in Web Editor NEWWebView for Flutter Desktop Apps using CEF(Chromium Embedded Framework) [Work in Progress]
License: Apache License 2.0
WebView for Flutter Desktop Apps using CEF(Chromium Embedded Framework) [Work in Progress]
License: Apache License 2.0
M1 played well, but x86 was not smooth.
And the cursor was hidded on Windows sometimes.
is there a way to update the url?
@hlwhl After shiftshaders files are copied into exe folder, error while rendering WebGL disappears. Instead of WebGL experience loading, 3D images are being rendered in WebGL with image by image interaction thus rendering WebGL useless. You can notice the same in www.sketchfab.com if you use Webview_cef on a non GPU windows machine. So essentially WebGL is still not enabled or rendered.
We mistook this as working as the error while loading WebGL no longer appears and WebGL rendered image shows up in WebGL. But you will see that same "WebGL disabled" message if you try www.sketchfab.com in Webview_cef on a non GPU windows machine.
我在 Windows 下跑了一下 example,应用程序启动后是正常,但当我将程序窗口从 4K 显示器移动到 1080P 显示器时(前者系统缩放比例是 150%,dpi = 1.5,后者是 1),webview 点击、调整尺寸、刷新页面都不再有响应,终端也没有错误信息输出,webview 之外的 UI 仍然正常。
@hlwhl Thank you for your support on the previous issue!
Does it not support high dpi?
and running into some performance issues
Is it because I am using debug mode?
If it's just a simple display of youtube, it will also lag
Thanks for the useful library. Hope to support http request and response message filtering.
Launching lib/main.dart on macOS in debug mode...
--- xcodebuild: WARNING: Using the first of multiple matching destinations:
{ platform:macOS, arch:x86_64, id:829131F2-ACF5-50F4-B0E5-D79A170562A0 }
{ platform:macOS, name:Any Mac }
Undefined symbols for architecture x86_64:
"CefURIEncode(CefStringBase<CefStringTraitsUTF16> const&, bool)", referenced from:
(anonymous namespace)::GetDataURI(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) in cef_bridge.o
"CefInitialize(CefMainArgs const&, CefStructBase<CefSettingsTraits> const&, scoped_refptr<CefApp>, void*)", referenced from:
+[CefWrapper startCef] in CefWrapper.o
"CefCurrentlyOn(cef_thread_id_t)", referenced from:
WebviewApp::OnContextInitialized() in cef_bridge.o
WebviewHandler::OnAfterCreated(scoped_refptr<CefBrowser>) in cef_bridge.o
WebviewHandler::DoClose(scoped_refptr<CefBrowser>) in cef_bridge.o
WebviewHandler::OnBeforeClose(scoped_refptr<CefBrowser>) in cef_bridge.o
WebviewHandler::OnLoadError(scoped_refptr<CefBrowser>, scoped_refptr<CefFrame>, cef_errorcode_t, CefStringBase<CefStringTraitsUTF16> const&, CefStringBase<CefStringTraitsUTF16> const&) in cef_bridge.o
WebviewHandler::CloseAllBrowsers(bool) in cef_bridge.o
WebviewHandler::GetViewRect(scoped_refptr<CefBrowser>, CefRect&) in cef_bridge.o
...
"CefBase64Encode(void const*, unsigned long)", referenced from:
(anonymous namespace)::GetDataURI(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) in cef_bridge.o
"CefExecuteProcess(CefMainArgs const&, scoped_refptr<CefApp>, void*)", referenced from:
+[CefWrapper init] in CefWrapper.o
"CefQuitMessageLoop()", referenced from:
WebviewHandler::OnBeforeClose(scoped_refptr<CefBrowser>) in cef_bridge.o
"CefDoMessageLoopWork()", referenced from:
+[CefWrapper doMessageLoopWork] in CefWrapper.o
"CefBrowserHost::CreateBrowser(CefWindowInfo const&, scoped_refptr<CefClient>, CefStringBase<CefStringTraitsUTF16> const&, CefStructBase<CefBrowserSettingsTraits> const&, scoped_refptr<CefDictionaryValue>, scoped_refptr<CefRequestContext>)", referenced from:
WebviewApp::OnContextInitialized() in cef_bridge.o
"CefCommandLine::GetGlobalCommandLine()", referenced from:
WebviewHandler::IsChromeRuntimeEnabled() in cef_bridge.o
"CefScopedLibraryLoader::Load(bool)", referenced from:
CefScopedLibraryLoader::LoadInMain() in CefWrapper.o
"CefScopedLibraryLoader::CefScopedLibraryLoader()", referenced from:
+[CefWrapper init] in CefWrapper.o
"CefScopedLibraryLoader::~CefScopedLibraryLoader()", referenced from:
+[CefWrapper init] in CefWrapper.o
"cef::logging::LogMessage::LogMessage(char const*, int, int)", referenced from:
WebviewApp::OnContextInitialized() in cef_bridge.o
WebviewHandler::WebviewHandler() in cef_bridge.o
WebviewHandler::WebviewHandler() in cef_bridge.o
WebviewHandler::OnAfterCreated(scoped_refptr<CefBrowser>) in cef_bridge.o
WebviewHandler::DoClose(scoped_refptr<CefBrowser>) in cef_bridge.o
WebviewHandler::OnBeforeClose(scoped_refptr<CefBrowser>) in cef_bridge.o
scoped_refptr<CefBrowser>::operator->() const in cef_bridge.o
...
"cef::logging::LogMessage::~LogMessage()", referenced from:
WebviewApp::OnContextInitialized() in cef_bridge.o
WebviewHandler::WebviewHandler() in cef_bridge.o
WebviewHandler::WebviewHandler() in cef_bridge.o
WebviewHandler::OnAfterCreated(scoped_refptr<CefBrowser>) in cef_bridge.o
WebviewHandler::DoClose(scoped_refptr<CefBrowser>) in cef_bridge.o
WebviewHandler::OnBeforeClose(scoped_refptr<CefBrowser>) in cef_bridge.o
scoped_refptr<CefBrowser>::operator->() const in cef_bridge.o
...
"_cef_string_utf16_clear", referenced from:
CefWindowInfoTraits::clear(_cef_window_info_t*) in cef_bridge.o
CefStringTraitsUTF16::clear(_cef_string_utf16_t*) in cef_bridge.o
CefBrowserSettingsTraits::clear(_cef_browser_settings_t*) in cef_bridge.o
CefStringTraitsUTF16::clear(_cef_string_utf16_t*) in CefWrapper.o
CefSettingsTraits::clear(_cef_settings_t*) in CefWrapper.o
"_cef_string_utf16_to_utf8", referenced from:
CefStringTraitsUTF16::to_string(_cef_string_utf16_t const*) in cef_bridge.o
"_cef_string_utf8_clear", referenced from:
CefStringTraitsUTF16::to_string(_cef_string_utf16_t const*) in cef_bridge.o
"_cef_string_utf8_to_utf16", referenced from:
CefStringTraitsUTF16::from_string(char const*, unsigned long, _cef_string_utf16_t*) in cef_bridge.o
CefStringTraitsUTF16::from_string(char const*, unsigned long, _cef_string_utf16_t*) in CefWrapper.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
note: Using new build system
note: Planning
note: Build preparation complete
note: Building targets in dependency order
** BUILD FAILED **
You can implement something icons_launcher
implemented to change icons.
flutter pub get
# create a function that can be passed in terminal and download binaries directly
flutter pub run icons_launcher:create
Create a installer_cli.dart
and implement something like:
flutter pub get
flutter pub run webview_cef:download
Example for installer_cli.dart
:
// ignore_for_file: avoid_print
import 'dart:io';
void downloadPrequisitesForMac() async {
if (Platform.isMacOS) {
if (await File('../macos/third/cef/libcef_dll_wrapper.a').exists()) {
return;
} else {
const url =
'https://github.com/hlwhl/webview_cef/releases/download/pods/mac103.0.12-universal.zip';
final file = File('../mac103.0.12-universal.zip');
final request = await HttpClient().getUrl(Uri.parse(url));
final response = await request.close();
final contentLength = response.contentLength;
var bytes = <int>[];
var total = 0;
await for (var data in response) {
bytes.addAll(data);
total += data.length;
stdout.write('\x1B[2J\x1B[0;0H');
print('Downloading ${(total / contentLength * 100).toInt()}%');
}
await file.writeAsBytes(bytes);
print('Download complete.');
print('Extracting files...');
await Process.run('unzip', [
'../mac103.0.12-universal.zip',
'-d',
'../macos/third/cef/',
]);
print('Files successfully extracted.');
print('Cleaning up...');
file.delete();
print('Done.');
}
} else {
return;
}
}
Currently only support basic characters input. Need to implement full IME support on both macOS and Windows platform.
请问这个可以上传至 Apple Appstore 么?
原版CEF好像有private api ,过不了审核的
该插件无法通过编译,所有日志如下:
Launching lib/main.dart on macOS in debug mode...
Building macOS application...
Undefined symbols for architecture x86_64:
"CefURIEncode(CefStringBase const&, bool)", referenced from:
(anonymous namespace)::GetDataURI(std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > const&, std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > const&) in cef_bridge.o
"CefInitialize(CefMainArgs const&, CefStructBase const&, scoped_refptr, void*)", referenced from:
+[CefWrapper startCef] in CefWrapper.o
"CefCurrentlyOn(cef_thread_id_t)", referenced from:
SimpleApp::OnContextInitialized() in cef_bridge.o
SimpleHandler::OnTitleChange(scoped_refptr, CefStringBase const&) in cef_bridge.o
SimpleHandler::OnAfterCreated(scoped_refptr) in cef_bridge.o
SimpleHandler::DoClose(scoped_refptr) in cef_bridge.o
SimpleHandler::OnBeforeClose(scoped_refptr) in cef_bridge.o
SimpleHandler::OnLoadError(scoped_refptr, scoped_refptr, cef_errorcode_t, CefStringBase const&, CefStringBase const&) in cef_bridge.o
SimpleHandler::CloseAllBrowsers(bool) in cef_bridge.o
...
"CefBase64Encode(void const*, unsigned long)", referenced from:
(anonymous namespace)::GetDataURI(std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > const&, std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > const&) in cef_bridge.o
"CefExecuteProcess(CefMainArgs const&, scoped_refptr, void*)", referenced from:
+[CefWrapper init] in CefWrapper.o
"CefQuitMessageLoop()", referenced from:
SimpleHandler::OnBeforeClose(scoped_refptr) in cef_bridge.o
"CefDoMessageLoopWork()", referenced from:
+[CefWrapper doMessageLoopWork] in CefWrapper.o
"CefBrowserHost::CreateBrowser(CefWindowInfo const&, scoped_refptr, CefStringBase const&, CefStructBase const&, scoped_refptr, scoped_refptr)", referenced from:
SimpleApp::OnContextInitialized() in cef_bridge.o
"CefBrowserView::GetForBrowser(scoped_refptr)", referenced from:
SimpleHandler::OnTitleChange(scoped_refptr, CefStringBase const&) in cef_bridge.o
"CefCommandLine::GetGlobalCommandLine()", referenced from:
SimpleHandler::IsChromeRuntimeEnabled() in cef_bridge.o
"CefScopedLibraryLoader::Load(bool)", referenced from:
CefScopedLibraryLoader::LoadInMain() in CefWrapper.o
"CefScopedLibraryLoader::CefScopedLibraryLoader()", referenced from:
+[CefWrapper init] in CefWrapper.o
"CefScopedLibraryLoader::~CefScopedLibraryLoader()", referenced from:
+[CefWrapper init] in CefWrapper.o
"cef::logging::LogMessage::LogMessage(char const*, int, int)", referenced from:
SimpleApp::OnContextInitialized() in cef_bridge.o
SimpleHandler::SimpleHandler(bool) in cef_bridge.o
SimpleHandler::SimpleHandler(bool) in cef_bridge.o
SimpleHandler::OnTitleChange(scoped_refptr, CefStringBase const&) in cef_bridge.o
scoped_refptr::operator->() const in cef_bridge.o
scoped_refptr::operator->() const in cef_bridge.o
SimpleHandler::OnAfterCreated(scoped_refptr) in cef_bridge.o
...
"cef::logging::LogMessage::~LogMessage()", referenced from:
SimpleApp::OnContextInitialized() in cef_bridge.o
SimpleHandler::SimpleHandler(bool) in cef_bridge.o
SimpleHandler::SimpleHandler(bool) in cef_bridge.o
SimpleHandler::OnTitleChange(scoped_refptr, CefStringBase const&) in cef_bridge.o
scoped_refptr::operator->() const in cef_bridge.o
scoped_refptr::operator->() const in cef_bridge.o
SimpleHandler::OnAfterCreated(scoped_refptr) in cef_bridge.o
...
"_cef_string_utf16_clear", referenced from:
CefWindowInfoTraits::clear(_cef_window_info_t*) in cef_bridge.o
CefStringTraitsUTF16::clear(_cef_string_utf16_t*) in cef_bridge.o
CefBrowserSettingsTraits::clear(_cef_browser_settings_t*) in cef_bridge.o
CefStringTraitsUTF16::clear(_cef_string_utf16_t*) in CefWrapper.o
CefSettingsTraits::clear(_cef_settings_t*) in CefWrapper.o
"_cef_string_utf16_to_utf8", referenced from:
CefStringTraitsUTF16::to_string(_cef_string_utf16_t const*) in cef_bridge.o
"_cef_string_utf8_clear", referenced from:
CefStringTraitsUTF16::to_string(_cef_string_utf16_t const*) in cef_bridge.o
"_cef_string_utf8_to_utf16", referenced from:
CefStringTraitsUTF16::from_string(char const*, unsigned long, _cef_string_utf16_t*) in cef_bridge.o
CefStringTraitsUTF16::from_string(char const*, unsigned long, _cef_string_utf16_t*) in CefWrapper.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
rsync error: received SIGINT, SIGTERM, or SIGHUP (code 20) at /System/Volumes/Data/SWE/macOS/BuildRoots/b8ff8433dc/Library/Caches/com.apple.xbs/Sources/rsync/rsync-55/rsync/rsync.c(244) [sender=2.6.9]
Command PhaseScriptExecution failed with a nonzero exit code
** BUILD FAILED **
Exception: Build process failed
Hi, I have been facing a new issue with the latest changes.
Steps to reproduce:
d - opens dictionary
e - emoji panel opens
f - force quits the app
Have not tested with the other keys yet.
Edit: Can not confirm if this was reproducible prior to 0.1.0
加入组件构建时提示 LINK : fatal error LNK1104: �����ļ���E:\Flutter2020\hd_smart_dsp_tf\windows\flutter\ephemeral.plugin_symlinks\webview_cef\windows\cefbins\debug\libcef.lib�� [E:\Flutter2020\hd_smart_dsp_tf\build\windows\plugins\webview_cef\webview_cef_plugin.vcxproj]
Exception: Build process failed.,下载Demo和引入都是这哥错误
Add https://pub.dev/packages/webview_cef
in the repository section.
Copy is disable or not working, not even right click contextmenu working in the webview. Tried to figure out by example but not found Copy Enable Option.
Please add support i will, i will consider a donation for if support it
Hi there - On the plugin listing on pub.dev it claims this plugin has support for macOS, but it seems this is not built out yet. What's the status of this?
Thanks!
in CefSharp, there is support for registering a custom schema hander for fetching resources like custom://cefsharp/assets/css/style.css
This would be useful for serving application resources without having to write files to disk or run a http server
I used to want to implement a CEF plugin. But I had a lot of problems building CEF library that supports H264. And now thank you implemented such a great plugin. However webview_cef also cannot play videos online. I really hope it supports play videos online.
I tried to add two tabs, but they shared one webview instance, couldn't load two different urls at separately.
[1122/180616.560:ERROR:alloy_main_delegate.cc(554)] Could not load chrome_100_percent.pak
[1122/180616.561:ERROR:alloy_main_delegate.cc(563)] Could not load chrome_200_percent.pak
[1122/180616.572:INFO:content_main_runner_impl.cc(1173)] Chrome is running in full browser mode.
[1122/180622.280:ERROR:network_service_instance_impl.cc(978)] Network service crashed, restarting service.
[1122/180622.735:ERROR:gpu_process_host.cc(974)] GPU process exited unexpectedly: exit_code=-1073741502
[1122/180622.735:WARNING:gpu_process_host.cc(1279)] The GPU process has crashed 1 time(s)
[1122/180627.253:ERROR:network_service_instance_impl.cc(978)] Network service crashed, restarting service.
[1122/180628.370:ERROR:gpu_process_host.cc(974)] GPU process exited unexpectedly: exit_code=-1073741502
[1122/180628.370:WARNING:gpu_process_host.cc(1279)] The GPU process has crashed 2 time(s)
[1122/180632.338:ERROR:network_service_instance_impl.cc(978)] Network service crashed, restarting service.
[1122/180634.219:ERROR:gpu_process_host.cc(974)] GPU process exited unexpectedly: exit_code=-1073741502
[1122/180634.219:WARNING:gpu_process_host.cc(1279)] The GPU process has crashed 3 time(s)
[1122/180636.886:ERROR:network_service_instance_impl.cc(978)] Network service crashed, restarting service.
[1122/180638.248:ERROR:gpu_process_host.cc(974)] GPU process exited unexpectedly: exit_code=-1073741502
[1122/180638.248:WARNING:gpu_process_host.cc(1279)] The GPU process has crashed 4 time(s)
[1122/180641.843:ERROR:network_service_instance_impl.cc(978)] Network service crashed, restarting service.
[1122/180642.555:ERROR:gpu_process_host.cc(974)] GPU process exited unexpectedly: exit_code=-1073741502
[1122/180642.555:WARNING:gpu_process_host.cc(1279)] The GPU process has crashed 5 time(s)
[1122/180646.750:ERROR:network_service_instance_impl.cc(978)] Network service crashed, restarting service.
[1122/180647.536:ERROR:gpu_process_host.cc(974)] GPU process exited unexpectedly: exit_code=-1073741502
[1122/180647.536:WARNING:gpu_process_host.cc(1279)] The GPU process has crashed 6 time(s)
[1122/180647.536:FATAL:gpu_data_manager_impl_private.cc(447)] GPU process isn't usable. Goodbye.
I'm trying to pass a url by parameter and passing that parameter through initstate. In debug mode it works. however, when compiling the program, it calls the url of the parameter and then redirects to the default url (in this case, flutter.dev), would there be a solution for this?
There is no ability to interact with text entry fields. Example: I open the webview on youtube.com, and if I try to search for a video, the interaction for entering text is not taken. However, I recommend looking at the webview_flutter package to improve this package
C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(157,5): error MSB3073: 命令“setlocal [D:\workspace\edesk_flutter_app\build\windows\INSTALL.vcxproj]
C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(157,5): error MSB3073: "C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe" -DBUILD_TYPE=Debug -P cmake_install.cmake [D:\workspace\edesk_flutter_app\build\windows\INSTALL.vcxproj]
C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(157,5): error MSB3073: if %errorlevel% neq
0 goto :cmEnd [D:\workspace\edesk_flutter_app\build\windows\INSTALL.vcxproj]
C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(157,5): error MSB3073: :cmEnd [D:\workspace\edesk_flutter_app\build\windows\INSTALL.vcxproj]
C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(157,5): error MSB3073: endlocal & call :cmErrorLevel %errorlevel% & goto :cmDone [D:\workspace\edesk_flutter_app\build\windows\INSTALL.vcxproj]
C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(157,5): error MSB3073: :cmErrorLevel [D:\workspace\edesk_flutter_app\build\windows\INSTALL.vcxproj]
C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(157,5): error MSB3073: exit /b %1 [D:\workspace\edesk_flutter_app\build\windows\INSTALL.vcxproj]
C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(157,5): error MSB3073: :cmDone [D:\workspace\edesk_flutter_app\build\windows\INSTALL.vcxproj]
C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(157,5): error MSB3073: if %errorlevel% neq
0 goto :VCEnd [D:\workspace\edesk_flutter_app\build\windows\INSTALL.vcxproj]
C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(157,5): error MSB3073: :VCEnd”已退出,代码
为 1。 [D:\workspace\edesk_flutter_app\build\windows\INSTALL.vcxproj]
<img width="860" alt="image" src="https://user-images.githubusercontent.com/28723827/195575271-8058a508-06ea-4605-bf2a-6d1e459562b0.png">
您好 用你的demo在mac上打开pdf 闪退了
Originally posted by @iOSluozhiping in #20 (comment)
in chrome the video autoplay is disabled unless it is whitelisted, can we add an argument so that the video autoplay can run?--autoplay-policy=no-user-gesture-required
您好,如果需要播放视频,MP4或者其他格式的视频,需要重新编译CEF的库,来替换吗?
https://github.com/hlwhl/webview_cef/issues/19 就和这里说的一样?
I am curious if there are plans to support android and iOS.
This would be nice because then all platforms would use the same webview and support the same features.
那个framework超过100m了,应该要用zip的形式托管到其它的地方。
这个libcef_dll_wrapper.a能发出来一下吗
这个插件很不错,请问这个插件到时会支持linux吗
I am using MacBook Pro 14" with M1 Max chip (arm64) and I copied all the files from cef bundle inside macOS/third/cef
but i am still getting errors with other linker flags.
WebGL is not rendering in WebView_CEF. Can you please enable WebGL rendering? We use WebView_CEF in our flutter project that requires WebGL rendering. We have tried using WebView_Windows but the content rendering is fuzzy. We have tried DPI scaling settings, Pixel Snap and everything that we could find in discussion forums. But we couldn't resolve the fuzzy rendering issue. We came across WebView_CEF which renders well without any of the rendering issues faced in WebView_Windows but when it comes to WebGL, WebView_CEF is not working. You can try opening https://sketchfab.com/ and you will see that the homepage demo bot fails to load. Any fix to make WebView_CEF work with WebGL is highly appreciated.
On further research we found that swiftshader is enabled by default in CEF 3071 branch and newer when GPU is disabled and that swiftshader is required to render WebGL. It looks like CEF branch is 5040, GPU is disabled, and WebGL is enabled in the code but we still can't figure out why WebGL is not loading. Any direction to resolving this is highly appreciated.
您好,这个插件可以实现对cookie的操作吗
after read #11, i will update this, update 30 nov 2022,
error :
clang: error: no such file or directory: 'Embedded'
clang: error: no such file or directory: 'Framework'
u must clear "other linker flags" in Runner.xcodeproj
I need a JavaScript Handler function. Do you have any plans to develop it?
---update new way 27 NOV 2022, more simple than before
merge 2 cef framework and 2 libcef_dll
merge libcef_dll_wrapper
lipo -create "./arm64/libcef_dll_wrapper.a" "./x86_64/libcef_dll_wrapper.a" -output "./libcef_dll_wrapper.a"
CEF Framework
mkdir "./Chromium Embedded Framework.framework"
lipo -create "./arm64/Chromium Embedded Framework.framework/Chromium Embedded Framework" "./x86_64/Chromium Embedded Framework.framework/Chromium Embedded Framework" -output ./"Chromium Embedded Framework.framework/Chromium Embedded Framework"
Libraries CEF Framework
mkdir "./Chromium Embedded Framework.framework/Libraries"
lipo -create "./arm64/Chromium Embedded Framework.framework/Libraries/libEGL.dylib" "./x86_64/Chromium Embedded Framework.framework/Libraries/libEGL.dylib" -output "./Chromium Embedded Framework.framework/Libraries/libEGL.dylib"
lipo -create "./arm64/Chromium Embedded Framework.framework/Libraries/libGLESv2.dylib" "./x86_64/Chromium Embedded Framework.framework/Libraries/libGLESv2.dylib" -output "./Chromium Embedded Framework.framework/Libraries/libGLESv2.dylib"
lipo -create "./arm64/Chromium Embedded Framework.framework/Libraries/libvk_swiftshader.dylib" "./x86_64/Chromium Embedded Framework.framework/Libraries/libvk_swiftshader.dylib" -output "./Chromium Embedded Framework.framework/Libraries/libvk_swiftshader.dylib"
cp "./arm64/Chromium Embedded Framework.framework/Libraries/vk_swiftshader_icd.json" "./Chromium Embedded Framework.framework/Libraries/vk_swiftshader_icd.json"
Resources CEF Framework
cp -R "./arm64/Chromium Embedded Framework.framework/Resources" "./Chromium Embedded Framework.framework/Resources"
cp "./x86_64/Chromium Embedded Framework.framework/Resources/v8_context_snapshot.x86_64.bin" "./Chromium Embedded Framework.framework/Resources/v8_context_snapshot.x86_64.bin"
Codesign "Chromium Embedded Framework.framework"
u need codesign "Chromium Embedded Framework.framework" for making universal macos apps. if u create applications with separated architectures, you don't need this.
if you dont have developer account, u can codesign"Chromium Embedded Framework.framework" without developer account
i got tutorial from this
u need create a self-signed certificate, click link above
sudo codesign -fs "Name_Of_Certificate" "./Chromium Embedded Framework.framework/Chromium Embedded Framework"
old way :
i was found way to build in MacOS,
next step we need configure webview_cef_x86_64 folder.
s.vendored_libraries = 'third/cef/x86_64/libcef_dll_wrapper.a'
s.vendored_libraries = 'third/cef/x86_64/libcef_dll_wrapper_x86_64.a'
s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES' }
s.pod_target_xcconfig = { 'VALID_ARCHS' => 'x86_64' }
we need to configure podspec in webview_cef(for arm64) too.
only
s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES' }
to
s.pod_target_xcconfig = { 'VALID_ARCHS' => 'arm64' }
next step need configure pubsec.yaml in project(open with android studio/visual studio or other)
add this to dependencies example :
dependencies:
...
webview_cef: ^0.0.7
webview_cef_x86_64:
path: ./webview_cef_x86_64
finish
run in terminal
flutter build macos
if u got a error, u can see
flutter_wrapper_app.lib(flutter_engine.obj) : error LNK2019: 无法解析的外部符号 __imp_FlutterDesktopEngineReloadPlatformBrightness,函数 "public: void __cdecl flutter::FlutterEngine::ReloadPlatformBrightness(void)" (?ReloadPlatformBrightness@FlutterEngine@flutter@@QEAAXXZ) 中引用了该符号 [D:\flutter\webview_cef\example\build\windows\runner\webview_cef_example.vcxproj]
D:\flutter\webview_cef\example\build\windows\runner\Debug\webview_cef_example.exe : fatal error LNK1120: 1 个无法解析的外部命令 [D:\flutter\webview_cef\example\build\windows\runner\webview_cef_example.vcxproj]
Exception: Build process failed.
flutter 版本:3.3.6
I opened an empty project
And introduce webview_cef
The following error is reported when it starts up
Can any expert help?
C:\Users\StevenXiao\StudioProjects\windows_cmf\windows\flutter\ephemeral\.plugin_symlinks\webview_cef\windows\simple_handler.h(1,1): error C2220: �H�Uĵ�i�������~�B�z [C:\Users\StevenXiao\StudioProjects\windows_cmf\build\windows\plugins\webview_cef\webview_cef_plugin.vcxproj] C:\Users\StevenXiao\StudioProjects\windows_cmf\windows\flutter\ephemeral\.plugin_symlinks\webview_cef\windows\simple_handler.h(1,1): warning C4819: �ɮקt���L�k�b�ثe�r�X�� (950) �����ܪ��r���C�ХH Unicode �榡�x�s�ɮץH�����ƿ� [C:\Users\StevenXiao\StudioProjects\windows_cmf\build\windows\plugins\webview_cef\webview_cef_plugin.vcxproj] C:\Users\StevenXiao\StudioProjects\windows_cmf\windows\flutter\ephemeral\.plugin_symlinks\webview_cef\windows\simple_handler.h(1,1): error C2220: �H�Uĵ�i�������~�B�z [C:\Users\StevenXiao\StudioProjects\windows_cmf\build\windows\plugins\webview_cef\webview_cef_plugin.vcxproj] C:\Users\StevenXiao\StudioProjects\windows_cmf\windows\flutter\ephemeral\.plugin_symlinks\webview_cef\windows\simple_handler.h(1,1): warning C4819: �ɮקt���L�k�b�ثe�r�X�� (950) �����ܪ��r���C�ХH Unicode �榡�x�s�ɮץH�����ƿ� [C:\Users\StevenXiao\StudioProjects\windows_cmf\build\windows\plugins\webview_cef\webview_cef_plugin.vcxproj] C:\Users\StevenXiao\StudioProjects\windows_cmf\windows\flutter\ephemeral\.plugin_symlinks\webview_cef\windows\simple_handler.h(1,1): error C2220: �H�Uĵ�i�������~�B�z [C:\Users\StevenXiao\StudioProjects\windows_cmf\build\windows\plugins\webview_cef\webview_cef_plugin.vcxproj] C:\Users\StevenXiao\StudioProjects\windows_cmf\windows\flutter\ephemeral\.plugin_symlinks\webview_cef\windows\simple_handler.h(1,1): warning C4819: �ɮקt���L�k�b�ثe�r�X�� (950) �����ܪ��r���C�ХH Unicode �榡�x�s�ɮץH�����ƿ� [C:\Users\StevenXiao\StudioProjects\windows_cmf\build\windows\plugins\webview_cef\webview_cef_plugin.vcxproj] C:\Users\StevenXiao\StudioProjects\windows_cmf\windows\flutter\ephemeral\.plugin_symlinks\webview_cef\windows\simple_handler.h(1,1): error C2220: �H�Uĵ�i�������~�B�z [C:\Users\StevenXiao\StudioProjects\windows_cmf\build\windows\plugins\webview_cef\webview_cef_plugin.vcxproj] C:\Users\StevenXiao\StudioProjects\windows_cmf\windows\flutter\ephemeral\.plugin_symlinks\webview_cef\windows\simple_handler.h(1,1): warning C4819: �ɮקt���L�k�b�ثe�r�X�� (950) �����ܪ��r���C�ХH Unicode �榡�x�s�ɮץH�����ƿ� [C:\Users\StevenXiao\StudioProjects\windows_cmf\build\windows\plugins\webview_cef\webview_cef_plugin.vcxproj] Exception: Build process failed.
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.