Chrome App - file



  • I'm making an app-audiople for chrome. I want his name to be recorded in the file after changing the track. I can't record it. I've:

    chrome.fileSystem.chooseEntry({type: 'saveFile', 
    suggestedName: 'song.txt'}, 
     function(writableFileEntry) {
     writableFileEntry.createWriter(function(writer) {
     writer.write(new Blob([songs[i].title],
    {type: 'text/plain'})); 
     }, errorHandler);
    });
    

    But it just opens up a file dialogue, and it needs to be done without the user involved.



  • Got it all figured out. Here are the references to video and docks:

    • https://youtu.be/h9YLMrCcvDc
    • https://developer.chrome.com/apps/app_storage#sync-filesystem

    Used "== sync, corrected by elderman =="The file is on Google Drive. In the configuration file, we need to write this:

    "permissions": [
      "...",
      "syncFileSystem"
    ]
    

    And the record code itself looks like:

    chrome.syncFileSystem.requestFileSystem(function (fs) {
       fs.root.getFile('test.txt', {create:true}, getEntryCallback, errorCallback);
    });
    



Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2