WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED INVALID
114798
Don't penalize synchronous XHR users for the 'file://' protocol
https://bugs.webkit.org/show_bug.cgi?id=114798
Summary
Don't penalize synchronous XHR users for the 'file://' protocol
Andy E
Reported
2013-04-18 03:14:39 PDT
I can understand the reasons for discouraging synchronous XHR over HTTP, but many rendering engines are now being used for client applications with file access privileges. For instance, WebKit is a popular platform choice for Smart TV applications (used by at least Samsung and LG televisions from 2011 onwards). Rather than implementing proprietary APIs for certain features, it's easier for these platforms to just reuse the web APIs to keep compatibility high. So, rather than having a proprietary API for loading local files, XMLHttpRequest should be used with the 'file://' protocol. With local file access, there's no real advantage of using an asynchronous request over a synchronous one. Using a synchronous request keeps the code procedural, as well as shorter and easier to read.
https://bugs.webkit.org/show_bug.cgi?id=72154
, for example, recommended disabling `responseType` for all synchronous requests which, in my opinion, is rather short-sighted. I'm all for discouraging bad practices in use by web developers, but I'm surprised nobody had the foresight to see that XMLHttpRequest isn't just used for HTTP and WebKit isn't just used in web browsers. I realise this is only a minor inconvenience (I'm sure I can cope with the extra 4 lines of code I have to write), but a simple check to see if the request is being made on the local file system doesn't seem like something that would be difficult to implement.
Attachments
Add attachment
proposed patch, testcase, etc.
Alexey Proskuryakov
Comment 1
2013-04-18 10:33:25 PDT
I don't think that there is a bug here, WebKit already works the way you are asking for. The change in
bug 72154
was limited to http/https resources. Please re-open with more details if you are observing an issue in practice.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug