Using embedded web browser

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Using embedded web browser

Andres Fortier-2
Hi list. We need to embed a web browser inside our application, so we
loaded the COM parcels to use IE. Our task is actually very basic: when
the user clicks a link, we check a bunch of things and then decide if
the navigation should proceed or not. In order to do so we decided to
use the event:

beforeNavigate2:url:flags:targetFrameName:postData:headers:cancel:

So basically we have:

postOpenWith: aBuilder

     super postOpenWith: aBuilder.
     (aBuilder componentAt: #WebBrowser) widget comComponent
when:#beforeNavigate2:url:flags:targetFrameName:postData:headers:cancel:
evaluate: [:p1 :p2 :p3 :p4 :p5 :p6 :p7| self preProcessURL: p2].

So far, so good. Now the problem arises when we need to stop the
navigation started by the user. We tried to set the Cancel parameter of
the event (:p7) and to explicitly stop the navigation by calling the
stop method of the browser[*], but none of those work. As a matter of
fact, the following code makes no changes at all, when I would expect to
cancel any navigation started by clicking on a link:

postOpenWith: aBuilder

     super postOpenWith: aBuilder.
     (aBuilder componentAt: #WebBrowser) widget comComponent

when:#beforeNavigate2:url:flags:targetFrameName:postData:headers:cancel:
evaluate: [:p1 :p2 :p3 :p4 :p5 :p6 :p7|
    p7 value: true.
    (aBuilder componentAt: #WebBrowser) widget comComponent stop].

Am I missing something? Did anybody experience something like this before?

I would also really appreciate if someone has had any experiences in
embedding firefox instead of IE, both in windows and/or in linux.

Thanks in advance,
                   AndrĂ©s


[*] The stop method was missing in the WebBrowser class. The code we
added is:

stop

     self testDefaultInterface.
     ^self defaultInterface stop.