Giter VIP home page Giter VIP logo

cordova-app-loader's People

Contributors

agamemnus avatar arieljake avatar epegzz avatar gitter-badger avatar hussfelt avatar markmarijnissen avatar objectivetruth avatar ptarjan avatar spiffyjr avatar willeeklund avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cordova-app-loader's Issues

issues with dot files on Android

I have a ".nomedia" file in my cordova/www directory (and in my manifest.json).
But while all other files are getting copied to the persistent storage just fine after running an update, the ".nomedia" file won't be there.

Beside having issues copying a file starting with a dot, using hidden directories as localRoot also causes issues.

I tried to use myApp/.app or myApp/.app/ as localRoot var which both breaks the updating process in different ways:

When using myApp/.app the downloaded filenames will be concatinated in a way that an index.html becomes an .appindex.html within the myApp folder.

When using myApp/.app/ the files are getting copied just fine, but the next update check will just hang and stop to work at all.

When using myApp/app everything works fine.

The reason why I want to use a dotfile directory or add a .nomedia file is so that the app assets are not getting indexed by the android gallery app.

Any idea why dot files seem to be an issue?

Failed download still executes "then" function, not "catch"

In testing, I had an app update download fail due to a configuration issue with my web server. The particulars aren't terribly important to this project, but essentially my manifest was listing a file that the server returns a 404 error for.

Now, when I debug into the code, I see that FileCache.download() is rejecting its promise. This is on line 506 of the "complete" app loader bundled file: https://github.com/markmarijnissen/cordova-app-loader/blob/master/dist/cordova-app-loader-complete.js#L506. That makes complete sense - after all the download did fail. What then doesn't make sense to me, and I think might be a bug, is that my .then() function still gets executed.

This is more or less the way my code is running the download/update (simplifying to keep things focused):

loader.download().then( function(manifest) {
    loader.update( true );
}).catch( function(error) {
    // show a message box saying the app update failed
});

When loader.update() is called, it checks self._updateReady, which of course is false, since the update is not ready. So, the app is not actually updated, but my logic thinks it is. Moreover, my app is expecting load.update( true ); to reload the page, so it doesn't show any messages to the user. Instead, my app just silently fails to update and sits there. The error handling "catch" function is never called.

So, it's not a huge issue, but it took me a while to figure out what the heck was going on, because I had to debug all the way down into the library to see that the download was actually failing, and not some kind of weird "hang" when calling update().

AppLoader.check() is not resolved/rejected if manifest.json is not found

Hi,

if the manifest.json is not found while checking for updates, the error callback of AppLoader#check is never called. Here's the problematic code:

AppLoader.prototype.check = function (newManifest) {
            ...
            return new Promise(function (resolve, reject) {
                Promise.all([gotNewManifest, self.getBundledManifest(), self.cache.list()])
                    .then(function (values) {
                        ...
                        resolve(...);
                    }); // end of .then
            }); // end of new Promise
        };

The then is missing an error function rejecting the outer promise. Fix would be:

AppLoader.prototype.check = function (newManifest) {
            ...
            return new Promise(function (resolve, reject) {
                Promise.all([gotNewManifest, self.getBundledManifest(), self.cache.list()])
                    .then(function (values) {
                        ...
                        resolve(...);
                    }, function(reason) {
                        reject(reason);
                    }); // end of .then
            }); // end of new Promise
        };

I will create a pull request for this.

cannot get html templates to update

works great for .js and .css, but the old .html stays cached for some reason, I'm sure the files are getting there. I try clearing the template cache, but that doesn't seem to help.

Security concerns

What will it take to password protect the server side? I'm thinking something as simple as checking the request for a HTTP Header.

New manifest available, but an earlier update attempt failed. Will not download.

Can this be more specific ? I have no idea where my manifest would be "corrupt".

{
  "files": {
    "loader": {
      "version": "e1b6e5505edd086e5a2d2e8f1d38612709e2881a",
      "filename": "dist/loader.js"
    },
    "css": {
      "version": "4163a1616d78cd37b97eb425bafe38efd7de8a96",
      "filename": "dist/ionic.app.css"
    },
    "libs": {
      "version": "4bfc76c49ff7186168f77558a704181b610f91ce",
      "filename": "dist/libs.js"
    },
    "app": {
      "filename": "dist/app.js",
      "version": "f941587acc09bb85857adccac5ee95a774a5ab3b"
    },
    "font_ttf": {
      "filename": "lib/ionic/fonts/ionicons.ttf",
      "version": "6ea051e1975142acc1c87b5e16a9c48520e44731"
    },
    "font_woff": {
      "filename": "lib/ionic/fonts/ionicons.woff",
      "version": "3c2e00d86ce8a574abd47e7f28871b268220418f"
    },
    "font_svg": {
      "filename": "lib/ionic/fonts/ionicons.svg",
      "version": "3f1ca28fcb042d2bcc6ee6a4e3dd817e5132eeea"
    },
    "font_eot": {
      "filename": "lib/ionic/fonts/ionicons.eot",
      "version": "a5653d053229493afd83a863a50a180ced87f6c5"
    }
  },
  "load": [
    "dist/ionic.app.css",
    "dist/loader.js",
    "dist/libs.js",
    "dist/app.js"
  ],
  "version": "74207d570d861b205c2d45e83f0a0589e56bcabf"
}

Should the files on my server all be in the root folder, or should they have the same path as in my application ?

Cannot load cdvfile on android

I have cordova-app-loader working perfectly in browser and ios, but android devices (including the simulator) cannot seem to load the files. This results in BOOTSTRAP_OK not being set and it loading all the original app files again.

Failed to load resource: the server responded with a status of 404 (Not Found)
cdvfile://localhost/persistent/app/CordovaPromiseFS.is?1430969702286
Failed to load resource: the server responded with a status of 404 (Not Found)
cdvfile://localhost/persistent/app/cordova—app—loader—complete.is?1430969702286
Failed to load resource: the server responded with a status of 404 (Not Found)
cdvfile://localhost/persistent/app/autoupdate.is?1430969702286
Failed to load resource: the server responded with a status of 404 (Not Found)
cdvfile://localhost/persistent/app/app.is?1430969702286
Failed to load resource: the server responded with a status of 404 (Not Found)
cdvfile://localhost/persistent/app/style.css?1430969702286
Failed to load resource: the server responded with a status of 404 (Not Found)
cdvfile://localhost/persistent/app/countries.js?1430969702286
Failed to load resource: the server responded with a status of 404 (Not Found)
cdvfile://localhost/persistent/app/style.css?1430969702286

EDIT: I just checked on a fresh install of the demo Cordova App Loader and got the same result. It fails at the 'update' stage.

"FileNotFound" error on first download (sometimes?)

  1. Goto demo with Chrome
  2. Click a manifest link
  3. Click Check
  4. Click Download
{
  "code": 1,
  "message": "A requested file or directory could not be found at the time an operation was processed.",
  "name": "NotFoundError"
}

Questions:

  • Who is causing the error?
  • What about android / ios?

how to update image on css?

some image use css loaded,(ex: background-image: url(...)),if we download new image,how to change the url?thanks

Basic Auth

URLS with basic auth. are not working right

like https://username:password@domain/mainfest.json

Found one issue in the bootstrap.js
xhr.setRequestHeader("Authorization", "Basic ...);

is missing.

Also the cordova file loader does not set the right headers for downloading

authHeaderValue = function(username, password) {
    var tok = username + ':' + password;
    var hash = btoa(tok);
    return "Basic " + hash;
};

options.headers = {'Authorization': authHeaderValue('Bob', '1234') };

Problem with cache and fonts

When my app gets updated, the loading of some files fail (works if I never update my app).

Here is the error I get :

(404) GET cdvfile://localhost/persistent/app/lib/ionic/fonts/ionicons.ttf?v=2.0.1 

I'm developing on Android, with crosswalk.
Could you help me ?

edit: before the update by the app loader, it checks for

file:///android_asset/www/lib/ionic/fonts/ionicons.ttf?v=2.0.1

CordovaAppLoader.js - line 173 - promise can resolve twice

Note that in the case where the manifest is deemed to be corrupt, we resolve(null); without returning in the function, so the next line of code executed is resolve(false);

Fix is to either return resolve(null); or put the resolve(false); in an else clause.

if(newFiles === self._lastUpdateFiles) {
              // YES! So we're doing the same update again!

              // Check if our current Manifest has indeed the "last_update_files"
              var currentFiles = hash(Manifest.files);
              if(self._lastUpdateFiles !== currentFiles){
                // No! So we've updated, yet they don't appear in our manifest. This means:
                console.warn('New manifest available, but an earlier update attempt failed. Will not download.');
                self.corruptNewManifest = true;
                resolve(null);
              }
              // Yes, we've updated and we've succeeded.
              resolve(false);
              return;
            }

App Store updates

Hi @markmarijnissen - great library, and I think I have it all working in my app! I was reading through the various closed issues, and I'm still confused on how App Store updates are handled. If I've downloaded the app and then done one or more remote updates, and then download a new version from the App Store, will it copy over the newly downloaded files into the cache, or will it try to do a remote update, or something else? Any insight would be much appreciated.

best, - rajat

latest files are not downloading

Hi ,
I have configured as you said in the page, but it is not downloaded i kept the manifest js file version 100 and in server i named as 200 like below am i missing anything and one more suggestion is currently if we run from browser it is not working it seems to be searching the file in "temporary/app/" location ,may be you can correct it or you can skip for desktop browsers.

In server manifest file
"controllers": {
"version": "1=200",
"filename": "js/controllers.js"
},

In the app manifest file

"controllers": {
"version": "100",
"filename": "js/controllers.js"
},

NOTE: I am using angular
Regards
N.Balu

problem updating image resources

in my manifest.json, i have a .png file that i want to update,
the file path is 'resources/img/image.png'.

somewhere in my html template, i use

when i update the .png file on my server, it is downloaded by the app,
but the app still loads the original image.

i also noticed in the developer tool that my image is loaded from:
file:///android_asset/www/resources/img/image.png

instead of being loaded from the cache:
cdvfile://localhost/persistent/app/resources/img/image.png (which exists but not used)

by the way, the html template that contins the image tag is part of my .js that is loaded with the bootstrap

is there any way i could solve this?

relative image paths are broken after updating CSS in Android

in my CSS, i use relative paths to background images e.g. ../img/image.gif.
When the app autoupdates in iOS, the relative paths continue to work just fine.
However in android they're all broken links.

here are my loader settings:

loader = new CordovaAppLoader({
  fs: fs,
  localRoot: "www",
  serverRoot: serverRoot,
  mode: "mirror",
  cacheBuster: true,
  checkTimeout: 10000
});

and manifest:

{
  "files": {
    "app": {
      "version": "d548722725de794f8fd09a0e6857a7a353050aaa",
      "filename": "js/application.js"
    },
    "templates": {
      "version": "e7ded3afbf0b5b5d41c7dba2f052397283c6a8ca",
      "filename": "js/templates.js"
    },
    "style": {
      "version": "2da2c832c55f8c4aeb650d7103c62b77bb097e19",
      "filename": "css/ionic.app.css"
    }
  },
  "load": [
    "js/application.js",
    "js/templates.js",
    "css/ionic.app.css"
  ],
  "version": "33fe7fbd76074e53fced5d26bcbb4eb0f099003a"
}

Any idea? and why would it work differently in android?

App Updates on First Run: Copy bundled files to cache

When running a newly bundle app for the first time, it seems that it ALWAYS detects update files, because they have not been synced down to local storage yet. Is there a way to have it detect that the files bundled with the application are the same ones being referenced in remote manifest and NOT download them and trigger an update?

I thought that was how it was supposed to work already, but thats not the behavior I'm seeing. Maybe I am missing something simple.

Corrupt files - copied files are 'index.html' (when location.href contains `#/`)

Given:

var BUNDLE_ROOT = location.href.substr(0,location.href.lastIndexOf('/')+1);

and

location.href === 'file://android_assets/www/index.html#/hash/navigation/'

Then:

  • The BUNDLE_ROOT url becomes file://android_assets/www/index.html#/
  • File to be copied are downloaded from file://android_assets/www/index.html#/myfile.jpg.

So, all copied file contain the contents "index.html" if and only if your location contains #/ when downloading.

This bug only affects Android and is fixed in next release.

Grunt task: dirs in src list

when I use this, and there are sub-directories in the "css" folder:

src: [
    'css/**/*'
],

I get an error in the grunt task when executing this line:

json.files[key]['version'] = hasher.update(grunt.file.read(path.join(options.basePath, item))).digest("hex")

error is due to trying to read a directory as a file. I fixed it with this:

var isDir = grunt.file.isDir(path.join(options.basePath, item));

if (!isDir)
{
    ...rest of code to create manifest file entries
}

updating index.html

Is it possible to update index.html, and how?
Cause after changing several files on a server every one except index.html was updated.

Using Angular's $q as a Promise library for cordova-promise-fs

Hi,

I'm trying to get this to work with Angular's built in Promise functionality, but am having trouble. I don't really understand what i'm supposed to be passing into the cordova-promise-fs init.

        // Initialize a FileSystem
        var fs = new CordovaPromiseFS({
          Promise: $q
        });

It just says "use your favorite promise library". Its not very clear what exactly will work, or what the cordova-promise-fs is expecting. Is there even a way to get this to work with Angulars promises without having to include an external library?

Many thanks,
Lyle

Need a Way to fix "Endless Update Loop"

You prevent the loader from downloading an update if the files from the last update match the files from a new update with this message here:

if(JSON.stringify(newManifest.files) === self._lastUpdateFiles) {

I think the check needs to be something different because in its current form there is no way to CORRECT a previous botched update. It just always ignores subsequent updates with this in place. Ideas?

Grunt Script to Generate Manifest

Great project! We were working on our own version (took the redirect to new index.html approach) but are running into issues and want to try yours. One difference is that we were just zipping all of the file contents up into one ZIP file. This prevented us from needed to generate a manifest.

I'm curious if you know of or use a Grunt script to generate your manifest files?

Sporadically app doesn't load on fresh install (iOS)

When I remove my app from my device and reinstall/run it via Xcode, about one time in 7 it won't load and gets stuck on the splash screen. The last thing Xcode shows in its log is:

2015-01-28 15:59:56.290 MyApp[1960:506893] Finished load of: file:///private/var/mobile/Containers/Bundle/Application/F541E2A0-4247-4ACF-B80D-2603890E70A1/MyApp.app/www/index.html

When the app runs properly, after that I see several log messages from my app.

Looking at the Safari debugger, I can see that all the script and css nodes were properly added by bootstrap.js, it just appears that none of the code is being run - it's unclear why.

  • Removing Cordova-app-loader fixes the problem (although that's clearly not desirable).
  • Adding alert ("IN BOOTSTRAP.JS") to the top of bootstrap.js also fixes the problem. Because of that and the sporadic nature of the issue, it would seem to point to some sort of timing problem that the time taken to close the alert addresses.

It only ever seems to happen on the first run after a fresh install. I can't get it to happen on any subsequent runs.

I am using the 0.14.0 version of the library.

I have tested and can replicate this on an iPad 1, an iPad Mini 2, and various iOS simulator devices. I don't have this problem on Android.

Please let me know if I can provide you with any other information, or if you have suggestions on where in the code I can look to try to narrow down the issue.

Thanks!

Question on App Start/Loading Times

Howdy,

Just wanted to bring this up to get your opinion on it:
When using this loading method, it seems to increase the app launch time by 2-5 seconds depending on the device. Do you know of any way to prevent the delay? Have you noticed it?

Extending the app's launch time by multiple seconds (every time the user launches the app) is a serious sacrifice that should not be taken lightly in my opinion.

Thanks,
Lyle

Problems with Dynamic Manifests

I want to fetch the manifest file from a server side API. This means, I need to pass credentials into the URL, and may not want the loader to append manifest.json onto the URL. I also may not want the last / (forward slash) appended to the url either.

Example:

        var loader = new CordovaAppLoader({
          fs: fs,
          manifest: '',
          localRoot: window.BuildConfig.updater.contentDirectory,
          serverRoot: 'https://www.EXAMPLESERVICE.com/api/v3/app/loader/?username='+$rootScope.session.username+'&token='+$rootScope.session.token,
          cacheBuster: true, // make sure we're not downloading cached files.
          checkTimeout: 10000 // timeout for the "check" function - when you loose internet connection
        });

First load / no connectivity?

If the local files provide an offline experience, and the app is first opened without connectivity, the app fails to load.

This seems to be because the app checks for a manifest in localStorage, and if it doesn't find one, it calls out to the web. It seems that it never uses the bundled manifest -- is this accurate? I think it should use the bundled Manifest to boot before calling out if it doesn't exist in localStorage.

Fall back to last working version

Hey :)

If an update fails, why not fall back to the last working version, instead of the bundled version?
Wouldn't that be way better?

Unable to build project

Hi,

I tried to create a pull request for a small fix a wrote, but I was not able to build the project.

What I did:

  • clone the project
  • sudo npm install webpack -g
  • npm run-script prepublish

Got the this error:

$>npm run-script prepublish

[email protected] prepublish /home/peter/workspace/cordova-app-loader
npm run copy-tests && npm run autoupdate && npm run bootstrap && npm run cordova-promise-fs && npm run cordova-app-loader && npm run copy-to-dist && npm run bundle && npm run minify-dist

[email protected] copy-tests /home/peter/workspace/cordova-app-loader
cp pegasus.js www/test/pegasus.js && cp node_modules/cordova-promise-fs/test/tests.js www/test/cordova-promise-fs-tests.js && cp node_modules/cordova-file-cache/test/tests.js www/test/cordova-file-cache-tests.js

cp: der Aufruf von stat für »node_modules/cordova-promise-fs/test/tests.js“ ist nicht möglich: Datei oder Verzeichnis nicht gefunden
npm ERR! weird error 1
npm ERR! not ok code 0
npm ERR! weird error 1
npm ERR! not ok code 0

which would be "File not found". The whole folder node-modules/cordova-promise-fs/ is missing. npm install has the same error. Any suggestions?

Thanks,
Peter

Questions on App Store Update Process when Native Plugins Change

Hi!

I'm having trouble figuring out the best way to handle changes updates that require Native Plugin additions/changes.

Imaging this scenario:

  • Publish app update that has a new Cordova native plugin
  • Since remote manifest is THE source for info, we need to also push a Hot Code Update

The problem is that if you have not received the native update yet, the Hot Code Update will be buggy since its referencing native plugins that don't exist.

If you instead wait to issue the hot code update until AFTER your app is approved, you still have no way of knowing whether everyone has updated or not. How can you ever reliably release updates to code depending on native plugins?

Collaborators wanted!

Hi everybody,

I find myself often too busy to quickly respond to issues, pull requests and publish to NPM. It's great to see people are helping eachother solve issues here.

I am wondering if anybody is willing to help with PRs and publish to NPM? I can make you Github Collaborator on this project.

As for NPM publishing: Is is possible other people publish the same project?

Thanks for the support

Mark

Always updates on first run after install

The first time I am launching my app it will start normally. Then autoupdate.js (CordovaAppLoader) will do a check and decide that it's time to update, even though the remote manifest.json equals the shipped manifest.json. This results in a reload of the app right some seconds after the app was launched initially.

Is this default behaviour? Or should CordovaAppLoader be smart enough to figure out that no files have changed even on the first time the app starts after being freshly installed?

Also, I'm not sure why the locarRoot param is set to 'app':
https://github.com/markmarijnissen/cordova-app-loader/blob/master/www/autoupdate.js#L28
Maybe it's related to that, that CordovaAppLoader is expecting the shipped files in an app subdirectory but because i have all files directly in the cordova/www directory it's not finding them?

Anyway, changing it to localRoot: '' did not change anything.

Weird Issue where updated CSS file does not load on iOS

We have his strange issue where some iOS users report that he styling in our app gets completely broken after a Hot Update.

So far I have been unable to reproduce the issue, but its happened to several people so far.

Has anyone else encountered this? Does anyone have any ideas as to what could cause this....and only when on iOS?

Manifest.version: Do we need this?

Manifest.version: Is is required?

You could use your manifest to describe whatever you want.

  • For Bootstrap, Manifest should describe the files to load.
  • For AppLoader, Manifest should keep track of files and their version.

Adding an extra Manifest.version does not help in this task. It will never force an update if file-versions haven't changed, so it can only block an update when you haven't changed the Manifest.version.

Why wouldn't you update when you changed some files? Makes no sense - this could only lead to errors.

I was convinced earlier, so I might have forgotton a perfectly good use-case. Can you tell me? Then I'll implement.

Bower install fails

Tried doing this, but alas:

$   bower install cordova-app-loader cordova-promise-fs bluebird

bower not-cached    git://github.com/petkaantonov/bluebird.git#*
bower resolve       git://github.com/petkaantonov/bluebird.git#*
bower cached        git://github.com/ftlabs/fastclick.git#1.0.3
bower validate      1.0.3 against git://github.com/ftlabs/fastclick.git#>=1.0.3
bower download      https://github.com/petkaantonov/bluebird/archive/v2.3.11.tar.gz
bower progress      bluebird#* received 0.2MB
bower progress      bluebird#* received 0.2MB
bower progress      bluebird#* received 0.2MB
bower progress      bluebird#* received 0.3MB
bower ENOTFOUND     Package cordova-app-loader not found

References to existing assets are converted to cdvfile:// paths and 404

I have a bunch of images that aren't managed by manifest.json that the application references locally. When an update is available, the manifest is downloaded, files are updated, but when the app reloads (to load the new files) all of the image links are broken. They point to cdvfile://localhost/presistent/... and 404.

Any idea why this is happening? Does cordova-app-loader assume that ALL local assets are managed by the manifest?

Problems When Using with WKWebView

I'm trying to use the Telerik WKWebView plugin with this. The problem is that the Origin header seems to be set to null for all XHR requests. This is especially problematic when trying to load files from Amazon S3. Even when their CORS settings are set to allow from *, it will not accept null. Any advice?

Make absolute file URLs other than from serverRoot possible

Hi,

I've the following issue to solve: One of the files listed in the manifest.json are not located on the server which provides the manifest and all other files. As an example lets assume the following manifest.json:

{
    "files": {
        "http://scheffield:9090/toro/api/v1/upgrade/wrapperAppI18n.js": {
            "filename": "http://scheffield:9090/toro/api/v1/upgrade/wrapperAppI18n.js",
            "version": "8869368acba0b97e6ef7a3d9961fe62f9c50f056274444542894536f320c8506"
        },
        "/scripts/16ea7ed4.angular.js": {
            "filename": "/scripts/16ea7ed4.angular.js",
            "version": "46550665ad41273099d29282acb87cbbf6fa80f63dd30fb47fc2155c11ba48e0"
        },
        "/styles/e203b96f.main.css": {
            "filename": "/styles/e203b96f.main.css",
            "version": "072957636a2db6817ce199be2b0d48d6d6e7a4707f4f25a5cb52727820c9d181"
        }
    },
    "load": [
          "http://scheffield:9090/toro/api/v1/upgrade/wrapperAppI18n.js",
          "/scripts/16ea7ed4.angular.js",
          "/styles/e203b96f.main.css"
    ],
    "root": "./"
}

And a serverRoot set to http://scheffield:9004. In this case the updater would download the file correctly but tries to save it under something like <path_set_by_file_plugin>/<localRoot>/http://scheffield:9090/toro/api/v1/upgrade/wrapperAppI18n.js what eventually will lead to an error.

I'd like to fix this issue but I'm not absolutely sure how to solve it. Here are my approaches:

  1. Make the mode: "hash" setting actual work. This would mean to rewrite the downloaded manifest (the manifest.load) or to make bootstrap.js capable of generating the hash.
  2. Separating the filename property from the actual url. A possible manifest would look the following:
{
    "files": {
        "wrapperAppI18n.js": {
            "filename": "wrapperAppI18n.js",
            "version": "8869368acba0b97e6ef7a3d9961fe62f9c50f056274444542894536f320c8506"
            "url": "http://scheffield:9090/toro/api/v1/upgrade/wrapperAppI18n.js"
        },
        "/scripts/16ea7ed4.angular.js": {
            "filename": "/scripts/16ea7ed4.angular.js",
            "version": "46550665ad41273099d29282acb87cbbf6fa80f63dd30fb47fc2155c11ba48e0"
        },
        "/styles/e203b96f.main.css": {
            "filename": "/styles/e203b96f.main.css",
            "version": "072957636a2db6817ce199be2b0d48d6d6e7a4707f4f25a5cb52727820c9d181"
        }
    },
    "load": [
          "wrapperAppI18n.js",
          "/scripts/16ea7ed4.angular.js",
          "/styles/e203b96f.main.css"
    ],
    "root": "./"
}

What do you think?

Could not get Cordova FileSystem

Hello guys!

I'm running into a little problem.

I need to use window.requestFileSystem() to get access to the local files.
It takes four parameters:
PERSISTENT or TEMPORARY (1 or 0)
quota in bytes
success callback
fail callback.

In order to pass a quota bigger than 0mb we need to ask the user for permission.
I've read the documentation and the current non-deprecated method to do that is:
navigator.webkitPersistentStorage.requestQuota()

In an Android browser this should prompt the user requesting permission to expand the quota.
Unfortunately a Cordova Application does not run in Android Browser but a Webview and apparently- the Webview won't prompt the user for permission.

The navigator.webkitPersistentStorage.requestQuota() resolves immediately (without asking) with a granted quota of 0

The rest of the Cordova App Loader implementation fails since there's no access to the Cordova File System which returns an error code of 10, which corresponds to QUOTA_EXCEEDED_ERR

screen shot 2015-08-05 at 21 32 48

I'm using Android Emulator 5554: Nexus_5_API_21_x86

Any ideas? How do you deal with this fileSystem Quota problem?

please help!!

thanks!

Download fails if local files do not exist on first run

The first time the app is run and it tries to update, it tries to delete stored files. However, because the files do not exist, the download fails and Android logs show a java.lang.NullPointerException error. I'm not really sure how this is supposed to work, because the files can not exist there on first run.

Have data attributes for scripts

Hi,

we use requirejs to start our app. So for now in index.html we have

<script data-main="src/main.min.js" src="src/require.js"></script>

I don't think this is possible with the current bootstrap.js and manifest file. Or is it?

Or could it be a future feature with syntax something like:

  "load": [
    "lib/jquery.min.js",
    {
       "tag":"script",
        "data-main":"src/main.min.js",
        "src":"src/require.js"
    }
  ]

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.