HTML5 "get URL"

Fraser Gordon fraser.gordon at livecode.com
Thu Sep 3 11:26:35 CEST 2015


On 3 Sep 2015, at 10:02, Rolf Kocherhans <rolf.kocherhans at id.uzh.ch> wrote:

> I am experimenting with the „get URL“ command on a HTML5 WebApp.
> 
> I can’t get it to work at all :-(
> 
> The get URL command can be used in 3 ways with file - ftp or
> http urls, I guess the HTML5 get URL command is not used
> for ftp or http because the relay on LibURL (just a guess).
> 
> Therefore I concentrated on the file command to access local files on the
> Server where I host the WebPage.
> 
> Example: get URL ("file:" & "/public_html" & "/text.txt")
> 
> Can anybody help ? I guess I have a problem with not knowing the correct
> path to the file which I want to import ?
> 
> Cheers
> Rolf

Hi Rolf,

“file” URLs won’t work as you expect - the standalone is running in the user’s browser, not on the server so it has no access to the server’s filesystem. You don’t even have access to the user’s filesystem as browsers have security policies in place to prevent it. Instead, the “filesystem” that the HTML5 engine sees is empty except for the standalone stack and its resources.

You’re right that libURL isn’t being used (as it requires sockets support). We currently have a basic in-engine implementation of ‘get url’ but it only works for http and https URLs. Additionally, because it uses the browser’s own HTTP support, it is restricted by the “same-origin” policy that browsers use: https://en.wikipedia.org/wiki/Same-origin_policy . Basically, only http(s) will work and only for URLs on the same domain.

Fraser



More information about the use-livecode mailing list