Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Duplicate
-
2.7.0
-
None
-
None
Description
Frankly, I don't like the way you are trying to XHR the cordova_plugins.json file asynchronously (lines 6811-6831 in cordova-2.7.0.js).
Why there is no check:
cordova-2.7.0.js
xhr.onload = function() { if (xhr.readyState === 4) { if (xhr.status === 200) { .... handlePluginsObject(obj); } else { finishPluginLoading(); } } } ....
For instance, if there is no cordova_plugins.json jetty server will send a responce with the following responceText:
"<html> <head> <meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1"/> <title>Error 404 Not Found</title> </head> <body> <h2>HTTP ERROR: 404</h2> <p>Problem accessing /cordova_plugins.json. Reason: <pre> Not Found</pre></p> <hr /><i><small>Powered by Jetty://</small></i> </body> </html>"
And JSON.parse will throw "SyntaxError: Unexpected token <", which won't be caught - app will crash
Attachments
Issue Links
- blocks
-
CB-3029 remote page loading 2.6.0 cordova js file not work
- Closed