Coder Social home page Coder Social logo

hlwhl / webview_cef Goto Github PK

View Code? Open in Web Editor NEW
148.0 7.0 39.0 1.49 MB

WebView for Flutter Desktop Apps using CEF(Chromium Embedded Framework) [Work in Progress]

License: Apache License 2.0

Dart 0.32% Swift 0.01% CMake 0.41% C++ 42.16% C 56.86% Ruby 0.03% Objective-C 0.06% Objective-C++ 0.14%
cef flutter webview windows flutter-desktop flutter-macos flutter-plugin flutter-windows macos

webview_cef's People

Contributors

bullseye34 avatar doflatango avatar hlwhl avatar kvii avatar mantreshkhurana avatar sinyimzhi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

webview_cef's Issues

mac平台跑不通求大佬指点

mac平台跑不通求大佬指点,inter架构cpu,下载目录是否放入macos平台下?配置:macos/third/cef/下载目录
{874B67DD-35E3-9875-3503-152D7301CD20}

WebGL support - This is continuation of Issue #51

@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.

程序窗口在移动到另一个显示器(不同 DPI)时 webview 界面无响应

我在 Windows 下跑了一下 example,应用程序启动后是正常,但当我将程序窗口从 4K 显示器移动到 1080P 显示器时(前者系统缩放比例是 150%,dpi = 1.5,后者是 1),webview 点击、调整尺寸、刷新页面都不再有响应,终端也没有错误信息输出,webview 之外的 UI 仍然正常。

Not support high dpi

@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
截圖 2022-07-04 上午11 44 54

macOS M1 编译失败

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 **

Better way to distribute prebuilt packages for macOS

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;
  }
}

Full IME support

Currently only support basic characters input. Need to implement full IME support on both macOS and Windows platform.

构建失败

该插件无法通过编译,所有日志如下:
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

keyboard messed up on webview_cef: ^0.1.0

Hi, I have been facing a new issue with the latest changes.
Steps to reproduce:

  • Run the app
  • Have a textfield anywhere in the app
  • Press any of these keys

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

构建失败 windows

加入组件构建时提示 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 pub.dev URL

Add https://pub.dev/packages/webview_cef in the repository section.

Not able to Copy from WebView html

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.

Status of macOS support

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!

Implement custom schema handler

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

Hope it supports play H.264 videos online.

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.

windows runtime error: GPU process isn't usable. Goodbye

[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.

Bug in release mode

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?

Not interactable with text entry

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]

autoplay video not working

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

[Feature] iOS and android support

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.

linux 支持

这个插件很不错,请问这个插件到时会支持linux吗

Not working on macOS (Apple Silicon)

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 support

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.

error in macos Android Studio and temporary fix

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

  1. open project folder, open macos folder
  2. open Runner.xcodeproj, click Runner, open "Build Settings"
  3. scroll and looking for "Lingking"
  4. clearing "Other Linker Flags"

Screenshot 2022-11-30 at 02 36 36

How to Fix Build Release apps in Macos support arm64 and x86_64

---update new way 27 NOV 2022, more simple than before
merge 2 cef framework and 2 libcef_dll

  1. download cef for arm64 and intel(x86_64)
  2. make 2 folder, arm64 and x86_64
  3. copy/extract "cef arm64" to arm64 folder and "cef intel(x86_64)" to x86_64 folder
  4. run this command on terminal

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,

  1. u need copy webview_cef(dart package) to project_folder/webview_cef_x86_64
    u have 2, webview_cef(for arm64) and webview_cef_x86_64(for x86_64).
  2. add chromium embedded framework arm64 to webview_cef

next step we need configure webview_cef_x86_64 folder.

  1. add chromium embedded framework intel to webview_cef_x86_64
  2. rename /macos/webview_cef.podspec to /macos/webview_cef_x86_64.podspec
  3. rename /macos/third/cef/libcef_dll_wrapper.a to /macos/third/cef/libcef_dll_wrapper_x86_64.a
  4. and then edit in file, we need to replace, webview_cef to webview_cef_x86_64 in file pubsec.yaml and /macos/webview_cef_x86_64.podspec
  5. and edit /macos/webview_cef_x86_64.podspec
    s.vendored_libraries = 'third/cef/x86_64/libcef_dll_wrapper.a'
    to
    s.vendored_libraries = 'third/cef/x86_64/libcef_dll_wrapper_x86_64.a'
    and
    s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES' }
    to
    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

windows10 无法编译

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

Build error on windows 10

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.