The following is the usage experience written by a chrome user.
Some time ago, chrome and Safari were used to support HTML5 application. During the test, it was found that Chrome's security mechanism did not support local access to Ajax. For example:
Access URL: file: // E:/test.html in Javascript. The Chrome browser reports the following error: XMLHttpRequest cannot load file: // E:/test.html. origin null is not allowed by access-control-allow-origin.
The solution is to convert the HTML5ProgramThe extension of chrome. The extension file name is. CRX.
1. Add a manifest. JSON file under the root directory of the program. The file format is:
{"Name": "demoapp", "Description": "Demo", "version": "0.1", "app": {"launch": {"local_path ": "***. html "}}," Permissions ": [" unlimitedstorage "]}
2. Package the program using chrome. Open chrome, select Tools> extended programs from the Settings button, or enter "Chrome: // extensions/" in the address bar /",
3. Click the extension program to package the HTML program:
4. Drag the packaged extension program to the Chrome browser for installation. After installation, run the program.
This article is from the iteye forum.