RegisterJsObject() problem with secondary/popup windows

73 views
Skip to first unread message

Kaido Kärner

unread,
Sep 24, 2015, 3:13:42 AM9/24/15
to CefSharp
HI!

I have a suspicion, that objects are registered correctly with RegisterJsObject() only for the first window.

To create a simple test, I modified CefSharp.WinForms.Example\Handlers\LifeSpanHandler.cs and added 

chromiumBrowser.RegisterJsObject("TEST", new Object());

immidiately after the ChromiumWebBrowser is created. 

Now, when I open a page which opens a popup, the popup opens correctly, but does not seem to have the TEST object. The same approach works ok for the first/main window.

Am I doing something wrong, or could there be a bug?

regards,
Kaido

Alex Maitland

unread,
Sep 24, 2015, 4:00:31 AM9/24/15
to CefSharp
What version are you using?

Kaido Kärner

unread,
Sep 24, 2015, 4:34:19 AM9/24/15
to CefSharp
What version are you using?
 
Latest git master from yesterday ..  

Alex Maitland

unread,
Sep 24, 2015, 4:47:43 AM9/24/15
to CefSharp
Feel free to open an issue on GitHub.

For reference, `master` is unstable

Latest release branch is https://github.com/cefsharp/CefSharp/tree/cefsharp/43

Kaido Kärner

unread,
Sep 24, 2015, 5:06:07 AM9/24/15
to CefSharp
the latest release branch has the same issue.


>> Feel free to open an issue on GitHub.

will do later. I just tried to understand first whether I'm doing something wrong myself.

kk
 

Alex Maitland

unread,
Sep 24, 2015, 6:28:25 AM9/24/15
to CefSharp
Support for registering an object is not implemented in 43 or `master`. It may have worked in the 41 branch.

If you don't need access to the parent window in javascript then you can create your own popup browsers with OnBeforePopup.

https://github.com/cefsharp/CefSharp/blob/cefsharp/43/CefSharp/ILifeSpanHandler.cs#L41

Kaido Kärner

unread,
Sep 24, 2015, 6:05:59 PM9/24/15
to CefSharp
>> Support for registering an object is not implemented in 43 or `master`. It may have worked in the 41 branch.

hmz .. it still seems to work for non-popup windows. any plans/ETA for full implementation?


>> If you don't need access to the parent window in javascript then you can create
>> your own popup browsers with OnBeforePopup.

I go through OnBeforePopup.anyway. I'll see if I can do without the opener .. 

kk.

Alex Maitland

unread,
Sep 24, 2015, 6:13:19 PM9/24/15
to CefSharp
hmz .. it still seems to work for non-popup windows.

My comment was in the content of popups. Basic support should be working fine.

See https://github.com/cefsharp/CefSharp/pull/1284

(Any further comment please post on GitHub)
 
Reply all
Reply to author
Forward
0 new messages