lecrapouille / gdcef Goto Github PK
View Code? Open in Web Editor NEW[Plugin][Version 0.9.0][Functional] Chromium Embedded Framework Webview for Godot 3 and 4
License: MIT License
[Plugin][Version 0.9.0][Functional] Chromium Embedded Framework Webview for Godot 3 and 4
License: MIT License
The recent GitHub actions CI are a great start. But it would be helpful if we attempt to run the demo apps using the compiled library, to make sure everything loads correctly. This will help catch regressions going forward
Something like Gut could be helpful for this
Hey, great project!
I tried compiling this for windows and linux. Linux worked great, and I was able to run the sample projects by following the documentation.
For windows, compilation seems to finish successfully, but when running the sample project, it exits immediately as soon as I press "run", with no errors printed to the console. I've tried using different versions of godot, and compiling from previous releases, but I'm getting the same result.
Any ideas what I am missing?
Wonder what is missing?
For whatever reason the much more common "wget" module for python is returning 404s when attempting to download the cef binaries even though the URLs are definitely correct.
It may be worth noting in the README
, as per this Stack Overflow Question, using "python3-wget" resolves the issue without having to change anything in the build.py
Is there a way I can send data from the browser side (javascript) to my gdscript and vice-versa?
For example: If a html textbox is typed into can i get the data typed in gdscript?
Hi.
I followed meticulously many times the installation process found here and here, but not once I was able to build the Godot extension.
I can't copy and past the entire stack trace since it's really too long, so this is the last part of stack trace I get:
C:\Users\loren\Desktop\Godot Projects\GDCEF Test\addons\gdcef\thirdparty\cef_binary\tests\ceftests\Release\ceftests.exe
: fatal error LNK1169: rilevato uno o più simboli definiti più volte [C:\Users\loren\Desktop\Godot Projects\GDCEF Test
\addons\gdcef\thirdparty\cef_binary\tests\ceftests\ceftests.vcxproj]
Traceback (most recent call last):
File "C:\Users\loren\Desktop\Godot Projects\GDCEF Test\addons\gdcef\build.py", line 500, in <module>
compile_cef()
File "C:\Users\loren\Desktop\Godot Projects\GDCEF Test\addons\gdcef\build.py", line 294, in compile_cef
run(["cmake", "--build", ".", "--config", CEF_TARGET], check=True)
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.12_3.12.496.0_x64__qbz5n2kfra8p0\Lib\subprocess.py", line 571, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['cmake', '--build', '.', '--config', 'Release']' returned non-zero exit status 1.
I would like to point out that the third line of the installation process ./build.py
doesn't work on my machine and I had to fix it to python3 ./build.py
.
If you need to know more details, just ask.
Thank you in advance.
Hi, I'm using Godot 3.5.2. I'm now trying to run the demos to test around how it works for this WebView. Currently having build error. May I know what's the problem? I do follow the installation guideline, but not sure why getting this error...
Platform: Windows 10
Python version: 3.11.4
CMake version: 3.27.0
x64 Native Tools Command Prompt for VS 2022 (Run as Admin)
Error said it cannot find the file specified.
C:\Users\XXX\Downloads\gdcef-master\gdcef-master\addons\gdcef>python ./build.py
←[32m[INFO] Checking cmake version ...←[00m
Microsoft (R) C/C++ Optimizing Compiler Version 19.36.32537 for x64
Copyright (C) Microsoft Corporation. All rights reserved.
win.cc
Microsoft (R) Incremental Linker Version 14.36.32537.0
Copyright (C) Microsoft Corporation. All rights reserved.
/out:win.exe
win.obj
[INFO] MS C++ Compiler OK
[INFO] Clone cpp wrapper for Godot 3.5 into C:\Users\XXX\Downloads\gdcef-master\gdcef-master\addons\gdcef\thirdparty\godot-3.5\cpp
Cloning into 'C:\Users\XXX\Downloads\gdcef-master\gdcef-master\addons\gdcef\thirdparty\godot-3.5\cpp'...
remote: Enumerating objects: 7998, done.
remote: Counting objects: 100% (802/802), done.
remote: Compressing objects: 100% (158/158), done.
remote: Total 7998 (delta 695), reused 666 (delta 643), pack-reused 7196
13.62 MiB/s
Receiving objects: 100% (7998/7998), 9.55 MiB | 12.28 MiB/s, done.
Resolving deltas: 100% (5058/5058), done.
Submodule 'godot-headers' (https://github.com/godotengine/godot-headers) registered for path 'godot-headers'
Cloning into 'C:/Users/XXX/Downloads/gdcef-master/gdcef-master/addons/gdcef/thirdparty/godot-3.5/cpp/godot-headers'...
remote: Enumerating objects: 1032, done.
remote: Counting objects: 100% (208/208), done.
remote: Compressing objects: 100% (76/76), done.
remote: Total 1032 (delta 131), reused 167 (delta 114), pack-reused 824
Receiving objects: 100% (1032/1032), 3.14 MiB | 16.59 MiB/s, done.
Resolving deltas: 100% (660/660), done.
Submodule path 'godot-headers': checked out '9e4dd67f928d7ae4e8d8bd77dce2219065a30b9a'
[INFO] Compiling Godot C++ API (inside C:\Users\XXX\Downloads\gdcef-master\gdcef-master\addons\gdcef\thirdparty\godot-3.5\cpp) ...
Traceback (most recent call last):
File "C:\Users\XXX\Downloads\gdcef-master\gdcef-master\addons\gdcef\build.py", line 479, in <module>
compile_godot_cpp()
File "C:\Users\XXX\Downloads\gdcef-master\gdcef-master\addons\gdcef\build.py", line 365, in compile_godot_cpp
run(["scons", "platform=windows", "target=" + GODOT_CPP_TARGET,
File "C:\Python311\Lib\subprocess.py", line 548, in run
with Popen(*popenargs, **kwargs) as process:
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Python311\Lib\subprocess.py", line 1026, in __init__
self._execute_child(args, executable, preexec_fn, close_fds,
File "C:\Python311\Lib\subprocess.py", line 1538, in _execute_child
hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [WinError 2] The system cannot find the file specified
Appreciate if anyone can assist XD
Hello! I have managed to get this extension built and running with godot 3.5, but was wondering if there is some way to get widevine CDM support?
I am currently testing on windows 10.
I have tried to follow the instructions here to get the latest dll and place it in the appropriate folder and nothing happened.
I have also found this however I don't think I can pass in "enable-widevine-cdm"
as a config argument for this?
Any help or insight would be appreciated 😄
Missing in the paragraph:
Workaround: For Linux, for the moment, Stigmee does not find correctly the libcef.so while indicated in the gdnlib file. So for the moment:
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$WORKSPACE_STIGMEE/stigmee/build
Upon downloading the newest Cef build, extracting it, the build.py script wants to compile "Godot CEF module", but it fails:
[INFO] Compiling Godot CEF module C:\Users\raphi\Documents\DEV\GDCef\gdcef
scons: Reading SConscript files ...
scons: *** Path for option api_path does not exist: .\godot-cpp\
File "C:\Users\raphi\Documents\DEV\GDCef\gdcef\SConstruct", line 53, in <module>
File "C:\Users\raphi\Documents\DEV\GDCef\build.py", line 342, in <module>
compile_gdnative_cef(GDCEF_PATH)
File "C:\Users\raphi\Documents\DEV\GDCef\build.py", line 324, in compile_gdnative_cef
gdnative_scons_cmd("windows")
File "C:\Users\raphi\Documents\DEV\GDCef\build.py", line 309, in gdnative_scons_cmd
run(["scons", "api_path=" + GODOT_CPP_API_PATH,
File "C:\Users\raphi\AppData\Local\Programs\Python\Python310\lib\subprocess.py", line 524, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['scons', 'api_path=.\\godot-cpp\\', 'build_path=C:\\Users\\raphi\\Documents\\DEV\\GDCef\\example\\build', 'target=release', '--jobs=12', 'arch=x86_64', 'platform=windows']' returned non-zero exit status 2.
Scons is installed, I installed it with the requirements.txt via pip.
File structure is my personal fork of gdcef.
My wild guess is it that I need the special environment variables from Stigmee, am I wrong?
I really want to get this to compile completely because a web browser in Godot is just awesome!
I just discovered that running gdcef on windows 11 from the editor and subsequently stopping the debug run often results in the browser background process to not close at all.
This behaviour seems to be unconsistent from what I do with the open browser inside the godot run window.
I had an instance of this problem where after even some failed runs on godot, due to code errors, there were 5 ghost browser processes using almost all of my cpu.
I had to kill them one by one on the task manager.
Shouldn't be there, inside the browser process, a ping system which checks if the godot process that created it is still alive to prevent edge cases?
I was trying things out on the 2D demo project.
In API section missing telling that create_browser
create browsers as Godot child node in the Scenegraph.
C:\Users\Kian W\Downloads\gdcef\addons\gdcef>py build.py
←[32m[INFO] Checking cmake version ...←[00m
Microsoft (R) C/C++ Optimizing Compiler Version 19.35.32215 for x64
Copyright (C) Microsoft Corporation. All rights reserved.
win.cc
Microsoft (R) Incremental Linker Version 14.35.32215.0
Copyright (C) Microsoft Corporation. All rights reserved.
/out:win.exe
win.obj
[INFO] MS C++ Compiler OK
[INFO] Compiling Godot C++ API (inside C:\Users\Kian W\Downloads\gdcef\addons\gdcef\thirdparty\godot-3.5\cpp) ...
Traceback (most recent call last):
File "C:\Users\Kian W\Downloads\gdcef\addons\gdcef\build.py", line 479, in
compile_godot_cpp()
File "C:\Users\Kian W\Downloads\gdcef\addons\gdcef\build.py", line 365, in compile_godot_cpp
run(["scons", "platform=windows", "target=" + GODOT_CPP_TARGET,
File "C:\Users\Kian W\AppData\Local\Programs\Python\Python311\Lib\subprocess.py", line 548, in run
with Popen(*popenargs, **kwargs) as process:
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Kian W\AppData\Local\Programs\Python\Python311\Lib\subprocess.py", line 1024, in init
self._execute_child(args, executable, preexec_fn, close_fds,
File "C:\Users\Kian W\AppData\Local\Programs\Python\Python311\Lib\subprocess.py", line 1493, in _execute_child
hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [WinError 2] The system cannot find the file specified
any ideas, I got this to compile on ubuntu wsl, but that only generates linux files ?
When selecting a paragraph with the mouse, then doing browser->GetMainFrame()->Copy() then pasting inside a text editor (or echo | cat -e) it gives the text with 3 consecutive '\n' instead of 1.
When doing the same thing (browser->GetMainFrame()->Paste()) inside a GitHub input text, it works (\n are removed). But if I paste it for either in a Godot input text or getting the Godot clipboard, then my CEF application is freezing.
In Godot when pressing keys they can repeat actions, I noticed this called many times browser->GetMainFrame()->Copy() with consequence it cumulates the selected text.
I think there is possible memory corruption with browser->GetMainFrame()->Copy()
@raphipod This project is now on the Godot asset lib https://godotengine.org/asset-library/asset/1426 I tagged it as 2D tools
but I just realized that I should have placed all contents inside a addons/gdcef
folder. Since i'm noob in Godot, raphipod can you confirm ?
This is really awesome. The best CEF attempt so far :)
Is there a way to grab the audio stream from CEF and pipe it through a Godot audio bus, so that we can make it 3d positional?
I've successfully run the build.py and copied the build
folder into the project directory. However, when I open the project in Godot 3.5 and click Play (F5) I get the error:
Invalid call. Nonexistent function 'initialize' in base 'Node'.
In the "2D" demo project, line 177 in CEF.gd
is referred to. I've also tried running the "HelloCEF" project and received the same error. Am I missing something?
[INFO] MS C++ Compiler OK
[INFO] Compiling Godot C++ API (inside C:\Users\PC\Desktop\Browser\thirdparty\godot-3.5\cpp) ...
scons: *** No SConstruct file found.
File "D:\Program Files\Python310\lib\site-packages\SCons\Script\Main.py", line 945, in _main
Traceback (most recent call last):
File "C:\Users\PC\Desktop\Browser\build.py", line 465, in <module>
compile_godot_cpp()
File "C:\Users\PC\Desktop\Browser\build.py", line 361, in compile_godot_cpp
run(["scons", "platform=windows", "target=" + GODOT_CPP_TARGET,
File "D:\Program Files\Python310\lib\subprocess.py", line 524, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['scons', 'platform=windows', 'target=release', '--jobs=4']' returned non-zero exit status 2.
When I try to build im getting this error.
First off thanks for the amazing project,
I have a similar issue to this but it has a unique cause.
The web view works when run within its own scene but when put as a child of another scene it crashes with no errors present.
This is the image of the web view scene:
and this is the structure of the other scene:
No matter the scene I place it in, as long as it is a child of another node, it will crash. I also tried copying a known working project and it still crashes but the demos work.
Here is what my log file is reporting:
[0214/104650.053:WARNING:browser_info.cc(300)] Returning a speculative frame for 25769803781 [6,5]
[0214/104650.742:WARNING:browser_info.cc(300)] Returning a speculative frame for 25769803781 [6,5]
[0214/104650.743:WARNING:browser_info.cc(300)] Returning a speculative frame for 25769803781 [6,5]
[0214/104650.743:WARNING:browser_info.cc(300)] Returning a speculative frame for 25769803781 [6,5]
[0214/104650.743:WARNING:browser_info.cc(300)] Returning a speculative frame for 25769803781 [6,5]
[0214/104700.493:WARNING:sqlite_persistent_store_backend_base.cc(163)] Failed to post task from FlushAndNotifyInBackground@net\extras\sqlite\sqlite_persistent_store_backend_base.cc:211 to client_task_runner_.
[0214/104700.494:WARNING:sqlite_persistent_store_backend_base.cc(163)] Failed to post task from FlushAndNotifyInBackground@net\extras\sqlite\sqlite_persistent_store_backend_base.cc:211 to client_task_runner_.
[0214/111540.506:WARNING:browser_info.cc(300)] Returning a speculative frame for 25769803781 [6,5]
[0214/111540.507:WARNING:browser_info.cc(300)] Returning a speculative frame for 25769803781 [6,5]
[0214/111540.507:WARNING:browser_info.cc(300)] Returning a speculative frame for 25769803781 [6,5]
[0214/111540.507:WARNING:browser_info.cc(300)] Returning a speculative frame for 25769803781 [6,5]
[0214/111540.574:WARNING:browser_info.cc(300)] Returning a speculative frame for 25769803781 [6,5]
[0214/111617.191:WARNING:dns_config_service_win.cc(584)] Failed to read DnsConfig.
[0214/111617.195:WARNING:dns_config_service_win.cc(584)] Failed to read DnsConfig.
[0214/111714.402:WARNING:frame_impl.cc(460)] SendCommandWithResponse sent to detached frame 17179869185 [4,1] will be ignored
[0214/111714.407:ERROR:interface_endpoint_client.cc(690)] Message 0 rejected by interface blink.mojom.WidgetHost
[0214/111739.085:ERROR:gpu_init.cc(537)] Passthrough is not supported, GL is disabled, ANGLE is
[0214/112524.558:ERROR:gpu_init.cc(537)] Passthrough is not supported, GL is disabled, ANGLE is
If the issue is from my end, any help would be highly appreciated.
OS: windows 11
Godot version: 4.2.1
Description: gdcef extension works fine on godot editor, but when I try to export for windows, an execute the build, I get this error stack
ERROR: Can't open dynamic library: cef_artifacts/libgdcef.dll. Error: Error 126: The specified module could not be found..
at: (platform/windows/os_windows.cpp:394)
ERROR: GDExtension dynamic library not found: cef_artifacts/libgdcef.dll
at: open_library (core/extension/gdextension.cpp:719)
ERROR: Failed loading resource: res://libs/gdcef.gdextension. Make sure resources have been imported by opening the project in the editor at least once.
at: (core/io/resource_loader.cpp:274)
ERROR: Error loading extension: res://libs/gdcef.gdextension
at: (core/extension/gdextension_manager.cpp:234)
this is how looks in editor, vs windows build
this is how looks the windows build folder: (I added "cef_artifacts" folder manually)
@daniel-sanche you can add your JS injection in https://github.com/Lecrapouille/gdcef/tree/master/addons/gdcef/demos/2D
Is it possible if you compile this add-on with Godot as a module, so that I can use it without installing external programs?
Try to understand why the project a friend of mine made https://www.exaequos.com/ is run slowly with my Godot CEF and keyboard is broken (while the secondary process works well)
Currently:
gdcef/addons/gdcef/gdcef/src/gdbrowser.cpp
Line 134 in ad2bb3d
Helps wanted :)
Hey hey,
I haven't actually used your plugin, but I used your source as reference for integrating CEF into my project - thanks !
I have loaded mapbox in the embedded browser, and I noticed I couldn't drag the map, and it was zooming at 0,0 with the wheel : the issue was that CefMouseEvent::modifiers must be filled for each mouse event (click, move, wheel). So I'm pretty sure you have the same issue with this plugin. You need to save the modifiers in GDBrowserView and pass them in each m_browser->GetHost()->SendMouse*() in browser_io.cpp.
Cheers
Hi,
0. Windows 10 x64
When GDCef encounters a link that tries to open a new tab, it opens these links in new window on your OS, not in the game environment
Example: Try to click on the "Visit W3Schools.com!" link on this page
I tried to look into this, and it seems like it should be possible to override this by implementing the OnBeforePopup function. So far it hasn't worked for me, but I'll try to take another look at it later (unless someone else finds the fix first)
It would be helpful to provide compiled versions of the library in the repo, either on each build, or on tagged releases.
Possible issues:
@raphipod I reverted CEF version to 103 it seems that on my Debian I have a failure. I have to investigate.
Right now, the CEF resources directory is hard-coded to be at /build
in the godot project root. This probably doesn't make sense for most projects. And it is especially problematic for multi-platform projects, since each OS needs to read a different set of resources, which can't all be stored in the same folder.
One solution would be to allow the user to pass in a directory as part of the library initialization process
Thank you very much for taking this over. It looks terrific, and I'm excited to use it.
Have you communicated with the original authors about relicensing the code? Unfortunately it isn't possible to go from GPL -> MIT without the consent of the copyright holder. Would you like me to reach out to see if they're open to the change?
How realistic / doable is it, to have this run on android?
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.