I am using WebBrowser control & Chrome Frame BHO. Everything works
fine with the Chrome engine doing rendering when the page has the meta
tag. Now I want to call a C# method from the javascript running in
the browser and vice versa. This can be done using the
ObjectForScripting and window.external objects when IE is the
rendering engine. But when the chrome frame tag is present in the
page this approach does not work.
A sort of hack I could come up with to call the C# code from to write
some code in Navigating method to call a C# method and cancelling the
navigation. The problem with this approach is that there is no way to
pass back and data to the calling java script method.
On Wed, Sep 28, 2011 at 8:44 AM, VM <mathews.v...@gmail.com> wrote: > I am using WebBrowser control & Chrome Frame BHO. Everything works > fine with the Chrome engine doing rendering when the page has the meta > tag. Now I want to call a C# method from the javascript running in > the browser and vice versa. This can be done using the > ObjectForScripting and window.external objects when IE is the > rendering engine. But when the chrome frame tag is present in the > page this approach does not work.
> A sort of hack I could come up with to call the C# code from to write > some code in Navigating method to call a C# method and cancelling the > navigation. The problem with this approach is that there is no way to > pass back and data to the calling java script method.
> Any thoughts on accomplishing this.
> -- > You received this message because you are subscribed to the Google Groups > "Google-chrome-frame" group. > To post to this group, send email to google-chrome-frame@googlegroups.com. > To unsubscribe from this group, send email to > google-chrome-frame+unsubscribe@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/google-chrome-frame?hl=en.
On Wed, Sep 28, 2011 at 11:44 AM, VM <mathews.v...@gmail.com> wrote: > I am using WebBrowser control & Chrome Frame BHO. Everything works > fine with the Chrome engine doing rendering when the page has the meta > tag. Now I want to call a C# method from the javascript running in > the browser and vice versa. This can be done using the > ObjectForScripting and window.external objects when IE is the > rendering engine. But when the chrome frame tag is present in the > page this approach does not work.
> A sort of hack I could come up with to call the C# code from to write > some code in Navigating method to call a C# method and cancelling the > navigation. The problem with this approach is that there is no way to > pass back and data to the calling java script method.
> Any thoughts on accomplishing this.
If you host the CF ActiveX control for rendering inside the WebBrowser control, you could use its postMessage method (see chrome_tab.idl<http://src.chromium.org/svn/trunk/src/chrome_frame/chrome_tab.idl>) to send data to javascript running inside Chrome Frame and, for the other direction, script inside Chrome Frame can use window.externalHost.postMessage().
> -- > You received this message because you are subscribed to the Google Groups > "Google-chrome-frame" group. > To post to this group, send email to google-chrome-frame@googlegroups.com. > To unsubscribe from this group, send email to > google-chrome-frame+unsubscribe@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/google-chrome-frame?hl=en.
Can the CF ActiveX be used such that thr page renders in chrome based
on the meta tag in the page? If do, sre you aware of any sample code
that ties WebBrowser control to the CF Active X object.
-Vinu
On Sep 28, 1:14 pm, Robert Shield <robertshi...@chromium.org> wrote:
> On Wed, Sep 28, 2011 at 11:44 AM, VM <mathews.v...@gmail.com> wrote:
> > I am using WebBrowser control & Chrome Frame BHO. Everything works
> > fine with the Chrome engine doing rendering when the page has the meta
> > tag. Now I want to call a C# method from the javascript running in
> > the browser and vice versa. This can be done using the
> > ObjectForScripting and window.external objects when IE is the
> > rendering engine. But when the chrome frame tag is present in the
> > page this approach does not work.
> > A sort of hack I could come up with to call the C# code from to write
> > some code in Navigating method to call a C# method and cancelling the
> > navigation. The problem with this approach is that there is no way to
> > pass back and data to the calling java script method.
> > Any thoughts on accomplishing this.
> If you host the CF ActiveX control for rendering inside the WebBrowser
> control, you could use its postMessage method (see
> chrome_tab.idl<http://src.chromium.org/svn/trunk/src/chrome_frame/chrome_tab.idl>)
> to send data to javascript running inside Chrome Frame and, for the other
> direction, script inside Chrome Frame can use
> window.externalHost.postMessage().> --
> > You received this message because you are subscribed to the Google Groups
> > "Google-chrome-frame" group.
> > To post to this group, send email to google-chrome-frame@googlegroups.com.
> > To unsubscribe from this group, send email to
> > google-chrome-frame+unsubscribe@googlegroups.com.
> > For more options, visit this group at
> >http://groups.google.com/group/google-chrome-frame?hl=en.
> On Wed, Sep 28, 2011 at 8:44 AM, VM <mathews.v...@gmail.com> wrote:
> > I am using WebBrowser control & Chrome Frame BHO. Everything works
> > fine with the Chrome engine doing rendering when the page has the meta
> > tag. Now I want to call a C# method from the javascript running in
> > the browser and vice versa. This can be done using the
> > ObjectForScripting and window.external objects when IE is the
> > rendering engine. But when the chrome frame tag is present in the
> > page this approach does not work.
> > A sort of hack I could come up with to call the C# code from to write
> > some code in Navigating method to call a C# method and cancelling the
> > navigation. The problem with this approach is that there is no way to
> > pass back and data to the calling java script method.
> > Any thoughts on accomplishing this.
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Google-chrome-frame" group.
> > To post to this group, send email to google-chrome-frame@googlegroups.com.
> > To unsubscribe from this group, send email to
> > google-chrome-frame+unsubscribe@googlegroups.com.
> > For more options, visit this group at
> >http://groups.google.com/group/google-chrome-frame?hl=en.- Hide quoted text -
Are you hosting Chrome Frame BHO inside your own container? In that case the postMessage/window.externalHost will work but there are certain assumptions Chrome Frame BHO makes about its container that may be problematic. Browse Chrome Frame source code (say: Bho::SetSite http://src.chromium.org/svn/trunk/src/chrome_frame/bho.cc) for specifics.
On Wed, Sep 28, 2011 at 9:38 PM, VM <mathews.v...@gmail.com> wrote: > Can this be done using the CF BHO or will I have to use the CF Active- > X control for this?
> > On Wed, Sep 28, 2011 at 8:44 AM, VM <mathews.v...@gmail.com> wrote: > > > I am using WebBrowser control & Chrome Frame BHO. Everything works > > > fine with the Chrome engine doing rendering when the page has the meta > > > tag. Now I want to call a C# method from the javascript running in > > > the browser and vice versa. This can be done using the > > > ObjectForScripting and window.external objects when IE is the > > > rendering engine. But when the chrome frame tag is present in the > > > page this approach does not work.
> > > A sort of hack I could come up with to call the C# code from to write > > > some code in Navigating method to call a C# method and cancelling the > > > navigation. The problem with this approach is that there is no way to > > > pass back and data to the calling java script method.
> > > Any thoughts on accomplishing this.
> > > -- > > > You received this message because you are subscribed to the Google > Groups > > > "Google-chrome-frame" group. > > > To post to this group, send email to > google-chrome-frame@googlegroups.com. > > > To unsubscribe from this group, send email to > > > google-chrome-frame+unsubscribe@googlegroups.com. > > > For more options, visit this group at > > >http://groups.google.com/group/google-chrome-frame?hl=en.- Hide quoted > text -
> > - Show quoted text -
> -- > You received this message because you are subscribed to the Google Groups > "Google-chrome-frame" group. > To post to this group, send email to google-chrome-frame@googlegroups.com. > To unsubscribe from this group, send email to > google-chrome-frame+unsubscribe@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/google-chrome-frame?hl=en.
> I am using WebBrowser control & Chrome Frame BHO. Everything works > fine with the Chrome engine doing rendering when the page has the meta > tag. Now I want to call a C# method from the javascript running in > the browser and vice versa. This can be done using the > ObjectForScripting and window.external objects when IE is the > rendering engine. But when the chrome frame tag is present in the > page this approach does not work.
> A sort of hack I could come up with to call the C# code from to write > some code in Navigating method to call a C# method and cancelling the > navigation. The problem with this approach is that there is no way to > pass back and data to the calling java script method.