PDA

View Full Version : QWebEngineSettings allow local file write?



RolandHughes
24th June 2015, 22:28
All,

The documentation is a bit unclear on the settings for QWebEngine. It makes it sound like one of them will enable local file write access, which, ironically, is what we want for a self contained application. I have one of the javascript team putting together a few lines of test code, but, is this just unclear documentation? Will QWebEngine allow javascript to write to an existing file if all of the permissions and settings or correct or is the write physically blocked?

Thanks,

anda_skoa
25th June 2015, 09:59
I doubt that this is possible, more likely this needs explicit support from the host application.

Which attribute do you refer to? LocalStorageEnabled?

Cheers,
_

RolandHughes
25th June 2015, 14:47
The ones for local file url access were unclear if they were read-only or read-write. One could make the case for read/write since the file was local to begin with. One could also make a case about the potential security hole. Self contained Kiosk type applications without network connections would be much easier to implement if the javascript team could read/write local data. Yes, LocalStorageEnabled would let them save a small amount of information like key-value pairs.

It is kind of sad though. The LocalStorageEnabled stuff isn't well implemented in many browsers so we are having to write code just to do what a locally contained application should be able to do.

Anyway, your answer is as I suspected.

Thanks,

anda_skoa
25th June 2015, 15:56
LocalContentCanAccessFileUrls is almost certainly just for reading, e.g. using them in src attributes, etc.

I doubt the engine implements post/push handlers for file URIs at all (which is the only available "write" API in a browser's context AFAIK)

Cheers,
_