cordova-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ian Clelland (JIRA)" <>
Subject [jira] [Commented] (CB-6532) cdvfile file url is not working with link tag like css
Date Wed, 02 Jul 2014 17:49:25 GMT


Ian Clelland commented on CB-6532:

[~mikedidomizio], no it's not necessary for all platforms to use {{cdvfile}} urls; in fact,
because of issues like this, those URLs are mostly used by Android and iOS for passing information
about files between JavaScript and native code.

It's used by FileEntry and DirectoryEntry objects, so that the system can keep track of which
part of the file system it is dealing with, and to provide some sandboxing between apps, but
when an app requests a URL, the File plugin returns a native URL in just about every case

There are, I believe, other platforms which can't use these specific URLs, but have their
own custom schemes for different areas of the device, and so the plugin is just designed to
allow that, without forcing a specific URL scheme on any particular platform.

> cdvfile file url is not working with link tag like css 
> -------------------------------------------------------
>                 Key: CB-6532
>                 URL:
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: Plugin File, Plugin File Transfer
>    Affects Versions: 3.4.0
>         Environment: iOS 7 
>            Reporter: Patrick Dürsteler
>            Priority: Critical
> A css downloaded with xhr and created a local url (cdvfile://localhost/test.css) with
the File API can't be used as a stylesheet.
> {code}
> var filename = "test.css";
> var imageURL = "";
> requestFileSystem(TEMPORARY, 0, function(fileSystem) {
>     var ft = new FileTransfer();
>, fileSystem.root.toURL() + "/" + filename, function(entry) {
>          var fileref=document.createElement("link");
>          fileref.setAttribute("rel", "stylesheet");
>          fileref.setAttribute("type", "text/css");
>            fileref.setAttribute("href", entry.toURL());
>         document.head.appendChild(imgElement);
>     });
> });
> {code}

This message was sent by Atlassian JIRA

View raw message