Notes - merrillpaul/assess-cordova-proto GitHub Wiki

File Loading VIA Ajax

Since we are using cordova and native XHR/Javascript, we wont need the fileloader , but there are caveats

  • We need to add CSP in all home*, stim* and testDirector html to allow xhr. <meta http-equiv="Content-Security-Policy" content="default-src * 'self' blob: data: blob:* data:* gap://* tel:* cdvfile://*; style-src 'unsafe-inline' 'self' cdvfile://*; script-src 'self' 'unsafe-eval' cdvfile://*; worker-src blob:"> .
  • File loading with Ajax will work, but if we want to save/persist content back to some folder, we should use the cordova-plugin-file wrappers. Thankfully these will be bundled through bower as a single cordova js which includes all core and plugins. The caveat is to avoid code duplication. There will be code which manipulates the file system wihtin the assess-www ( ios replacement ). We need to find a way to embed these into the give-www folder Pure javascript means where we have file loader to do a 'ajax' like loading, in cordova