Setting to suppress Shift+Enter opening a new window?

Having problems with building or using CEF's C/C++ APIs? This forum is here to help. Please do not post bug reports or feature requests here.

Setting to suppress Shift+Enter opening a new window?

Postby jholt » Mon Jun 22, 2015 10:29 am

Is there a way to stop Chromium from opening a new window on a Shift+Enter?

I tried grabbing it in OnPreKeyEvent, but the window seems to be opened already by the time it gets here.

I've seen some JS fragments (e.g. https://gist.github.com/jataro/2799464 ) for suppressing it (apparently neither FF nor IE have this behavior), but I'd like to suppress the behavior everywhere, so am hoping I can suppress it on the CEF/Chromium/C++ side.
jholt
Techie
 
Posts: 27
Joined: Fri May 02, 2014 4:29 pm

Re: Setting to suppress Shift+Enter opening a new window?

Postby magreenblatt » Mon Jul 06, 2015 4:51 pm

Does it call OnBeforePopup or OnOpenURLFromTab?
magreenblatt
Site Admin
 
Posts: 12408
Joined: Fri May 29, 2009 6:57 pm

Re: Setting to suppress Shift+Enter opening a new window?

Postby grossag » Thu Dec 24, 2015 9:36 am

I accidentally noticed this issue and also want to suppress this behavior because I want to restrict my application to being a single-tab process. Unfortunately I do not get any callbacks to OnBeforePopup or OnOpenURLFromTab. Do you want me to file this as an issue for better tracking? If you have ideas for how to fix it, I am happy to submit a pull request with a fix.
grossag
Techie
 
Posts: 17
Joined: Thu Oct 01, 2015 9:39 am

Re: Setting to suppress Shift+Enter opening a new window?

Postby magreenblatt » Tue Dec 29, 2015 2:42 pm

grossag wrote:Unfortunately I do not get any callbacks to OnBeforePopup or OnOpenURLFromTab.

Please test this in cefclient. I believe you will see callbacks to one of these methods.
magreenblatt
Site Admin
 
Posts: 12408
Joined: Fri May 29, 2009 6:57 pm

Re: Setting to suppress Shift+Enter opening a new window?

Postby amaitland » Tue Dec 29, 2015 5:44 pm

Quick test using 3.2526.1362.g26b3a7a

OnOpenUrlFromTab is called for me as expected
Maintainer of the CefSharp project.
amaitland
Virtuoso
 
Posts: 1292
Joined: Wed Jan 14, 2015 2:35 am

Re: Setting to suppress Shift+Enter opening a new window?

Postby grossag » Tue Jan 05, 2016 9:54 pm

Ok thanks. I had an older signature of OnBeforePopup that wasn't properly overriding the function. I updated it and now see OnBeforePopup called and can suppress it there.
grossag
Techie
 
Posts: 17
Joined: Thu Oct 01, 2015 9:39 am

Re: Setting to suppress Shift+Enter opening a new window?

Postby magreenblatt » Tue Jan 05, 2016 10:02 pm

grossag wrote:Ok thanks. I had an older signature of OnBeforePopup that wasn't properly overriding the function. I updated it and now see OnBeforePopup called and can suppress it there.

You should use the override keyword to avoid these types of errors.
magreenblatt
Site Admin
 
Posts: 12408
Joined: Fri May 29, 2009 6:57 pm


Return to Support Forum

Who is online

Users browsing this forum: Google [Bot] and 53 guests