Skip to content
This repository was archived by the owner on Jan 14, 2022. It is now read-only.

Commit dbc6d78

Browse files
author
msrodri
committed
Merge pull request #15 from manifoldjs/v0.1.0
v0.1.0
2 parents 61e485e + 9279105 commit dbc6d78

File tree

31 files changed

+434
-370
lines changed

31 files changed

+434
-370
lines changed

package.json

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,31 @@
11
{
2-
"name": "ManifoldCordova",
3-
"version": "0.0.5",
4-
"description": "This package is to be used as a workaround to be consumed fromt he ManifestJS tool. Its a Cordova plugin.",
5-
"scripts": {
6-
"test": "echo \"Error: no test specified\" && exit 1"
2+
"name": "cordova-plugin-hostedwebapp",
3+
"version": "0.1.0",
4+
"description": "Hosted Web App Plugin",
5+
"cordova": {
6+
"id": "cordova-plugin-hostedwebapp",
7+
"platforms": [
8+
"android",
9+
"windows",
10+
"ios"
11+
]
712
},
813
"repository": {
914
"type": "git",
1015
"url": "https://github.com/manifoldjs/ManifoldCordova.git"
1116
},
1217
"keywords": [
13-
"Cordova",
14-
"plugin",
18+
"cordova",
19+
"manifest",
1520
"hosted",
1621
"web",
17-
"manifest"
22+
"ecosystem:cordova",
23+
"cordova-android",
24+
"cordova-windows",
25+
"cordova-ios"
1826
],
1927
"author": "",
20-
"license": "ISC",
28+
"license": "MIT",
2129
"bugs": {
2230
"url": "https://github.com/manifoldjs/ManifoldCordova/issues"
2331
},

plugin.xml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0"
3-
id="com.manifoldjs.hostedwebapp"
4-
version="0.0.6">
3+
id="cordova-plugin-hostedwebapp"
4+
version="0.1.0">
55
<name>HostedWebApp</name>
66
<description>Hosted Web App Plugin</description>
77
<license>MIT License</license>
88
<keywords>cordova,manifest,hosted,web,manifoldjs</keywords>
99
<repo>https://github.com/manifoldjs/ManifoldCordova.git</repo>
1010
<issue>https://github.com/manifoldjs/ManifoldCordova/issues</issue>
1111

12-
<dependency id="org.apache.cordova.network-information" version=">=0.2.15" />
13-
12+
<dependency id="cordova-plugin-whitelist" version=">=1.0.1" />
13+
<dependency id="cordova-plugin-network-information" version=">=1.0.0" />
14+
1415
<hook type="before_prepare" src="scripts/updateConfiguration.js" />
1516
<hook type="after_prepare" src="scripts/updateConfigurationAfterPrepare.js" />
1617
<hook type="after_build" src="scripts/updateConfigurationAfterBuild.js" />

readme.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ When the application is launched, the plugin automatically handles navigation to
4040
Lastly, since network connectivity is essential to the operation of a hosted web application, the plugin implements a basic offline feature that will show an offline page whenever connectivity is lost and will prevent users from interacting with the application until the connection is restored.
4141

4242
## Installation
43-
`cordova plugin add com.manifoldjs.hostedwebapp`
43+
`cordova plugin add cordova-plugin-hostedwebapp`
4444

4545
> **IMPORTANT:** Before using the plugin, make sure to copy the W3C manifest file to the **root** folder of the Cordova application, alongside **config.xml**, and name it **manifest.json**.
4646
@@ -68,7 +68,7 @@ The plugin enables using content hosted in a web site inside a Cordova applicati
6868
> **Note:** You can find a sample manifest file at the start of this document.
6969

7070
1. Add the **Hosted Web Application** plugin to the project.
71-
`cordova plugin add com.manifoldjs.hostedwebapp`
71+
`cordova plugin add cordova-plugin-hostedwebapp`
7272

7373
1. Add one or more platforms, for example, to support Android.
7474
`cordova platform add android`
@@ -131,7 +131,7 @@ For example, the following manifest references icons from the _/resources_ path
131131
</pre>
132132

133133
### URL Access Rules
134-
For a hosted web application, the W3C manifest defines a scope that restricts the URLs to which the application can navigate. Additionally, the manifest can include a proprietary setting named **mjs_urlAccess** that defines an array of access rules each one consisting of a _url_ attribute that identifies the target of the rule and indicates whether URLs matching the rule should be navigated to by the application. Non-matching URLs will be launched externally.
134+
For a hosted web application, the W3C manifest defines a scope that restricts the URLs to which the application can navigate. Additionally, the manifest can include a proprietary setting named **mjs_access_whitelist** that defines an array of access rules each one consisting of a _url_ attribute that identifies the target of the rule and indicates whether URLs matching the rule should be navigated to by the application. Non-matching URLs will be launched externally.
135135

136136
Typically, Cordova applications define access rules to implement a security policy that controls access to external domains. The access rules must not only allow access to the scope defined by the W3C manifest but also to external content used within the site, for example, to reference script files hosted by a CDN origin.
137137

@@ -140,9 +140,9 @@ To configure the security policy, the plugin hook maps the scope and URL access
140140
**Manifest.json**
141141
<pre>
142142
...
143-
"start_url": "http://www.xyz.com/"
143+
"start_url": "http://www.xyz.com/",
144144
"scope": "/",
145-
"mjs_urlAccess": [
145+
"mjs_access_whitelist": [
146146
{ "url": "http//googleapis.com/*" },
147147
{ "url": "http//login.anotherdomain.com/" }
148148
]

scripts/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"builder": "node ./node_modules/mocha/bin/mocha --reporter mocha-teamcity-reporter"
1111
},
1212
"devDependencies": {
13-
"cordova-lib": "^4.3.0",
13+
"cordova-lib": "^5.0.0",
1414
"mocha": "^2.2.1",
1515
"mocha-teamcity-reporter": "0.0.4",
1616
"q": "^1.2.0"
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<widget id="com.example.hello" version="0.0.1">
3+
<name>HelloWorld</name>
4+
<description>
5+
A sample Apache Cordova application that responds to the deviceready event.
6+
</description>
7+
<author email="[email protected]" href="http://cordova.io">
8+
Apache Cordova Team
9+
</author>
10+
<content src="index.html" />
11+
<preference name="Orientation" value="default" />
12+
<preference name="Fullscreen" value="false" />
13+
<access origin="http://*/*" />
14+
<access origin="https://*/*" />
15+
<access origin="*" />
16+
<allow-intent href="http://*/*" />
17+
<allow-intent href="https://*/*" />
18+
<allow-intent href="*" />
19+
<allow-navigation href="http://*/*" />
20+
<allow-navigation href="https://*/*" />
21+
<allow-navigation href="*" />
22+
</widget>

scripts/test/assets/normalFlow/www/manifest.json renamed to scripts/test/assets/fullAccessRules/manifest.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@
44
"orientation": "landscape",
55
"display": "fullscreen",
66
"scope": "http://wat-docs.azurewebsites.net/*",
7-
"mjs_urlAccess": [
8-
{ "url": "http://ajax.googleapis.com/*" },
7+
"mjs_access_whitelist": [
98
{ "url": "http://wat.codeplex.com", "external": true }
109
]
1110
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
empty folder

scripts/test/assets/jsonEmpty/config.xml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,14 @@
88
Apache Cordova Team
99
</author>
1010
<content src="index.html" />
11-
<access origin="http://com.example.hello/home" />
11+
12+
<allow-navigation href="general-navigation-rule" />
13+
<allow-intent href="general-intent-rule" />
14+
15+
<platform name="ios">
16+
<access origin="ios-access-rule" />
17+
</platform>
18+
1219
<preference name="Orientation" value="default" />
1320
<preference name="Fullscreen" value="true" />
1421
</widget>
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
empty folder

0 commit comments

Comments
 (0)