Bug 21499

Summary: HTML content set by QWebView::setHtml can't access local files
Product: WebKit Reporter: Bernhard Rosenkraenzer <bero>
Component: WebKit QtAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: fantasy54, hausmann
Priority: P2 Keywords: Qt
Version: 528+ (Nightly build)   
Hardware: All   
OS: Linux   
Attachments:
Description Flags
Suggested fix none

Bernhard Rosenkraenzer
Reported 2008-10-09 02:48:20 PDT
Loading images from the local filesystem (file:/ URLs) fails in current snapshots if the HTML code has been set by QWebView::setHtml (e.g. HTML code generated on the fly by a local application) as opposed to having been loaded from a file:/ URL. This is caused by current WebKit defaulting FrameLoader::localLoadPolicy to AllowLocalLoadsForLocalOnly (as opposed to AllowLocalLoadsForLocalAndSubstituteData), and the QtWebKit API not having the functionality to override this. There should be a way to set FrameLoader::localLoadPolicy through the QtWebKit API (QWebSettings::globalSettings()->setAttribute(QWebSettings::allowLocalLoads); or something?). For compatibility with some legacy applications, it may also make sense to have the option to set localLoadPolicy to AllowLocalLoadsForAll, the way it used to be in older WebKit versions.
Attachments
Suggested fix (1.60 KB, patch)
2008-10-09 07:24 PDT, Bernhard Rosenkraenzer
no flags
Bernhard Rosenkraenzer
Comment 1 2008-10-09 07:24:42 PDT
Created attachment 24231 [details] Suggested fix Suggested fix
nacho
Comment 2 2009-01-22 03:10:02 PST
ok this bug is solved changing in FrameLoader.cpp the code static FrameLoader::LocalLoadPolicy localLoadPolicy = FrameLoader::AllowLocalLoadsForLocalOnly for static FrameLoader::LocalLoadPolicy localLoadPolicy = FrameLoader::AllowLocalLoadsForAll. But now, I can't to access an image provided by a AdServer. Are there any restrictions on access to external images?
Simon Hausmann
Comment 3 2009-11-23 05:28:14 PST
Note You need to log in before you can comment on or make changes to this bug.