Using both JExplorer and JxBrowser

96 views
Skip to first unread message

Unknown

unread,
Nov 1, 2010, 12:24:07 PM11/1/10
to jexplor...@teamdev.com
Hi,

I have used JExplorer for our application. Some of our clients prefer firefox. Is it possible to use both JExplorer and JxBrowser without changing a lot of code?

Thanks,
Navin


Unknown

unread,
Nov 1, 2010, 12:24:10 PM11/1/10
to jexplor...@teamdev.com

{font:style=font-family: trebuchet ms,geneva; font-size: 10pt;}Hi Navin,{font}
{font:style=font-family: trebuchet ms,geneva; font-size: 10pt;} \\{font}
{font:style=font-family: trebuchet ms,geneva; font-size: 10pt;}Yes, it is possible. Right now we are working on JxBrowser 2.0 library which represents a combination of JxBrowser 1.x (Mozilla engine), JExplorer 2.x (Internet Explorer engine) and new Apple Safari (WebKit) engine for Mac OS X platform. All these engines are wrapped into{font} {font:style=font-family: trebuchet ms,geneva; font-size: 10pt;}new{font} {font:style=font-family: trebuchet ms,geneva; font-size: 10pt;}great API, so you can write one code and use different engines on different platforms! Please see more details on our site: http://www.teamdev.com/jxbrowser/#jxbrowser-2_0-eap \\{font}
{font:style=font-family: trebuchet ms,geneva; font-size: 10pt;} \\{font}
{font:style=font-family: trebuchet ms,geneva; font-size: 10pt;}JxBrowser 2.0 EAP is already available for download and you can try it right now: ftp://ftp.teamdev.com/updates/jxbrowser-2.0.22287-eap-cross-desktop.zip \\{font}
{font:style=font-family: trebuchet ms,geneva; font-size: 10pt;} \\{font}
{font:style=font-family: trebuchet ms,geneva; font-size: 10pt;}Any feedback would be really appreciated. \\{font}
{font:style=font-family: trebuchet ms,geneva; font-size: 10pt;} \\{font}
{font:style=font-family: trebuchet ms,geneva; font-size: 10pt;}Regards,{font}
{font:style=font-family: trebuchet ms,geneva; font-size: 10pt;}Vladimir Ikryanov \\{font}


Unknown

unread,
Nov 1, 2010, 12:24:13 PM11/1/10
to jexplor...@teamdev.com

Valdimir,

I downloaded JxBrowser 2.0 and was able to run my application with most listeners disabled for now ( I guess I need to find the proper APIs). When I switched to use Mozilla by doing: browser = BrowserFactory.createBrowser(BrowserType.Mozilla) I got an exception about certificate issuer being unknown. It should show a warning dialog and then let user proceed. In case of IE I was able to the run the application but it did not show the certificate warning.

Also I have firefox installed on my machine, how do I use that instead of xulrunner? Ideally I would like to check if the user has a version of firefox that is sufficient and download the xrunner package only if that is not the case.

One more thing, I can't find browser.addNewWindowListener(...) in JxBrowser or a similar API.

Thanks,
Navin


Unknown

unread,
Nov 1, 2010, 12:24:20 PM11/1/10
to jexplor...@teamdev.com

{font:style=font-family: trebuchet ms,geneva; font-size: 10pt;}Hi Navin,{font}
{font:style=font-family: trebuchet ms,geneva; font-size: 10pt;} \\{font}
{font:style=font-family: trebuchet ms,geneva; font-size: 10pt;}Thanks for your feedback.{font}

{font:style=font-family: trebuchet ms,geneva; font-size: 10pt;} \\{font}
{font:style=font-family: trebuchet ms,geneva; font-size: 10pt;}1. JxBrowser allows working only with its own XULRunner and doesn't provide functionality that allows running with installed FireFox. Maybe in one of the next version of JxBrowser we will add such ability, but right now we don't have such plans.{font}

{font:style=font-family: trebuchet ms,geneva; font-size: 10pt;} \\{font}
{font:style=font-family: trebuchet ms,geneva; font-size: 10pt;}2. As for the SSL security issue - JxBrowser 2.0 API provides functionality that allows handling all SSL security issues. Please see the HandleSecurityProblemsSample sample from JxBrowser 2.0 EAP distribution package that demonstrates how to do this.{font}

{font:style=font-family: trebuchet ms,geneva; font-size: 10pt;} \\{font}
{font:style=font-family: trebuchet ms,geneva; font-size: 10pt;}3. In JxBrowser 2.0 we changed API for handling/listening{font} {font:style=font-family: trebuchet ms,geneva; font-size: 10pt;}opening a{font} {font:style=font-family: trebuchet ms,geneva; font-size: 10pt;}new window. Please see the PopupBrowserSample from distribution package or you can find it in attachment. \\{font}

Unknown

unread,
Nov 1, 2010, 12:24:23 PM11/1/10
to jexplor...@teamdev.com
X-MIME-Autoconverted: from quoted-printable to 8bit by htk.kharkov.ua id oA1FicEG024278

Hi Vladimir,

In JExplorer I didn't have to write any code for handling security. It simply poped up a warning dailog in case it couldn't verify the certificate. Shouldn't the behavior be similiar?

Also in case of JExplorer I had to call Browser.close() before I could remove the browser panel from the window containing it. All this was done because the browser window would not be disposed otherwise. Is this still the case?

Thanks for the sample.

I used the following code for security when I was testing:

browser.setHttpSecurityHandler(new HttpSecurityHandler() {\\ В В В В В В В В В В В  public HttpSecurityAction onSecurityProblem(Set problems) {\\ В В В В В В В В В В В В В В В  // when the problem in invalid certificate, then just ignore it\\ В В В В В В В В В В В В В В В  if (problems.contains(SecurityProblem.NOT_TRUSTED_CERTIFICATE) || (problems.contains(SecurityProblem.MOVING_FROM_HTTP_TO_HTTPS))) {\\ В В В В В В В В В В В В В В В В В В В  return HttpSecurityAction.CONTINUE;\\ В В В В В В В В В В В В В В В  }\\ В В В В В В В В В В В В В В В  return HttpSecurityAction.ABORT;\\ В В В В В В В В В В В  }\\ В В В В В В В  });

When I run in debug mode I see that "return HttpSecurityAction.CONTINUE" gets execute but it still throws the exception dialog.

Regards,
Navin


Unknown

unread,
Nov 1, 2010, 12:24:29 PM11/1/10
to jexplor...@teamdev.com
X-MIME-Autoconverted: from quoted-printable to 8bit by htk.kharkov.ua id oA1FicEH024278


{font:style=font-family: trebuchet ms,geneva; font-size: 10pt;}Hi Navin,{font}
{font:style=font-family: trebuchet ms,geneva; font-size: 10pt;} \\{font}
{font:style=font-family: trebuchet ms,geneva; color: #808080; font-size: 10pt;}> In JExplorer I didn't have to write any code for handling security. It simply poped up a warning dailog in case it couldn't verify the certificate. Shouldn't the behavior be similiar?{font}

{font:style=font-family: trebuchet ms,geneva; font-size: 10pt;} \\{font}
{font:style=font-family: trebuchet ms,geneva; font-size: 10pt;}You may see by default the certificate popup warning dialog in JExplorer because this is default behavior when certificate problems occur in Internet Explorer engine. But Mozilla engine in this case just displays a web page with warning message, this is default behavior for Mozilla engine. I agree that behavior should be similar, this is why we provide HttpSecurityHandler that allows processing security problems in the same maner for different engines.{font}

{font:style=font-family: trebuchet ms,geneva; font-size: 10pt;} \\{font}
{font:style=font-family: trebuchet ms,geneva; font-size: 10pt;}Please note that for different engines could be different secrutity problem reasons. Please try to register HttpSecurityHandler that allows ignoring all security problems. For example:{font}
{code:java}В В В  browser.setHttpSecurityHandler(new HttpSecurityHandler() {\\ В В В В В В В  public HttpSecurityAction onSecurityProblem(Set problems) {\\ В В В В В В В В В В В  return HttpSecurityAction.CONTINUE;\\ В В В В В В В  }\\ В В В  });{code}

{font:style=font-family: trebuchet ms,geneva; font-size: 10pt;} \\{font}
{font:style=font-family: trebuchet ms,geneva; color: #808080; font-size: 10pt;}> Also in case of JExplorer I had to call Browser.close() before I could remove the browser panel from the window containing it. All this was done because the browser window would not be disposed otherwise. Is this still the case?{font}

{font:style=font-family: trebuchet ms,geneva; font-size: 10pt;} \\{font}
{font:style=font-family: trebuchet ms,geneva; font-size: 10pt;}Yes, to dispose Browser instance you should invoke the Browser.dispose method (Browser.close analog in JExplorer). \\{font}

Unknown

unread,
Nov 1, 2010, 12:24:32 PM11/1/10
to jexplor...@teamdev.com

Vladimir,

A couple of things regarding security issue:
1. When I choose to use IE as BrowserType, I don't get any warning at all in case of certificate problems and I did not put any code to ignore security warning. This should not happen. Default IE IE behavior is to show warning dialog. It works perfectly in JExplorer.
2. In case of Mozilla I did put the code you suggested and I ran it in debug mode to make sure that the SecurityHandler is set is used but the page still throws exception saying invalid security certificate.


I was testing the IE version of it and noticed that the methods of implemented NewWindowManager do not get executed. It seems to works in case of Mozilla.


Thanks,
Navin


Unknown

unread,
Nov 1, 2010, 12:24:36 PM11/1/10
to jexplor...@teamdev.com

{font:style=font-family: trebuchet ms,geneva; font-size: 10pt;}Hi Navin,{font}
{font:style=font-family: trebuchet ms,geneva; font-size: 10pt;} \\{font}
{font:style=font-family: trebuchet ms,geneva; font-size: 10pt;}Thanks for clarification regarding security issue. I will try to reproduce this behavior. It would be great if you provide me a link to a web page on which you can reproduce security issue.{font}

{font:style=font-family: trebuchet ms,geneva; font-size: 10pt;} \\{font}
{font:style=font-family: trebuchet ms,geneva; color: #808080; font-size: 10pt;}> I was testing the IE version of it and noticed that the methods of implemented NewWindowManager do not get executed. It seems to works in case of Mozilla.{font}

{font:style=font-family: trebuchet ms,geneva; font-size: 10pt;} \\{font}
{font:style=font-family: trebuchet ms,geneva; font-size: 10pt;}You mean that NewWindowManager.evaluateWindow method is never invoked? That's weird. Could you please provide me steps to reproduce this issue? \\{font}

Unknown

unread,
Nov 1, 2010, 12:24:39 PM11/1/10
to jexplor...@teamdev.com

Vladimir,

I have to build a test example for you to test the security issue. I will to do it soon. As far as new window manager goes I do exactly what you have in the sample code. It works for Mozilla but when I switch to IE as window type the same code does not even get executed. I put a breakpoint in insertBrowser(...) code and it never gets there in case of IE while it case of Mozilla it does.

Thanks,
Navin


Unknown

unread,
Nov 1, 2010, 12:24:42 PM11/1/10
to jexplor...@teamdev.com

{font:style=font-family: trebuchet ms,geneva; font-size: 10pt;}Hi Navin,{font}
{font:style=font-family: trebuchet ms,geneva; font-size: 10pt;} \\{font}
{font:style=font-family: trebuchet ms,geneva; font-size: 10pt;}I will try to reproduce this issue with NewWindowHandler and let you know the results. \\{font}

Unknown

unread,
Nov 1, 2010, 12:24:52 PM11/1/10
to jexplor...@teamdev.com
X-MIME-Autoconverted: from quoted-printable to 8bit by htk.kharkov.ua id oA1FkDEQ024534

Hi Vladimir,

Not sure if it has to do with the certificate issue. I use the same code for both IE and Mozilla except of course for the line:В  browser = BrowserFactory.createBrowser(BrowserType.IE); and it works just fine for Mozilla. I will give it another try once the certificate issues related to IE are resolved.

Thanks,
Navin


Unknown

unread,
Nov 1, 2010, 12:24:45 PM11/1/10
to jexplor...@teamdev.com

{font:style=font-family: trebuchet ms,geneva; color: #333333; font-size: 10pt;}Hi Navin,{font}
{font:style=font-family: trebuchet ms,geneva; color: #333333; font-size: 10pt;} \\{font}
{font:style=font-family: trebuchet ms,geneva; color: #333333; font-size: 10pt;}We have tried to reproduce this issue with opening a new window but without success. The NewWindowManager.evaluateWindow method is always invoked.{font}
{font:style=font-family: trebuchet ms,geneva; color: #333333; font-size: 10pt;} \\{font}
{font:style=font-family: trebuchet ms,geneva; color: #333333; font-size: 10pt;}Please note that in JxBrowser 2.0 API NewWindowManager functionality is quite different than in JExplorer. When you register a NewWindowManager it means that you set a global NewWindowManager for all Browser instances (IE, Mozilla, Safari). You don't need to register a{font} {font:style=font-family: trebuchet ms,geneva; color: #333333; font-size: 10pt;}NewWindowManager for each Browser instance anymore. \\{font}
{font:style=font-family: trebuchet ms,geneva; color: #333333; font-size: 10pt;} \\{font}
{font:style=font-family: trebuchet ms,geneva; color: #333333; font-size: 10pt;}Regards,{font}
{font:style=font-family: trebuchet ms,geneva; color: #333333; font-size: 10pt;}Vladimir Ikryanov{font}{font:style=font-family: trebuchet ms,geneva; color: #333333; font-size: 10pt;} \\{font}


Unknown

unread,
Nov 1, 2010, 12:24:55 PM11/1/10
to jexplor...@teamdev.com

{font:style=font-family: trebuchet ms,geneva; font-size: 10pt;}Hi Navin,{font}
{font:style=font-family: trebuchet ms,geneva; font-size: 10pt;} \\{font}
{font:style=font-family: trebuchet ms,geneva; font-size: 10pt;}Could you please send me the complete sample you use to reproduce this behavior? I need just to see the code to make sure this is not API usage issue. \\{font}
{font:style=font-family: trebuchet ms,geneva; font-size: 10pt;} \\{font}
{font:style=font-family: trebuchet ms,geneva; font-size: 10pt;}Regards,{font}
{font:style=font-family: trebuchet ms,geneva; font-size: 10pt;}Vladimir Ikryanov{font}


Reply all
Reply to author
Forward
0 new messages