Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Listing files in folder using webkit browser
Listing files in folder using webkit browser [message #684526] Wed, 15 June 2011 18:27 Go to next message
Patrick Chuong is currently offline Patrick ChuongFriend
Messages: 11
Registered: July 2009
Junior Member
I am running ubuntu 10.10 and eclipse 3.7. I want to list files in a folder using the browser, i.e file:///home/myName. I get an error saying "Unable to load page - Problem occurred while loading the URL file:///home/myName". If I switch to use mozilla browser instead of webkit, then I am able to view the content in this folder.

Is there a way to view files using webkit?

Thanks,
Patrick
Re: Listing files in folder using webkit browser [message #685448 is a reply to message #684526] Fri, 17 June 2011 14:28 Go to previous messageGo to next message
Grant Gayed is currently offline Grant GayedFriend
Messages: 2151
Registered: July 2009
Senior Member
Hi,

You're seeing https://bugs.webkit.org/show_bug.cgi?id=45127 , which is
fixed in WebKitGTK releases >= 1.4.x. I've verified that this works on
Fedora 15, which has a recent WebKitGTK release. There isn't a way to
make earlier WebKitGTK releases display this content.

The only workaround I can suggest is to add a LocationListener to the
Browser if its getBrowserType() is "webkit" and SWT.getPlatform() is
"gtk". When your changing() implementation is invoked with a url that's
a local directory you can abort the navigation by setting the event's
"doit" field to false, and then show a DirectoryDialog instead. If you
want to only hook this listener for WebKitGTK versions prior to 1.4.x
then you can use browser.evaluate("return navigator.userAgent") to get a
hint of the version. The userAgent strings I got for WebKitGTK 1.2.1
and 1.4.0 are below. I would suggest assuming that the listener is
needed, and only go the route of not hooking it if parsing the userAgent
string gives an expected value that definitely indicates that the
version is new enough.

WebKitGTK 1.2.1: Mozilla/5.0 (X11; U; Linux i686; en-us)
AppleWebKit/531.2+ (KHTML, like Gecko) Safari/531.2+

WebKitGTK 1.4: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/534.26+
(KHTML, like Gecko) Version/5.0 Safari/534.26+


HTH,
Grant


On 6/15/2011 2:27 PM, Patrick Chuong wrote:
> I am running ubuntu 10.10 and eclipse 3.7. I want to list files in a
> folder using the browser, i.e file:///home/myName. I get an error saying
> "Unable to load page - Problem occurred while loading the URL
> file:///home/myName". If I switch to use mozilla browser instead of
> webkit, then I am able to view the content in this folder.
> Is there a way to view files using webkit?
>
> Thanks,
> Patrick
Re: Listing files in folder using webkit browser [message #685472 is a reply to message #685448] Fri, 17 June 2011 15:10 Go to previous message
Patrick Chuong is currently offline Patrick ChuongFriend
Messages: 11
Registered: July 2009
Junior Member
thank you!
Previous Topic:Using JAWS with a Table widget
Next Topic:Execution of various Runnables through asyncExec or syncExec
Goto Forum:
  


Current Time: Wed Dec 17 19:59:41 GMT 2014

Powered by FUDForum. Page generated in 0.01621 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software