kiosk app external usb access

32 views
Skip to first unread message

bruce4vic

unread,
May 16, 2017, 6:37:34 AM5/16/17
to Chromium-Apps-Announce
Hi,

I am new to Chromes OS and have written a NFC enabled kiosk app and installed it on my managed Chromebit so that it enters kiosk mode on boot.
This is working well.

I would now like to have the app load html files from an external usb device rather than the cloud due to large files, video etc. something like 
<webview src='files://USB Drive/Video1/index.html'></webview>  is what I have in mind.

I have read up on the fileSystem API and that it is supported for kiosk apps running in kiosk mode, but I cannot get it to work.

The below code results in the error shown.

chrome.fileSystem.getVolumeList(function(volumes)
  {
  if (volumes === undefined)
  {
  log("Error: " + JSON.stringify(chrome.runtime.lastError));
  }
  else
  {
  $.each(volumes, function(i, v){
  log("Volume: " + v.volumeid + ", Writable: " + v.writable);
  });

  // Request Filesystem
  log("Requesting filesystem...");
  chrome.fileSystem.requestFileSystem(volumes[0].volumeid, function(fs) {

  if (fs === undefined)
  {
  log("Error: " + JSON.stringify(chrome.runtime.lastError));
  }
  else
  {
  log(JSON.stringify(fs));
  }
  });
  }
  });

and the error:

Error: {"message":"Operation only supported for kiosk apps running in a kiosk session."}


My app is a kiosk app running in a kiosk session!

My manifest is as follows:


{
  "name": "****",
  "version": "0.1",
  "description": "****",
  "manifest_version": 2,
  "icons": {
      "128": "icon_128.png",
      "16": "icon_16.png"
    },
  "permissions": [
    "usb",
    {
      "usbDevices": [
        { "vendorId": 1839, "productId": 8704 } // This is the NFC USB reader
      ]
    },
    "webview",
    "audio",
    "enterprise.deviceAttributes",
    "power",
    "unlimitedStorage",
    {"fileSystem": ["write", "retainEntries", "directory", "requestFileSystem"] }

  ],

  "app": {
    "background": {
      "scripts": [ "background.js" ]
    }
  },

  "kiosk_enabled": true
}

Any help on have my kiosk app load html content from an external USB would be greatly appreciated.



Reply all
Reply to author
Forward
0 new messages