Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New tab links open a new OS window #19

Open
daniel-sanche opened this issue Nov 23, 2022 · 5 comments
Open

New tab links open a new OS window #19

daniel-sanche opened this issue Nov 23, 2022 · 5 comments
Labels
help wanted Extra attention is needed

Comments

@daniel-sanche
Copy link
Contributor

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)

@Lecrapouille
Copy link
Owner

Lecrapouille commented Nov 23, 2022

@daniel-sanche I see what you are talking, but your link from my Firefox and for GDCEF is displayed on the same page split vertically. Do you mean a mouse click "open in a new tab" feature?

I obtain your result with https://duckduckgo.com and clicking on the blue button "add duck to your browser". When you are saying "this open a OS window". I guess simply it calls the secondary process gdcef/build/gdcefSubProcess which is a runnable browser application (edit: it used to be a browser since SHA1 e939b66 it seems no longer display).

Lecrapouille added a commit that referenced this issue Nov 23, 2022
Demo "CEF in 2D" is now nammed "Hello CEF" (like initial).
Add real demo "CEF in 2D" that will show a full 2D browser.
This demo will be used for showing all features (ideally).
Lecrapouille added a commit that referenced this issue Nov 23, 2022
Demo "CEF in 2D" is now nammed "Hello CEF" (like initial).
Add real demo "CEF in 2D" that will show a full 2D browser.
This demo will be used for showing all features (ideally).
Lecrapouille added a commit that referenced this issue Nov 23, 2022
Demo "CEF in 2D" is now nammed "Hello CEF" (like initial).
Add real demo "CEF in 2D" that will show a full 2D browser.
This demo will be used for showing all features (ideally).
Lecrapouille added a commit that referenced this issue Nov 23, 2022
@Lecrapouille
Copy link
Owner

@daniel-sanche I've done implementing a basic 2D browser https://github.com/Lecrapouille/gdcef/tree/master/addons/gdcef/demos/2D when creating a new browser tab it opens my favorite radio webpage, you then can click on the "Tune In" icon this will create the OS windows. Now we can try to fix it and implement a C++ method on_popup_created and trigger a Godot callback returning the created browser as Godot node on_popup_created(node):

@daniel-sanche
Copy link
Contributor Author

Ok cool, that sounds like a good solution to me! Maybe by default it can just open the link in the current browser, if the user doesn't add the callback?

Also, when I was investigating this, it seemed to me like the CefLigfeSpanHandler functions in the GDCef Impl class weren't being called. I'm thinking maybe we need to implement GetDefaultClient() to register it as a client like in this sample?

@Lecrapouille
Copy link
Owner

@daniel-sanche you are certainly right! For the moment I did not investigate

@Lecrapouille
Copy link
Owner

Lecrapouille commented Sep 18, 2024

Affected on https://www.exaequos.com/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants