Handling page load errors with SWT browser. [message #765035] |
Tue, 13 December 2011 04:58  |
Eclipse User |
|
|
|
Hi,
For our eclipse application we display some help content using a SWT browser. The content is available both online and offline, the intention being that if the user cannot get to the online site, they can still view the offline content.
I'd like to be able catch any page loading errors (for example, if the user loses their network connection), then offer them the option of going offline instead. However, I cant seem to find any way to do this. Does anyone know if it is possible to somehow check for/get notifications of page load errors using the SWT browser?
Thanks in advance,
Kris.
|
|
|
Re: Handling page load errors with SWT browser. [message #765169 is a reply to message #765035] |
Tue, 13 December 2011 09:52  |
Eclipse User |
|
|
|
Hi Kris,
Unfortunately the Browser does not send a notification for handling
errors, the existing request for this is
https://bugs.eclipse.org/bugs/show_bug.cgi?id=98302 . The main reason
this has not been implemented is because mozilla-based renderers do not
provide support for this (at least they didn't last time I checked). I
think this would be valuable to have.
Given that your case is specific (you're showing your own help content),
you could probably infer a load failure by adding a ProgressListener to
the Browser and in its completed() implementation checking the Browser's
url and page content (getText()) to see if the navigate appears to have
succeeded. This is not ideal in a few ways (for instance the native
browser's "could not load page" error screen or prompter would appear),
but it should at least give you a way of taking a recovery step.
HTH,
Grant
On 12/13/2011 4:58 AM, kris Jacobs wrote:
> Hi,
>
> For our eclipse application we display some help content using a SWT
> browser. The content is available both online and offline, the intention
> being that if the user cannot get to the online site, they can still
> view the offline content.
> I'd like to be able catch any page loading errors (for example, if the
> user loses their network connection), then offer them the option of
> going offline instead. However, I cant seem to find any way to do this.
> Does anyone know if it is possible to somehow check for/get
> notifications of page load errors using the SWT browser?
>
> Thanks in advance,
> Kris.
|
|
|
Powered by
FUDForum. Page generated in 0.29928 seconds