wxWebConnect 1.0 released: web browser library for wxWidgets

96 views
Skip to first unread message

Benjamin Williams

unread,
Jul 8, 2009, 11:32:51 AM7/8/09
to wx-u...@googlegroups.com, wx-an...@googlegroups.com
Hello all,

Kirix is pleased to announce the availability of wxWebConnect -- a
library for wxWidgets that enables developers to quickly integrate
advanced web browser capabilities.

It wraps up functionality exposed by the Mozilla Foundation's Gecko
engine (XULRunner) into a set of user-friendly classes to: embed
browser controls, search web content, print web pages, interact with
the DOM, implement custom content handling for different MIME types,
issue POST calls using the current browser state, etc. Notably, with
this library you can also embed all of your favorite Firefox browser
plug-ins into your application.

With other libraries in the past, embedding a web browser control has
proven a daunting task, often involving compiling seemingly countless
sub-dependencies. We've gone out of our way to make sure that getting
a browser control up and running in your application is as easy as
possible.

More information can be found at the wxWebConnect project page
(http://www.kirix.com/labs/wxwebconnect.html). A short demo video and
some screenshots can be found here
(http://www.kirix.com/labs/wxwebconnect/screenshots.html)

We've released the full source code under the wxWindows license, so
please go ahead and use this library in your own applications freely.

Comments and criticisms are welcome.

All the best,
Benjamin I. Williams
Kirix Corporation (http://www.kirix.com)

Krishna

unread,
Jul 9, 2009, 4:26:26 AM7/9/09
to wx-u...@googlegroups.com
Hi,

Thrilled to see this. Thanks for the contribution.

I downloaded the source and tried to build it on Linux (openSuSE 11.1
i686) but the Makefile was missing ../top.mak

Anyway, I hand compiled using wx-config and the testapp got built.
However, when I run I'm not able to open any pages. Looks like some
issue with locating/loading the XULRunner.

Have a few questions (I know I should read the code but anyway):

* How is gecko loaded? When I linked the testapp I did not supply any
lib from Gecko. Is everything loaded at runtime?

* Last time I tried embedding gecko inside a wx app (using the new
embedding api) I had a few problems: I had to recompile XULRunner with
-fshort-wchar to get it to play nice with wxStrings.


Cheers,
--Krishna

--
I long to accomplish a great and noble task, but it is my chief duty
to accomplish small tasks as if they were great and noble !
-- Helen Keller

Benjamin I. Williams

unread,
Jul 9, 2009, 9:41:38 AM7/9/09
to wx-users

Hi there,

On Jul 9, 10:26 am, Krishna <v.krishnaku...@gmail.com> wrote:
> Thrilled to see this. Thanks for the contribution.
>
> I downloaded the source and tried to build it on Linux (openSuSE 11.1
> i686) but the Makefile was missing ../top.mak

Ok. Looks like we supplied the wrong Makefile. We'll take care of
this.

> Anyway, I hand compiled using wx-config and the testapp got built.
> However, when I run I'm not able to open any pages. Looks like some
> issue with locating/loading the XULRunner.
>
> Have a few questions (I know I should read the code but anyway):
>
> * How is gecko loaded? When I linked the testapp I did not supply any
> lib from Gecko. Is everything loaded at runtime?

Correct. The library is completely runtime bound, so you don't need
to link to any library or have any extra include paths other than the
wxWebConnect library itself.

> * Last time I tried embedding gecko inside a wx app (using the new
> embedding api) I had a few problems: I had to recompile XULRunner with
> -fshort-wchar to get it to play nice with wxStrings.

Probably because you used their glue library. We solved this problem
by loading xulrunner at run time, not linking at compile time.

All the best,
Ben

Krishna

unread,
Jul 9, 2009, 11:05:48 AM7/9/09
to wx-u...@googlegroups.com
On Thu, Jul 9, 2009 at 7:11 PM, Benjamin I.
Williams<kxbwi...@gmail.com> wrote:

>> * How is gecko loaded? When I linked the testapp I did not supply any
>> lib from Gecko. Is everything loaded at runtime?
>
> Correct.  The library is completely runtime bound, so you don't need
> to link to any library or have any extra include paths other than the
> wxWebConnect library itself.
>
>> * Last time I tried embedding gecko inside a wx app (using the new
>> embedding api) I had a few problems: I had to recompile XULRunner with
>> -fshort-wchar to get it to play nice with wxStrings.
>
> Probably because you used their glue library.  We solved this problem
> by loading xulrunner at run time, not linking at compile time.
>

Awesome!

Patrick Steele

unread,
Jul 10, 2009, 8:10:45 AM7/10/09
to wx-u...@googlegroups.com
That looks really great, Ben! Do you plan / hope to move this code to wxWidgets like you did with wxAUI?
Patrick

Benjamin I. Williams

unread,
Jul 10, 2009, 6:11:08 PM7/10/09
to wx-users

Hi Patrick,

On Jul 10, 2:10 pm, Patrick Steele <steele.patr...@gmail.com> wrote:
> That looks really great, Ben! Do you plan / hope to move this code to
> wxWidgets like you did with wxAUI?

That depends on there being a consensus of the core developers.
Because wxWebConnect has the same license, there is nothing else that
would hinder that from becoming a reality.

I think it'd be wise to first get the mac version up and running well.

All the best,
Ben

Lodle

unread,
Jul 13, 2009, 4:38:17 AM7/13/09
to wx-users
Hi,

This is wikid work as i was looking for something to replace ie and
webkit was to hard to build. A couple of questions though. How you get
the current page loading progress? Atm i use this:

NS_IMETHODIMP BrowserChrome::OnProgressChange(nsIWebProgress*
progress,
nsIRequest* request,
PRInt32 curSelfProgress,
PRInt32 maxSelfProgress,
PRInt32
curTotalProgress,
PRInt32
maxTotalProgress)
{
PRInt32 nProgress = curTotalProgress;
PRInt32 nProgressMax = maxTotalProgress;

if (nProgressMax == 0)
nProgressMax = LONG_MAX;

if (nProgress > nProgressMax)
nProgress = nProgressMax; // Progress complete

long per = nProgress*100/nProgressMax;

wxWebEvent evt(wxEVT_WEB_PROGRESS, m_wnd->GetId());
evt.SetEventObject(m_wnd);
evt.SetState(per);
m_wnd->GetEventHandler()->ProcessEvent(evt);

return NS_OK;
}

Is that correct? Also with ie i can intercept custom javascript calls
(i.e. document.external.doStuff() ) can you do that using this as
well?

Mark

Toto

unread,
Jul 13, 2009, 9:46:47 AM7/13/09
to wx-users
> We've released the full source code under the wxWindows license, so
> please go ahead and use this library in your own applications freely.

possible to compile with MinGW?

Benjamin I. Williams

unread,
Jul 13, 2009, 10:03:12 AM7/13/09
to wx-users

Hello,

On Jul 13, 10:38 am, Lodle <lodle...@gmail.com> wrote:
>         if (nProgress > nProgressMax)
>                 nProgress = nProgressMax; // Progress complete
>
>         long per = nProgress*100/nProgressMax;
>
>     wxWebEvent evt(wxEVT_WEB_PROGRESS, m_wnd->GetId());
>     evt.SetEventObject(m_wnd);
>     evt.SetState(per);
>     m_wnd->GetEventHandler()->ProcessEvent(evt);

I'd probably use SetInt, but other than that, it looks like a great
solution.

> Is that correct? Also with ie i can intercept custom javascript calls
> (i.e. document.external.doStuff() ) can you do that using this as
> well?


Right now we have c++ > javascript invocation, but at the moment
javascript > c++ is not yet implemented. We're currently weighing
what the best option would be for that.

Best,
Ben


Benjamin I. Williams

unread,
Jul 13, 2009, 10:03:44 AM7/13/09
to wx-users

Hello,
We've not tried it yet. Somebody else did try it and didn't have a
whole lot of success. Any help or patches here would be appreciated.

Best,
Ben

Lodle

unread,
Jul 13, 2009, 10:08:32 AM7/13/09
to wx-users

> Right now we have c++ > javascript invocation, but at the moment
> javascript > c++ is not yet implemented.  We're currently weighing
> what the best option would be for that.
>
> Best,
> Ben


Hmm thats a shame, really would like that. How hard do you think it
would be to code? Also is there a way to add cookies before loading a
url or add them to the current session?


Mark

Benjamin I. Williams

unread,
Jul 13, 2009, 11:12:58 AM7/13/09
to wx-users
Hi there,

On Jul 13, 4:08 pm, Lodle <lodle...@gmail.com> wrote:
> > Right now we have c++ > javascript invocation, but at the moment
> > javascript > c++ is not yet implemented.  We're currently weighing
> > what the best option would be for that.
>
> > Best,
> > Ben
>
> Hmm thats a shame, really would like that. How hard do you think it
> would be to code?

I think it would be quite easy (and fun) to code.

> Also is there a way to add cookies before loading a
> url or add them to the current session?

I'd look into using the Execute() method to add the cookie via JS.

All the best,
Ben

Lodle

unread,
Jul 13, 2009, 9:38:58 PM7/13/09
to wx-users


On Jul 13, 11:12 pm, "Benjamin I. Williams" <kxbwilli...@gmail.com>
wrote:
But i need it before the page loads not after. Hmmm
Reply all
Reply to author
Forward
0 new messages