|Re: Listing files in folder using webkit browser [message #685448 is a reply to message #684526]
||Fri, 17 June 2011 14:28
| Grant Gayed
Registered: July 2009
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+
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?
Powered by FUDForum
. Page generated in 0.03398 seconds