You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by pu...@apache.org on 2016/07/20 20:10:23 UTC
[1/3] cordova-plugin-inappbrowser git commit: doc: do not use `with`
in JS samples
Repository: cordova-plugin-inappbrowser
Updated Branches:
refs/heads/master 64928480e -> 2a3a0ceca
doc: do not use `with` in JS samples
The usage of `with` JS statement is highly discouraged for a number of reasons, see
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/with
http://www.2ality.com/2011/06/with-statement.html
Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser/commit/f42226dd
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser/tree/f42226dd
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser/diff/f42226dd
Branch: refs/heads/master
Commit: f42226dddb1b05cdbbf094185dfcd2658ec7254b
Parents: 066ba4c
Author: jakub-g <ja...@users.noreply.github.com>
Authored: Wed May 18 15:55:27 2016 +0200
Committer: jakub-g <ja...@users.noreply.github.com>
Committed: Wed May 18 15:55:27 2016 +0200
----------------------------------------------------------------------
README.md | 18 ++++++------------
1 file changed, 6 insertions(+), 12 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser/blob/f42226dd/README.md
----------------------------------------------------------------------
diff --git a/README.md b/README.md
index 1440308..a1a516f 100644
--- a/README.md
+++ b/README.md
@@ -235,14 +235,11 @@ function showHelp(url) {
inAppBrowserRef = cordova.InAppBrowser.open(url, target, options);
- with (inAppBrowserRef) {
+ inAppBrowserRef.addEventListener('loadstart', loadStartCallBack);
- addEventListener('loadstart', loadStartCallBack);
+ inAppBrowserRef.addEventListener('loadstop', loadStopCallBack);
- addEventListener('loadstop', loadStopCallBack);
-
- addEventListener('loaderror', loadErrorCallBack);
- }
+ inAppBrowserRef.addEventListener('loaderror', loadErrorCallBack);
}
@@ -544,14 +541,11 @@ function showHelp(url) {
inAppBrowserRef = cordova.InAppBrowser.open(url, target, options);
- with (inAppBrowserRef) {
+ inAppBrowserRef.addEventListener('loadstart', loadStartCallBack);
- addEventListener('loadstart', loadStartCallBack);
+ inAppBrowserRef.addEventListener('loadstop', loadStopCallBack);
- addEventListener('loadstop', loadStopCallBack);
-
- addEventListener('loaderror', loadErrorCallBack);
- }
+ inAppBrowserRef.addEventListener('loaderror', loadErrorCallBack);
}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org
[3/3] cordova-plugin-inappbrowser git commit: CB-5402 added extra
content from wiki page
Posted by pu...@apache.org.
CB-5402 added extra content from wiki page
Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser/commit/2a3a0cec
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser/tree/2a3a0cec
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser/diff/2a3a0cec
Branch: refs/heads/master
Commit: 2a3a0cecab0fd02e71c5a4ce867c627ec5c17b8a
Parents: fc7452c
Author: Jesse MacFadyen <pu...@gmail.com>
Authored: Wed Jul 20 13:10:14 2016 -0700
Committer: Jesse MacFadyen <pu...@gmail.com>
Committed: Wed Jul 20 13:10:14 2016 -0700
----------------------------------------------------------------------
README.md | 48 +++++++++++++++++++++++++++++++++++++++++++++++-
1 file changed, 47 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser/blob/2a3a0cec/README.md
----------------------------------------------------------------------
diff --git a/README.md b/README.md
index a8defd4..5df021a 100644
--- a/README.md
+++ b/README.md
@@ -227,7 +227,7 @@ The object returned from a call to `cordova.InAppBrowser.open` when the target i
```javascript
-var inAppBrowserRef = undefined;
+var inAppBrowserRef;
function showHelp(url) {
@@ -625,3 +625,49 @@ function executeScriptCallBack(params) {
}
```
+
+## More Usage Info
+
+### Local Urls ( source is in the app package )
+```
+var iab = cordova.InAppBrowser;
+
+iab.open('local-url.html'); // loads in the Cordova WebView
+iab.open('local-url.html', '_self'); // loads in the Cordova WebView
+iab.open('local-url.html', '_system'); // Security error: system browser, but url will not load (iOS)
+iab.open('local-url.html', '_blank'); // loads in the InAppBrowser
+iab.open('local-url.html', 'random_string'); // loads in the InAppBrowser
+iab.open('local-url.html', 'random_string', 'location=no'); // loads in the InAppBrowser, no location bar
+
+```
+
+
+
+### Whitelisted Content
+
+```
+var iab = cordova.InAppBrowser;
+
+iab.open('http://whitelisted-url.com'); // loads in the Cordova WebView
+iab.open('http://whitelisted-url.com', '_self'); // loads in the Cordova WebView
+iab.open('http://whitelisted-url.com', '_system'); // loads in the system browser
+iab.open('http://whitelisted-url.com', '_blank'); // loads in the InAppBrowser
+iab.open('http://whitelisted-url.com', 'random_string'); // loads in the InAppBrowser
+
+iab.open('http://whitelisted-url.com', 'random_string', 'location=no'); // loads in the InAppBrowser, no location bar
+
+```
+
+### Urls that are not white-listed
+
+```
+var iab = cordova.InAppBrowser;
+
+iab.open('http://url-that-fails-whitelist.com'); // loads in the InAppBrowser
+iab.open('http://url-that-fails-whitelist.com', '_self'); // loads in the InAppBrowser
+iab.open('http://url-that-fails-whitelist.com', '_system'); // loads in the system browser
+iab.open('http://url-that-fails-whitelist.com', '_blank'); // loads in the InAppBrowser
+iab.open('http://url-that-fails-whitelist.com', 'random_string'); // loads in the InAppBrowser
+iab.open('http://url-that-fails-whitelist.com', 'random_string', 'location=no'); // loads in the InAppBrowser, no location bar
+
+```
\ No newline at end of file
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org
[2/3] cordova-plugin-inappbrowser git commit: CB-5402 Merge doc
improvements
Posted by pu...@apache.org.
CB-5402 Merge doc improvements
Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser/commit/fc7452c4
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser/tree/fc7452c4
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser/diff/fc7452c4
Branch: refs/heads/master
Commit: fc7452c445c60996bdd0b1d8da21c7e57892aa63
Parents: 6492848 f42226d
Author: Jesse MacFadyen <pu...@gmail.com>
Authored: Wed Jul 20 12:55:03 2016 -0700
Committer: Jesse MacFadyen <pu...@gmail.com>
Committed: Wed Jul 20 12:55:03 2016 -0700
----------------------------------------------------------------------
README.md | 18 ++++++------------
1 file changed, 6 insertions(+), 12 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser/blob/fc7452c4/README.md
----------------------------------------------------------------------
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org