Javascript Cordova 4.1.2和Cordova文件插件1.3.3在设备中运行良好,但在Chrome中不起作用

Javascript Cordova 4.1.2和Cordova文件插件1.3.3在设备中运行良好,但在Chrome中不起作用,javascript,android,ios,cordova,google-chrome,Javascript,Android,Ios,Cordova,Google Chrome,我已经将cordova文件插件1.3.3添加到我们的cordova 4.1.2项目中。当我在iOS或Android设备上运行项目时,应用程序会正确启动。在日志中,我看到文件系统已正确加载。但是,当我在开发浏览器Chrome43.0.2357中尝试此操作时,它将失败(deviceready在8秒后未启动) 这是我的代码: document.addEventListener("deviceready", onDeviceReady, false); function onDeviceReady()

我已经将cordova文件插件1.3.3添加到我们的cordova 4.1.2项目中。当我在iOS或Android设备上运行项目时,应用程序会正确启动。在日志中,我看到文件系统已正确加载。但是,当我在开发浏览器Chrome43.0.2357中尝试此操作时,它将失败(deviceready在8秒后未启动)

这是我的代码:

document.addEventListener("deviceready", onDeviceReady, false);

function onDeviceReady() {
    console.log("yooooooo");
    window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, gotFS, fail);
}

function gotFS(fileSystem) {
    console.log("gotFS");
    fileSystem.root.getFile("readme.txt", {create: true, exclusive: false}, gotFileEntry, fail);
}

function gotFileEntry(fileEntry) {
    console.log("gotFileEntry");
    fileEntry.createWriter(gotFileWriter, fail);
}

function gotFileWriter(writer) {
    writer.onwriteend = function(evt) {
        console.log("contents of file now 'some sample text'");
        writer.truncate(11);
        writer.onwriteend = function(evt) {
            console.log("contents of file now 'some sample'");
            writer.seek(4);
            writer.write(" different text");
            writer.onwriteend = function(evt){
                console.log("contents of file now 'some different text'");
            }
        };
    };
    writer.write("some sample text");
}

function fail(error) {
    console.log(error.code);
}
我还尝试使用所有以前版本的文件插件,但这并没有什么不同。只有使用文件插件1.1.0,我的项目才能正确启动,但之后将永远不会调用gotFS

有人能帮我吗

提前谢谢


关于,Jasper Swart

device ready仅在cordova应用程序上启动,而不是在Chrome上启动当我卸载文件插件时,deviceready也会在Chromedid中调用你安装的浏览器平台?没有,我在哪里可以找到?我知道您希望我将浏览器平台添加到应用程序中,只需放置“cordova platform添加浏览器”(不带“”)