mirror of
https://github.com/shuto-cn/cordova-plugin-inappbrowser.git
synced 2026-01-26 00:00:04 +08:00
Compare commits
37 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ce285e8e06 | ||
|
|
65821f907d | ||
|
|
290ea0ac9c | ||
|
|
542536f790 | ||
|
|
9b576f303b | ||
|
|
52cfd3216a | ||
|
|
8142c73c84 | ||
|
|
bc9036d90a | ||
|
|
1cd9205eb5 | ||
|
|
5451427c98 | ||
|
|
e32b95ccf9 | ||
|
|
682703aa24 | ||
|
|
6815a48408 | ||
|
|
620d92e5c0 | ||
|
|
2c002f0f8d | ||
|
|
214763c76b | ||
|
|
8fb2244432 | ||
|
|
1bc51f9381 | ||
|
|
49757716f5 | ||
|
|
6b99fb96f8 | ||
|
|
1912d12697 | ||
|
|
5a558344fd | ||
|
|
e89f602633 | ||
|
|
790771bb00 | ||
|
|
1afd42aabb | ||
|
|
32743e0eb9 | ||
|
|
89c5ee54e7 | ||
|
|
fee0d4e2d8 | ||
|
|
c08e239143 | ||
|
|
2279aee4ff | ||
|
|
368cbcbc41 | ||
|
|
5c7a9d95a8 | ||
|
|
74aa099b7e | ||
|
|
cb1c6b4d24 | ||
|
|
8175122c03 | ||
|
|
11a2acfd7b | ||
|
|
d9900ba783 |
13
.travis.yml
13
.travis.yml
@@ -1,13 +0,0 @@
|
||||
language: objective-c
|
||||
git:
|
||||
depth: 2
|
||||
node_js:
|
||||
- "0.10"
|
||||
install:
|
||||
- echo -e "Host github.com\n\tStrictHostKeyChecking no\n" >> ~/.ssh/config
|
||||
- cd ..
|
||||
- npm install -g cordova-paramedic
|
||||
- npm install -g cordova
|
||||
- npm install -g ios-sim
|
||||
script:
|
||||
- cordova-paramedic --platform ios --plugin ${TRAVIS_BUILD_DIR}
|
||||
@@ -27,7 +27,7 @@ There are multiple ways to contribute: report bugs, improve the docs, and
|
||||
contribute code.
|
||||
|
||||
For instructions on this, start with the
|
||||
[contribution overview](http://cordova.apache.org/#contribute).
|
||||
[contribution overview](http://cordova.apache.org/contribute/).
|
||||
|
||||
The details are explained there, but the important items are:
|
||||
- Sign and submit an Apache ICLA (Contributor License Agreement).
|
||||
|
||||
11
README.md
11
README.md
@@ -19,8 +19,6 @@
|
||||
|
||||
# cordova-plugin-inappbrowser
|
||||
|
||||
[](https://travis-ci.org/apache/cordova-plugin-inappbrowser)
|
||||
|
||||
This plugin provides a web browser view that displays when calling `cordova.InAppBrowser.open()`.
|
||||
|
||||
var ref = cordova.InAppBrowser.open('http://apache.org', '_blank', 'location=yes');
|
||||
@@ -56,6 +54,10 @@ Although `window.open` is in the global scope, InAppBrowser is not available unt
|
||||
console.log("window.open works well");
|
||||
}
|
||||
|
||||
:warning: Report issues on the [Apache Cordova issue tracker](https://issues.apache.org/jira/issues/?jql=project%20%3D%20CB%20AND%20status%20in%20%28Open%2C%20%22In%20Progress%22%2C%20Reopened%29%20AND%20resolution%20%3D%20Unresolved%20AND%20component%20%3D%20%22Plugin%20InAppBrowser%22%20ORDER%20BY%20priority%20DESC%2C%20summary%20ASC%2C%20updatedDate%20DESC)
|
||||
|
||||
|
||||
|
||||
## Installation
|
||||
|
||||
cordova plugin add cordova-plugin-inappbrowser
|
||||
@@ -170,6 +172,10 @@ opened with `target='_blank'`. The rules might look like these
|
||||
|
||||
### Windows Quirks
|
||||
|
||||
Windows 8.0, 8.1 and Windows Phone 8.1 don't support remote urls to be opened in the Cordova WebView so remote urls are always showed in the system's web browser if opened with `target='_self'`.
|
||||
|
||||
On Windows 10 if the URL is NOT in the white list and is opened with `target='_self'` it will be showed in the system's web browser instead of InAppBrowser popup.
|
||||
|
||||
Similar to Firefox OS IAB window visual behaviour can be overridden via `inAppBrowserWrap`/`inAppBrowserWrapFullscreen` CSS classes
|
||||
|
||||
### Browser Quirks
|
||||
@@ -385,4 +391,3 @@ Due to [MSDN docs](https://msdn.microsoft.com/en-us/library/windows.ui.xaml.cont
|
||||
ref.addEventListener('loadstop', function() {
|
||||
ref.insertCSS({file: "mystyles.css"});
|
||||
});
|
||||
|
||||
|
||||
321
RELEASENOTES.md
321
RELEASENOTES.md
@@ -20,119 +20,80 @@
|
||||
-->
|
||||
# Release Notes
|
||||
|
||||
### 0.2.2 (Sept 25, 2013)
|
||||
* CB-4889 bumping&resetting version
|
||||
* CB-4788: Modified the onJsPrompt to warn against Cordova calls
|
||||
* [windows8] commandProxy was moved
|
||||
* CB-4788: Modified the onJsPrompt to warn against Cordova calls
|
||||
* [windows8] commandProxy was moved
|
||||
* CB-4889 renaming core references
|
||||
* CB-4889 renaming org.apache.cordova.core.inappbrowser to org.apache.cordova.inappbrowser
|
||||
* CB-4864, CB-4865: Minor improvements to InAppBrowser
|
||||
* Rename CHANGELOG.md -> RELEASENOTES.md
|
||||
* [CB-4792] Added keepCallback to the show function.
|
||||
* [CB-4752] Incremented plugin version on dev branch.
|
||||
### 1.1.1 (Dec 10, 2015)
|
||||
|
||||
### 0.2.3 (Oct 9, 2013)
|
||||
* [CB-4915] Incremented plugin version on dev branch.
|
||||
* [CB-4926] Fixes inappbrowser plugin loading for windows8
|
||||
* CB-9445 Improves executeScript callbacks on iOS
|
||||
* CB-10035 Incremented plugin version.
|
||||
* CB-10040 - re-fix: backwards compatible with cordova-ios < 4.0
|
||||
* CB-8534: Allow plugins to respond to onReceivedHttpAuthRequest. This closes #82
|
||||
* CB-3750: Fixes spinner on iOS. This closes #89
|
||||
* CB-7696 Document target=_self behavior for Windows
|
||||
* CB-10040 - Compile Error in InAppBrowser Plugin for iOS - No known instance method for selector 'URLIsWhitelisted:'
|
||||
|
||||
### 0.2.4 (Oct 28, 2013)
|
||||
* CB-5128: added repo + issue tag to plugin.xml for inappbrowser plugin
|
||||
* CB-4995 Fix crash when WebView is quickly opened then closed.
|
||||
* CB-4930 - iOS - InAppBrowser should take into account the status bar
|
||||
* [CB-5010] Incremented plugin version on dev branch.
|
||||
* [CB-5010] Updated version and RELEASENOTES.md for release 0.2.3
|
||||
* CB-4858 - Run IAB methods on the UI thread.
|
||||
* CB-4858 Convert relative URLs to absolute URLs in JS
|
||||
* CB-3747 Fix back button having different dismiss logic from the close button.
|
||||
* CB-5021 Expose closeDialog() as a public function and make it safe to call multiple times.
|
||||
* CB-5021 Make it safe to call close() multiple times
|
||||
### 1.1.0 (Nov 18, 2015)
|
||||
* [CB-10035](https://issues.apache.org/jira/browse/CB-10035) Updated `RELEASENOTES` to be newest to oldest
|
||||
* Invoke webview if using local file
|
||||
* Fixed `zIndex` issue on **Windows 8**, **8.188 where InAppBrowser opens behind default app.
|
||||
* fix `async` self usage
|
||||
* [CB-9150](https://issues.apache.org/jira/browse/CB-9150) Fix InAppBrowser `executeScript` crash on **Windows** if no data returned
|
||||
* [CB-10008](https://issues.apache.org/jira/browse/CB-10008) Fix InAppBrowser popup layout on **Windows**
|
||||
* Setting `setStatusBarStyle` to `-1` causes `CGContextSaveGState`.
|
||||
* [CB-9167](https://issues.apache.org/jira/browse/CB-9167) Fix crash on **browser** window close
|
||||
* [CB-9799](https://issues.apache.org/jira/browse/CB-9799) Fixed `javaDoc` errors.
|
||||
* Fixing contribute link.
|
||||
* [CB-9760](https://issues.apache.org/jira/browse/CB-9760) InAppBrowser: fallback to default `window.open` behavior on **Ripple**
|
||||
* [CB-9378](https://issues.apache.org/jira/browse/CB-9378) Fix InAppBrowser not taking whole screen on **Windows**
|
||||
* [CB-9158](https://issues.apache.org/jira/browse/CB-9158) - InAppBrowser `zoomControls` are always set to true
|
||||
|
||||
### 0.2.5 (Dec 4, 2013)
|
||||
* Remove merge conflict tag
|
||||
* [CB-4724] fixed UriFormatException
|
||||
* add ubuntu platform
|
||||
* CB-3420 WP feature hidden=yes implemented
|
||||
* Added amazon-fireos platform. Change to use amazon-fireos as the platform if user agent string contains 'cordova-amazon-fireos'
|
||||
### 1.0.1 (Jun 17, 2015)
|
||||
* [CB-9128](https://issues.apache.org/jira/browse/CB-9128) cordova-plugin-inappbrowser documentation translation: cordova-plugin-inappbrowser
|
||||
* fix npm md issue
|
||||
|
||||
### 0.3.0 (Jan 02, 2014)
|
||||
* CB-5592 Android: Add MIME type to Intent when opening file:/// URLs
|
||||
* CB-5594 iOS: Add disallowoverscroll option.
|
||||
* CB-5658 Add doc/index.md for InAppBrowser plugin
|
||||
* CB-5595 Add toolbarposition=top option.
|
||||
* Apply CB-5193 to InAppBrowser (Fix DB quota exception)
|
||||
* CB-5593 iOS: Make InAppBrowser localizable
|
||||
* CB-5591 Change window.escape to encodeURIComponent
|
||||
### 1.0.0 (Apr 15, 2015)
|
||||
* [CB-8746](https://issues.apache.org/jira/browse/CB-8746) gave plugin major version bump
|
||||
* [CB-7689](https://issues.apache.org/jira/browse/CB-7689) Adds insertCSS support for windows platform
|
||||
* [CB-4930](https://issues.apache.org/jira/browse/CB-4930) - (prefix) InAppBrowser should take into account the status bar
|
||||
* [CB-8635](https://issues.apache.org/jira/browse/CB-8635) Improves UX on windows platform
|
||||
* [CB-8661](https://issues.apache.org/jira/browse/CB-8661) Return executed script result on Windows
|
||||
* [CB-8683](https://issues.apache.org/jira/browse/CB-8683) updated wp and browser specific references of old id to new id
|
||||
* [CB-8683](https://issues.apache.org/jira/browse/CB-8683) changed plugin-id to pacakge-name
|
||||
* [CB-8653](https://issues.apache.org/jira/browse/CB-8653) properly updated translated docs to use new id
|
||||
* [CB-8653](https://issues.apache.org/jira/browse/CB-8653) updated translated docs to use new id
|
||||
* Use TRAVIS_BUILD_DIR, install paramedic by npm
|
||||
* [CB-8432](https://issues.apache.org/jira/browse/CB-8432) Correct styles for browser wrapper to display it correctly on some pages
|
||||
* [CB-8659](https://issues.apache.org/jira/browse/CB-8659) - Update InAppBrowser to support both cordova-ios 4.0.x and 3.x (closes #93)
|
||||
* [CB-7961](https://issues.apache.org/jira/browse/CB-7961) Add cordova-plugin-inappbrowser support for browser platform
|
||||
* [CB-8653](https://issues.apache.org/jira/browse/CB-8653) Updated Readme
|
||||
* Update docs for Android zoom=no option
|
||||
* Added option to disable/enable zoom controls
|
||||
* updated docs, set hardwareback default to true
|
||||
* Add a hardwareback option to allow for the hardware back button to go back.
|
||||
* [CB-8570](https://issues.apache.org/jira/browse/CB-8570) Integrate TravisCI
|
||||
* [CB-8438](https://issues.apache.org/jira/browse/CB-8438) cordova-plugin-inappbrowser documentation translation: cordova-plugin-inappbrowser
|
||||
* [CB-8538](https://issues.apache.org/jira/browse/CB-8538) Added package.json file
|
||||
* Keep external android pages in a single tab. (close #61)
|
||||
* [CB-8444](https://issues.apache.org/jira/browse/CB-8444) Add a clobber for `cordova.InAppBrowser.open` (close #80)
|
||||
* [CB-8444](https://issues.apache.org/jira/browse/CB-8444) Don't clobber `window.open` - Add new symbol/clobber to access open function (`cordova.InAppBrowser.open`) - Change existing tests to use new symbol (i.e. don't rely on plugin clobber of `window.open`) - Add tests to use `window.open` via manual replace with new symbol - Update docs to deprecate plugin clobber of `window.open`
|
||||
|
||||
### 0.3.1 (Feb 05, 2014)
|
||||
* CB-5756: Android: Use WebView.evaluateJavascript for script injection on Android 4.4+
|
||||
* Didn't test on ICS or lower, getDrawable isn't supported until Jellybean
|
||||
* add ubuntu platform
|
||||
* Adding drawables to the inAppBrowser. This doesn't look quite right, but it's a HUGE improvement over the previous settings
|
||||
* CB-5756: Android: Use WebView.evaluateJavascript for script injection on Android 4.4+
|
||||
* Remove alive from InAppBrowser.js since it didn't catch the case where the browser is closed by the user.
|
||||
* CB-5733 Fix IAB.close() not working if called before show() animation is done
|
||||
### 0.6.0 (Feb 04, 2015)
|
||||
* [CB-8270](https://issues.apache.org/jira/browse/CB-8270) ios: Remove usage of `[arr JSONString]`, since it's been renamed to `cdv_JSONString`
|
||||
* ubuntu: implement `inject*` functions
|
||||
* ubuntu: port to oxide
|
||||
* [CB-7897](https://issues.apache.org/jira/browse/CB-7897) ios, android: Update to work with whilelist plugins in Cordova 4.x
|
||||
|
||||
### 0.3.2 (Feb 26, 2014)
|
||||
* Validate that callbackId is correctly formed
|
||||
* CB-6035 Move js-module so it is not loaded on unsupported platforms
|
||||
* Removed some iOS6 Deprecations
|
||||
|
||||
### 0.3.3 (Mar 5, 2014)
|
||||
* CB-5534 Fix video/audio does not stop playing when browser is closed
|
||||
* CB-6172 Fix broken install on case-sensitive file-systems
|
||||
|
||||
|
||||
### 0.4.0 (Apr 17, 2014)
|
||||
* CB-6360: [ios] Fix for crash on iOS < 6.0 (closes #37)
|
||||
* CB-3324: [WP8] Add support for back-button inappbrowser [WP8] if there is no history -> InAppBrowser is closed
|
||||
* [WP] await async calls, resolve warnings
|
||||
* [WP] Make InAppBrowser work with embedded files, using system behavior
|
||||
* CB-6402: [WP8] pass empty string instead of null for [optional] windowFeatures string
|
||||
* CB-6422: [windows8] use cordova/exec/proxy
|
||||
* CB-6389 CB-3617: Add clearcache and clearsessioncache options to iOS (like Android)
|
||||
* Doc update: event name and example param (closes #31)
|
||||
* CB-6253: [WP] Add Network Capability to WMAppManifest.xml
|
||||
* CB-6212: [iOS] fix warnings compiled under arm64 64-bit
|
||||
* CB-6218: Update docs for BB10
|
||||
* CB-6460: Update license headers
|
||||
|
||||
### 0.5.0 (Jun 05, 2014)
|
||||
* CB-6127 Spanish and rench Translations added. Github close #23
|
||||
* Clean up whitespace (mainly due to no newline at eof warning)
|
||||
* Adding permission info
|
||||
* CB-6806 Add license
|
||||
* CB-6491 add CONTRIBUTING.md
|
||||
* Add necessary capability so the plugin works on its own
|
||||
* CB-6474 InAppBrowser. Add data urls support to WP8
|
||||
* CB-6482 InAppBrowser calls incorrect callback on WP8
|
||||
* Fixed use of iOS 6 deprecated methods
|
||||
* CB-6360 - improvement: feature detection instead of iOS version detection
|
||||
* CB-5649 - InAppBrowser overrides App's orientation
|
||||
* refactoring fixed
|
||||
* CB-6396 [Firefox OS] Adding basic support
|
||||
|
||||
### 0.5.1 (Aug 06, 2014)
|
||||
* ubuntu: support qt 5.2
|
||||
* **FFOS** update InAppBrowserProxy.js
|
||||
* **FFOS** app needs to be privileged
|
||||
* CB-6127 Updated translations for docs
|
||||
* CB-6769 ios: Fix statusbar color reset wasn't working on iOS7+
|
||||
|
||||
### 0.5.2 (Sep 17, 2014)
|
||||
* CB-7471 cordova-plugin-inappbrowser documentation translation: cordova-plugin-inappbrowser
|
||||
* CB-7490 Fixes InAppBrowser manual tests crash on windows platform
|
||||
* CB-7249 cordova-plugin-inappbrowser documentation translation: cordova-plugin-inappbrowser
|
||||
* CB-7424 Wrong docs: anchor tags are not supported by the InAppBrowser
|
||||
* CB-7133 clarify that anchor1 doesn't exist
|
||||
* CB-7133 more fixup of tests on Android
|
||||
* CB-7133 fix up the tests for Android
|
||||
* Add just a bit more logging
|
||||
* CB-7133 port inappbrowser to plugin-test-framework
|
||||
* phonegap events supported for \_blank target
|
||||
* inappbrowser \_blank target position is fixed
|
||||
* amazon-fireos related changes.
|
||||
### 0.5.4 (Dec 02, 2014)
|
||||
* [CB-7784](https://issues.apache.org/jira/browse/CB-7784) Exit event is not fired after `InAppBrowser` closing
|
||||
* [CB-7697](https://issues.apache.org/jira/browse/CB-7697) Add `locationBar` support to `InAppBrowser` **Windows** platform version
|
||||
* [CB-7690](https://issues.apache.org/jira/browse/CB-7690) `InAppBrowser` `loadstart/loadstop` events issues
|
||||
* [CB-7695](https://issues.apache.org/jira/browse/CB-7695) Fix `InAppBrowser` `injectScriptFile` for **Windows 8.1** / **Windows Phone 8.1**
|
||||
* [CB-7692](https://issues.apache.org/jira/browse/CB-7692) `InAppBrowser` local url opening bug in 8.1
|
||||
* [CB-7688](https://issues.apache.org/jira/browse/CB-7688) `Alert` is not supported in `InAppBrowser` on **Windows** platform
|
||||
* [CB-7977](https://issues.apache.org/jira/browse/CB-7977) Mention `deviceready` in plugin docs
|
||||
* [CB-7876](https://issues.apache.org/jira/browse/CB-7876) change test target to avoid undesired redirects
|
||||
* [CB-7712](https://issues.apache.org/jira/browse/CB-7712) remove references to `closebuttoncaption`
|
||||
* [CB-7850](https://issues.apache.org/jira/browse/CB-7850) clarify role of whitelist
|
||||
* [CB-7720](https://issues.apache.org/jira/browse/CB-7720) check if event is null since OK string from success callback was removed
|
||||
* [CB-7471](https://issues.apache.org/jira/browse/CB-7471) cordova-plugin-inappbrowser documentation translation: cordova-plugin-inappbrowser
|
||||
|
||||
### 0.5.3 (Oct 03, 2014)
|
||||
* Windows implementation fixes and improvements
|
||||
@@ -145,52 +106,106 @@
|
||||
* Append Windows 8.1 platform configuration in plugin.xml
|
||||
* Append Windows 8.1 proxy using x-ms-webview
|
||||
|
||||
### 0.5.4 (Dec 02, 2014)
|
||||
* CB-7784 Exit event is not fired after `InAppBrowser` closing
|
||||
* CB-7697 Add `locationBar` support to `InAppBrowser` **Windows** platform version
|
||||
* CB-7690 `InAppBrowser` `loadstart/loadstop` events issues
|
||||
* CB-7695 Fix `InAppBrowser` `injectScriptFile` for **Windows 8.1** / **Windows Phone 8.1**
|
||||
* CB-7692 `InAppBrowser` local url opening bug in 8.1
|
||||
* CB-7688 `Alert` is not supported in `InAppBrowser` on **Windows** platform
|
||||
* CB-7977 Mention `deviceready` in plugin docs
|
||||
* CB-7876 change test target to avoid undesired redirects
|
||||
* CB-7712 remove references to `closebuttoncaption`
|
||||
* CB-7850 clarify role of whitelist
|
||||
* CB-7720 check if event is null since OK string from success callback was removed
|
||||
* CB-7471 cordova-plugin-inappbrowser documentation translation: cordova-plugin-inappbrowser
|
||||
### 0.5.2 (Sep 17, 2014)
|
||||
* [CB-7471](https://issues.apache.org/jira/browse/CB-7471) cordova-plugin-inappbrowser documentation translation: cordova-plugin-inappbrowser
|
||||
* [CB-7490](https://issues.apache.org/jira/browse/CB-7490) Fixes InAppBrowser manual tests crash on windows platform
|
||||
* [CB-7249](https://issues.apache.org/jira/browse/CB-7249) cordova-plugin-inappbrowser documentation translation: cordova-plugin-inappbrowser
|
||||
* [CB-7424](https://issues.apache.org/jira/browse/CB-7424) Wrong docs: anchor tags are not supported by the InAppBrowser
|
||||
* [CB-7133](https://issues.apache.org/jira/browse/CB-7133) clarify that anchor1 doesn't exist
|
||||
* [CB-7133](https://issues.apache.org/jira/browse/CB-7133) more fixup of tests on Android
|
||||
* [CB-7133](https://issues.apache.org/jira/browse/CB-7133) fix up the tests for Android
|
||||
* Add just a bit more logging
|
||||
* [CB-7133](https://issues.apache.org/jira/browse/CB-7133) port inappbrowser to plugin-test-framework
|
||||
* phonegap events supported for \_blank target
|
||||
* inappbrowser \_blank target position is fixed
|
||||
* amazon-fireos related changes.
|
||||
|
||||
### 0.6.0 (Feb 04, 2015)
|
||||
* CB-8270 ios: Remove usage of `[arr JSONString]`, since it's been renamed to `cdv_JSONString`
|
||||
* ubuntu: implement inject* functions
|
||||
* ubuntu: port to oxide
|
||||
* CB-7897 ios, android: Update to work with whilelist plugins in Cordova 4.x
|
||||
### 0.5.1 (Aug 06, 2014)
|
||||
* ubuntu: support qt 5.2
|
||||
* **FFOS** update InAppBrowserProxy.js
|
||||
* **FFOS** app needs to be privileged
|
||||
* [CB-6127](https://issues.apache.org/jira/browse/CB-6127) Updated translations for docs
|
||||
* [CB-6769](https://issues.apache.org/jira/browse/CB-6769) ios: Fix statusbar color reset wasn't working on iOS7+
|
||||
|
||||
### 1.0.0 (Apr 15, 2015)
|
||||
* CB-8746 gave plugin major version bump
|
||||
* CB-7689 Adds insertCSS support for windows platform
|
||||
* CB-4930 - (prefix) InAppBrowser should take into account the status bar
|
||||
* CB-8635 Improves UX on windows platform
|
||||
* CB-8661 Return executed script result on Windows
|
||||
* CB-8683 updated wp and browser specific references of old id to new id
|
||||
* CB-8683 changed plugin-id to pacakge-name
|
||||
* CB-8653 properly updated translated docs to use new id
|
||||
* CB-8653 updated translated docs to use new id
|
||||
* Use TRAVIS_BUILD_DIR, install paramedic by npm
|
||||
* CB-8432 Correct styles for browser wrapper to display it correctly on some pages
|
||||
* CB-8659 - Update InAppBrowser to support both cordova-ios 4.0.x and 3.x (closes #93)
|
||||
* CB-7961 Add cordova-plugin-inappbrowser support for browser platform
|
||||
* CB-8653 Updated Readme
|
||||
* Update docs for Android zoom=no option
|
||||
* Added option to disable/enable zoom controls
|
||||
* updated docs, set hardwareback default to true
|
||||
* Add a hardwareback option to allow for the hardware back button to go back.
|
||||
* CB-8570 Integrate TravisCI
|
||||
* CB-8438 cordova-plugin-inappbrowser documentation translation: cordova-plugin-inappbrowser
|
||||
* CB-8538 Added package.json file
|
||||
* Keep external android pages in a single tab. (close #61)
|
||||
* CB-8444 Add a clobber for `cordova.InAppBrowser.open` (close #80)
|
||||
* CB-8444 Don't clobber `window.open` - Add new symbol/clobber to access open function (`cordova.InAppBrowser.open`) - Change existing tests to use new symbol (i.e. don't rely on plugin clobber of `window.open`) - Add tests to use `window.open` via manual replace with new symbol - Update docs to deprecate plugin clobber of `window.open`
|
||||
### 0.5.0 (Jun 05, 2014)
|
||||
* [CB-6127](https://issues.apache.org/jira/browse/CB-6127) Spanish and rench Translations added. Github close #23
|
||||
* Clean up whitespace (mainly due to no newline at eof warning)
|
||||
* Adding permission info
|
||||
* [CB-6806](https://issues.apache.org/jira/browse/CB-6806) Add license
|
||||
* [CB-6491](https://issues.apache.org/jira/browse/CB-6491) add CONTRIBUTING.md
|
||||
* Add necessary capability so the plugin works on its own
|
||||
* [CB-6474](https://issues.apache.org/jira/browse/CB-6474) InAppBrowser. Add data urls support to WP8
|
||||
* [CB-6482](https://issues.apache.org/jira/browse/CB-6482) InAppBrowser calls incorrect callback on WP8
|
||||
* Fixed use of iOS 6 deprecated methods
|
||||
* [CB-6360](https://issues.apache.org/jira/browse/CB-6360) - improvement: feature detection instead of iOS version detection
|
||||
* [CB-5649](https://issues.apache.org/jira/browse/CB-5649) - InAppBrowser overrides App's orientation
|
||||
* refactoring fixed
|
||||
* [CB-6396](https://issues.apache.org/jira/browse/CB-6396) [Firefox OS] Adding basic support
|
||||
|
||||
### 1.0.1 (Jun 17, 2015)
|
||||
* CB-9128 cordova-plugin-inappbrowser documentation translation: cordova-plugin-inappbrowser
|
||||
* fix npm md issue
|
||||
### 0.4.0 (Apr 17, 2014)
|
||||
* [CB-6360](https://issues.apache.org/jira/browse/CB-6360): [ios] Fix for crash on iOS < 6.0 (closes #37)
|
||||
* [CB-3324](https://issues.apache.org/jira/browse/CB-3324): [WP8] Add support for back-button inappbrowser [WP8] if there is no history -> InAppBrowser is closed
|
||||
* [WP] await async calls, resolve warnings
|
||||
* [WP] Make InAppBrowser work with embedded files, using system behavior
|
||||
* [CB-6402](https://issues.apache.org/jira/browse/CB-6402): [WP8] pass empty string instead of null for [optional] windowFeatures string
|
||||
* [CB-6422](https://issues.apache.org/jira/browse/CB-6422): [windows8] use cordova/exec/proxy
|
||||
* [CB-6389](https://issues.apache.org/jira/browse/CB-6389) [CB-3617](https://issues.apache.org/jira/browse/CB-3617): Add clearcache and clearsessioncache options to iOS (like Android)
|
||||
* Doc update: event name and example param (closes #31)
|
||||
* [CB-6253](https://issues.apache.org/jira/browse/CB-6253): [WP] Add Network Capability to WMAppManifest.xml
|
||||
* [CB-6212](https://issues.apache.org/jira/browse/CB-6212): [iOS] fix warnings compiled under arm64 64-bit
|
||||
* [CB-6218](https://issues.apache.org/jira/browse/CB-6218): Update docs for BB10
|
||||
* [CB-6460](https://issues.apache.org/jira/browse/CB-6460): Update license headers
|
||||
|
||||
### 0.3.3 (Mar 5, 2014)
|
||||
* [CB-5534](https://issues.apache.org/jira/browse/CB-5534) Fix video/audio does not stop playing when browser is closed
|
||||
* [CB-6172](https://issues.apache.org/jira/browse/CB-6172) Fix broken install on case-sensitive file-systems
|
||||
|
||||
### 0.3.2 (Feb 26, 2014)
|
||||
* Validate that callbackId is correctly formed
|
||||
* [CB-6035](https://issues.apache.org/jira/browse/CB-6035) Move js-module so it is not loaded on unsupported platforms
|
||||
* Removed some iOS6 Deprecations
|
||||
|
||||
### 0.3.1 (Feb 05, 2014)
|
||||
* [CB-5756](https://issues.apache.org/jira/browse/CB-5756): Android: Use WebView.evaluateJavascript for script injection on Android 4.4+
|
||||
* Didn't test on ICS or lower, getDrawable isn't supported until Jellybean
|
||||
* add ubuntu platform
|
||||
* Adding drawables to the inAppBrowser. This doesn't look quite right, but it's a HUGE improvement over the previous settings
|
||||
* [CB-5756](https://issues.apache.org/jira/browse/CB-5756): Android: Use WebView.evaluateJavascript for script injection on Android 4.4+
|
||||
* Remove alive from InAppBrowser.js since it didn't catch the case where the browser is closed by the user.
|
||||
* [CB-5733](https://issues.apache.org/jira/browse/CB-5733) Fix IAB.close() not working if called before show() animation is done
|
||||
|
||||
### 0.2.5 (Dec 4, 2013)
|
||||
* Remove merge conflict tag
|
||||
* [CB-4724](https://issues.apache.org/jira/browse/CB-4724) fixed UriFormatException
|
||||
* add ubuntu platform
|
||||
* [CB-3420](https://issues.apache.org/jira/browse/CB-3420) WP feature hidden=yes implemented
|
||||
* Added amazon-fireos platform. Change to use amazon-fireos as the platform if user agent string contains 'cordova-amazon-fireos'
|
||||
|
||||
### 0.2.4 (Oct 28, 2013)
|
||||
* [CB-5128](https://issues.apache.org/jira/browse/CB-5128): added repo + issue tag to plugin.xml for inappbrowser plugin
|
||||
* [CB-4995](https://issues.apache.org/jira/browse/CB-4995) Fix crash when WebView is quickly opened then closed.
|
||||
* [CB-4930](https://issues.apache.org/jira/browse/CB-4930) - iOS - InAppBrowser should take into account the status bar
|
||||
* [CB-5010](https://issues.apache.org/jira/browse/CB-5010) Incremented plugin version on dev branch.
|
||||
* [CB-5010](https://issues.apache.org/jira/browse/CB-5010) Updated version and RELEASENOTES.md for release 0.2.3
|
||||
* [CB-4858](https://issues.apache.org/jira/browse/CB-4858) - Run IAB methods on the UI thread.
|
||||
* [CB-4858](https://issues.apache.org/jira/browse/CB-4858) Convert relative URLs to absolute URLs in JS
|
||||
* [CB-3747](https://issues.apache.org/jira/browse/CB-3747) Fix back button having different dismiss logic from the close button.
|
||||
* [CB-5021](https://issues.apache.org/jira/browse/CB-5021) Expose closeDialog() as a public function and make it safe to call multiple times.
|
||||
* [CB-5021](https://issues.apache.org/jira/browse/CB-5021) Make it safe to call close() multiple times
|
||||
|
||||
### 0.2.3 (Oct 9, 2013)
|
||||
* [CB-4915](https://issues.apache.org/jira/browse/CB-4915) Incremented plugin version on dev branch.
|
||||
* [CB-4926](https://issues.apache.org/jira/browse/CB-4926) Fixes inappbrowser plugin loading for windows8
|
||||
|
||||
### 0.2.2 (Sept 25, 2013)
|
||||
* [CB-4889](https://issues.apache.org/jira/browse/CB-4889) bumping&resetting version
|
||||
* [CB-4788](https://issues.apache.org/jira/browse/CB-4788): Modified the onJsPrompt to warn against Cordova calls
|
||||
* [windows8] commandProxy was moved
|
||||
* [CB-4788](https://issues.apache.org/jira/browse/CB-4788): Modified the onJsPrompt to warn against Cordova calls
|
||||
* [windows8] commandProxy was moved
|
||||
* [CB-4889](https://issues.apache.org/jira/browse/CB-4889) renaming core references
|
||||
* [CB-4889](https://issues.apache.org/jira/browse/CB-4889) renaming org.apache.cordova.core.inappbrowser to org.apache.cordova.inappbrowser
|
||||
* [CB-4864](https://issues.apache.org/jira/browse/CB-4864), [CB-4865](https://issues.apache.org/jira/browse/CB-4865): Minor improvements to InAppBrowser
|
||||
* Rename CHANGELOG.md -> RELEASENOTES.md
|
||||
* [CB-4792](https://issues.apache.org/jira/browse/CB-4792) Added keepCallback to the show function.
|
||||
* [CB-4752](https://issues.apache.org/jira/browse/CB-4752) Incremented plugin version on dev branch.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "cordova-plugin-inappbrowser",
|
||||
"version": "1.0.1",
|
||||
"version": "1.1.1",
|
||||
"description": "Cordova InAppBrowser Plugin",
|
||||
"cordova": {
|
||||
"id": "cordova-plugin-inappbrowser",
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
|
||||
<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0"
|
||||
id="cordova-plugin-inappbrowser"
|
||||
version="1.0.1">
|
||||
version="1.1.1">
|
||||
|
||||
<name>InAppBrowser</name>
|
||||
<description>Cordova InAppBrowser Plugin</description>
|
||||
|
||||
@@ -41,6 +41,7 @@ import android.view.WindowManager.LayoutParams;
|
||||
import android.view.inputmethod.EditorInfo;
|
||||
import android.view.inputmethod.InputMethodManager;
|
||||
import android.webkit.CookieManager;
|
||||
import android.webkit.HttpAuthHandler;
|
||||
import android.webkit.WebSettings;
|
||||
import android.webkit.WebView;
|
||||
import android.webkit.WebViewClient;
|
||||
@@ -52,6 +53,7 @@ import android.widget.RelativeLayout;
|
||||
import org.apache.cordova.CallbackContext;
|
||||
import org.apache.cordova.Config;
|
||||
import org.apache.cordova.CordovaArgs;
|
||||
import org.apache.cordova.CordovaHttpAuthHandler;
|
||||
import org.apache.cordova.CordovaPlugin;
|
||||
import org.apache.cordova.CordovaWebView;
|
||||
import org.apache.cordova.LOG;
|
||||
@@ -61,6 +63,7 @@ import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.HashMap;
|
||||
import java.util.StringTokenizer;
|
||||
@@ -72,7 +75,6 @@ public class InAppBrowser extends CordovaPlugin {
|
||||
protected static final String LOG_TAG = "InAppBrowser";
|
||||
private static final String SELF = "_self";
|
||||
private static final String SYSTEM = "_system";
|
||||
// private static final String BLANK = "_blank";
|
||||
private static final String EXIT_EVENT = "exit";
|
||||
private static final String LOCATION = "location";
|
||||
private static final String ZOOM = "zoom";
|
||||
@@ -91,17 +93,17 @@ public class InAppBrowser extends CordovaPlugin {
|
||||
private boolean showLocationBar = true;
|
||||
private boolean showZoomControls = true;
|
||||
private boolean openWindowHidden = false;
|
||||
private boolean clearAllCache= false;
|
||||
private boolean clearSessionCache=false;
|
||||
private boolean hadwareBackButton=true;
|
||||
private boolean clearAllCache = false;
|
||||
private boolean clearSessionCache = false;
|
||||
private boolean hadwareBackButton = true;
|
||||
|
||||
/**
|
||||
* Executes the request and returns PluginResult.
|
||||
*
|
||||
* @param action The action to execute.
|
||||
* @param args JSONArry of arguments for the plugin.
|
||||
* @param callbackId The callback id used when calling back into JavaScript.
|
||||
* @return A PluginResult object with a status and message.
|
||||
* @param action the action to execute.
|
||||
* @param args JSONArry of arguments for the plugin.
|
||||
* @param callbackContext the callbackContext used when calling back into JavaScript.
|
||||
* @return A PluginResult object with a status and message.
|
||||
*/
|
||||
public boolean execute(String action, CordovaArgs args, final CallbackContext callbackContext) throws JSONException {
|
||||
if (action.equals("open")) {
|
||||
@@ -113,9 +115,9 @@ public class InAppBrowser extends CordovaPlugin {
|
||||
}
|
||||
final String target = t;
|
||||
final HashMap<String, Boolean> features = parseFeature(args.optString(2));
|
||||
|
||||
|
||||
Log.d(LOG_TAG, "target = " + target);
|
||||
|
||||
|
||||
this.cordova.getActivity().runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
@@ -185,7 +187,7 @@ public class InAppBrowser extends CordovaPlugin {
|
||||
Log.d(LOG_TAG, "in blank");
|
||||
result = showWebPage(url, features);
|
||||
}
|
||||
|
||||
|
||||
PluginResult pluginResult = new PluginResult(PluginResult.Status.OK, result);
|
||||
pluginResult.setKeepCallback(true);
|
||||
callbackContext.sendPluginResult(pluginResult);
|
||||
@@ -251,9 +253,9 @@ public class InAppBrowser extends CordovaPlugin {
|
||||
*/
|
||||
@Override
|
||||
public void onReset() {
|
||||
closeDialog();
|
||||
closeDialog();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Called by AccelBroker when listener is to be shut down.
|
||||
* Stop listener.
|
||||
@@ -261,7 +263,7 @@ public class InAppBrowser extends CordovaPlugin {
|
||||
public void onDestroy() {
|
||||
closeDialog();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Inject an object (script or style) into the InAppBrowser WebView.
|
||||
*
|
||||
@@ -306,7 +308,7 @@ public class InAppBrowser extends CordovaPlugin {
|
||||
|
||||
/**
|
||||
* Put the list of features into a hash map
|
||||
*
|
||||
*
|
||||
* @param optString
|
||||
* @return
|
||||
*/
|
||||
@@ -332,9 +334,8 @@ public class InAppBrowser extends CordovaPlugin {
|
||||
/**
|
||||
* Display a new browser with the specified URL.
|
||||
*
|
||||
* @param url The url to load.
|
||||
* @param usePhoneGap Load url in PhoneGap webview
|
||||
* @return "" if ok, or error message.
|
||||
* @param url the url to load.
|
||||
* @return "" if ok, or error message.
|
||||
*/
|
||||
public String openExternal(String url) {
|
||||
try {
|
||||
@@ -348,7 +349,7 @@ public class InAppBrowser extends CordovaPlugin {
|
||||
} else {
|
||||
intent.setData(uri);
|
||||
}
|
||||
intent.putExtra(Browser.EXTRA_APPLICATION_ID, cordova.getActivity().getPackageName());
|
||||
intent.putExtra(Browser.EXTRA_APPLICATION_ID, cordova.getActivity().getPackageName());
|
||||
this.cordova.getActivity().startActivity(intent);
|
||||
return "";
|
||||
} catch (android.content.ActivityNotFoundException e) {
|
||||
@@ -373,12 +374,12 @@ public class InAppBrowser extends CordovaPlugin {
|
||||
childView.setWebViewClient(new WebViewClient() {
|
||||
// NB: wait for about:blank before dismissing
|
||||
public void onPageFinished(WebView view, String url) {
|
||||
if (dialog != null) {
|
||||
dialog.dismiss();
|
||||
}
|
||||
}
|
||||
});
|
||||
// NB: From SDK 19: "If you call methods on WebView from any thread
|
||||
if (dialog != null) {
|
||||
dialog.dismiss();
|
||||
}
|
||||
}
|
||||
});
|
||||
// NB: From SDK 19: "If you call methods on WebView from any thread
|
||||
// other than your app's UI thread, it can cause unexpected results."
|
||||
// http://developer.android.com/guide/webapps/migrating.html#Threads
|
||||
childView.loadUrl("about:blank");
|
||||
@@ -455,15 +456,6 @@ public class InAppBrowser extends CordovaPlugin {
|
||||
return this.showLocationBar;
|
||||
}
|
||||
|
||||
/**
|
||||
* Should we show the zoom controls?
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
private boolean getShowZoomControls() {
|
||||
return this.showZoomControls;
|
||||
}
|
||||
|
||||
private InAppBrowser getInAppBrowser(){
|
||||
return this;
|
||||
}
|
||||
@@ -471,8 +463,8 @@ public class InAppBrowser extends CordovaPlugin {
|
||||
/**
|
||||
* Display a new browser with the specified URL.
|
||||
*
|
||||
* @param url The url to load.
|
||||
* @param jsonObject
|
||||
* @param url the url to load.
|
||||
* @param features jsonObject
|
||||
*/
|
||||
public String showWebPage(final String url, HashMap<String, Boolean> features) {
|
||||
// Determine if we should hide the location bar.
|
||||
@@ -487,7 +479,7 @@ public class InAppBrowser extends CordovaPlugin {
|
||||
Boolean zoom = features.get(ZOOM);
|
||||
if (zoom != null) {
|
||||
showZoomControls = zoom.booleanValue();
|
||||
}
|
||||
}
|
||||
Boolean hidden = features.get(HIDDEN);
|
||||
if (hidden != null) {
|
||||
openWindowHidden = hidden.booleanValue();
|
||||
@@ -506,7 +498,7 @@ public class InAppBrowser extends CordovaPlugin {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
final CordovaWebView thatWebView = this.webView;
|
||||
|
||||
// Create dialog in new thread
|
||||
@@ -540,7 +532,7 @@ public class InAppBrowser extends CordovaPlugin {
|
||||
|
||||
// Toolbar layout
|
||||
RelativeLayout toolbar = new RelativeLayout(cordova.getActivity());
|
||||
//Please, no more black!
|
||||
//Please, no more black!
|
||||
toolbar.setBackgroundColor(android.graphics.Color.LTGRAY);
|
||||
toolbar.setLayoutParams(new RelativeLayout.LayoutParams(LayoutParams.MATCH_PARENT, this.dpToPixels(44)));
|
||||
toolbar.setPadding(this.dpToPixels(2), this.dpToPixels(2), this.dpToPixels(2), this.dpToPixels(2));
|
||||
@@ -656,7 +648,7 @@ public class InAppBrowser extends CordovaPlugin {
|
||||
WebSettings settings = inAppWebView.getSettings();
|
||||
settings.setJavaScriptEnabled(true);
|
||||
settings.setJavaScriptCanOpenWindowsAutomatically(true);
|
||||
settings.setBuiltInZoomControls(getShowZoomControls());
|
||||
settings.setBuiltInZoomControls(showZoomControls);
|
||||
settings.setPluginState(android.webkit.WebSettings.PluginState.ON);
|
||||
|
||||
//Toggle whether this is enabled or not!
|
||||
@@ -733,7 +725,7 @@ public class InAppBrowser extends CordovaPlugin {
|
||||
*
|
||||
* @param obj a JSONObject contain event payload information
|
||||
* @param status the status code to return to the JavaScript environment
|
||||
*/
|
||||
*/
|
||||
private void sendUpdate(JSONObject obj, boolean keepCallback, PluginResult.Status status) {
|
||||
if (callbackContext != null) {
|
||||
PluginResult result = new PluginResult(status, obj);
|
||||
@@ -744,7 +736,7 @@ public class InAppBrowser extends CordovaPlugin {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* The webview client receives notifications about appView
|
||||
*/
|
||||
@@ -755,8 +747,8 @@ public class InAppBrowser extends CordovaPlugin {
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param mContext
|
||||
* @param edittext
|
||||
* @param webView
|
||||
* @param mEditText
|
||||
*/
|
||||
public InAppBrowserClient(CordovaWebView webView, EditText mEditText) {
|
||||
this.webView = webView;
|
||||
@@ -775,7 +767,7 @@ public class InAppBrowser extends CordovaPlugin {
|
||||
String newloc = "";
|
||||
if (url.startsWith("http:") || url.startsWith("https:") || url.startsWith("file:")) {
|
||||
newloc = url;
|
||||
}
|
||||
}
|
||||
// If dialing phone (tel:5551212)
|
||||
else if (url.startsWith(WebView.SCHEME_TEL)) {
|
||||
try {
|
||||
@@ -839,41 +831,75 @@ public class InAppBrowser extends CordovaPlugin {
|
||||
JSONObject obj = new JSONObject();
|
||||
obj.put("type", LOAD_START_EVENT);
|
||||
obj.put("url", newloc);
|
||||
|
||||
|
||||
sendUpdate(obj, true);
|
||||
} catch (JSONException ex) {
|
||||
Log.d(LOG_TAG, "Should never happen");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void onPageFinished(WebView view, String url) {
|
||||
super.onPageFinished(view, url);
|
||||
|
||||
|
||||
try {
|
||||
JSONObject obj = new JSONObject();
|
||||
obj.put("type", LOAD_STOP_EVENT);
|
||||
obj.put("url", url);
|
||||
|
||||
|
||||
sendUpdate(obj, true);
|
||||
} catch (JSONException ex) {
|
||||
Log.d(LOG_TAG, "Should never happen");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) {
|
||||
super.onReceivedError(view, errorCode, description, failingUrl);
|
||||
|
||||
|
||||
try {
|
||||
JSONObject obj = new JSONObject();
|
||||
obj.put("type", LOAD_ERROR_EVENT);
|
||||
obj.put("url", failingUrl);
|
||||
obj.put("code", errorCode);
|
||||
obj.put("message", description);
|
||||
|
||||
|
||||
sendUpdate(obj, true, PluginResult.Status.ERROR);
|
||||
} catch (JSONException ex) {
|
||||
Log.d(LOG_TAG, "Should never happen");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* On received http auth request.
|
||||
*/
|
||||
@Override
|
||||
public void onReceivedHttpAuthRequest(WebView view, HttpAuthHandler handler, String host, String realm) {
|
||||
|
||||
// Check if there is some plugin which can resolve this auth challenge
|
||||
PluginManager pluginManager = null;
|
||||
try {
|
||||
Method gpm = webView.getClass().getMethod("getPluginManager");
|
||||
pluginManager = (PluginManager)gpm.invoke(webView);
|
||||
} catch (NoSuchMethodException e) {
|
||||
} catch (IllegalAccessException e) {
|
||||
} catch (InvocationTargetException e) {
|
||||
}
|
||||
|
||||
if (pluginManager == null) {
|
||||
try {
|
||||
Field pmf = webView.getClass().getField("pluginManager");
|
||||
pluginManager = (PluginManager)pmf.get(webView);
|
||||
} catch (NoSuchFieldException e) {
|
||||
} catch (IllegalAccessException e) {
|
||||
}
|
||||
}
|
||||
|
||||
if (pluginManager != null && pluginManager.onReceivedHttpAuthRequest(webView, new CordovaHttpAuthHandler(handler), host, realm)) {
|
||||
return;
|
||||
}
|
||||
|
||||
// By default handle 401 like we'd normally do!
|
||||
super.onReceivedHttpAuthRequest(view, handler, host, realm);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -30,7 +30,6 @@
|
||||
@class CDVInAppBrowserViewController;
|
||||
|
||||
@interface CDVInAppBrowser : CDVPlugin {
|
||||
BOOL _injectedIframeBridge;
|
||||
}
|
||||
|
||||
@property (nonatomic, retain) CDVInAppBrowserViewController* inAppBrowserViewController;
|
||||
|
||||
@@ -214,30 +214,36 @@
|
||||
|
||||
_previousStatusBarStyle = [UIApplication sharedApplication].statusBarStyle;
|
||||
|
||||
CDVInAppBrowserNavigationController* nav = [[CDVInAppBrowserNavigationController alloc]
|
||||
__block CDVInAppBrowserNavigationController* nav = [[CDVInAppBrowserNavigationController alloc]
|
||||
initWithRootViewController:self.inAppBrowserViewController];
|
||||
nav.orientationDelegate = self.inAppBrowserViewController;
|
||||
nav.navigationBarHidden = YES;
|
||||
|
||||
__weak CDVInAppBrowser* weakSelf = self;
|
||||
|
||||
// Run later to avoid the "took a long time" log message.
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
if (self.inAppBrowserViewController != nil) {
|
||||
[self.viewController presentViewController:nav animated:YES completion:nil];
|
||||
if (weakSelf.inAppBrowserViewController != nil) {
|
||||
[weakSelf.viewController presentViewController:nav animated:YES completion:nil];
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
- (void)openInCordovaWebView:(NSURL*)url withOptions:(NSString*)options
|
||||
{
|
||||
if ([self.commandDelegate URLIsWhitelisted:url]) {
|
||||
NSURLRequest* request = [NSURLRequest requestWithURL:url];
|
||||
NSURLRequest* request = [NSURLRequest requestWithURL:url];
|
||||
|
||||
#ifdef __CORDOVA_4_0_0
|
||||
[self.webViewEngine loadRequest:request];
|
||||
// the webview engine itself will filter for this according to <allow-navigation> policy
|
||||
// in config.xml for cordova-ios-4.0
|
||||
[self.webViewEngine loadRequest:request];
|
||||
#else
|
||||
if ([self.commandDelegate URLIsWhitelisted:url]) {
|
||||
[self.webView loadRequest:request];
|
||||
#endif
|
||||
} else { // this assumes the InAppBrowser can be excepted from the white-list
|
||||
[self openInInAppBrowser:url withOptions:options];
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
- (void)openInSystem:(NSURL*)url
|
||||
@@ -260,11 +266,8 @@
|
||||
|
||||
- (void)injectDeferredObject:(NSString*)source withWrapper:(NSString*)jsWrapper
|
||||
{
|
||||
if (!_injectedIframeBridge) {
|
||||
_injectedIframeBridge = YES;
|
||||
// Create an iframe bridge in the new document to communicate with the CDVInAppBrowserViewController
|
||||
[self.inAppBrowserViewController.webView stringByEvaluatingJavaScriptFromString:@"(function(d){var e = _cdvIframeBridge = d.createElement('iframe');e.style.display='none';d.body.appendChild(e);})(document)"];
|
||||
}
|
||||
// Ensure an iframe bridge is created to communicate with the CDVInAppBrowserViewController
|
||||
[self.inAppBrowserViewController.webView stringByEvaluatingJavaScriptFromString:@"(function(d){_cdvIframeBridge=d.getElementById('_cdvIframeBridge');if(!_cdvIframeBridge) {var e = _cdvIframeBridge = d.createElement('iframe');e.id='_cdvIframeBridge'; e.style.display='none';d.body.appendChild(e);}})(document)"];
|
||||
|
||||
if (jsWrapper != nil) {
|
||||
NSData* jsonData = [NSJSONSerialization dataWithJSONObject:@[source] options:0 error:nil];
|
||||
@@ -401,7 +404,6 @@
|
||||
|
||||
- (void)webViewDidStartLoad:(UIWebView*)theWebView
|
||||
{
|
||||
_injectedIframeBridge = NO;
|
||||
}
|
||||
|
||||
- (void)webViewDidFinishLoad:(UIWebView*)theWebView
|
||||
@@ -444,7 +446,9 @@
|
||||
self.inAppBrowserViewController = nil;
|
||||
|
||||
if (IsAtLeastiOSVersion(@"7.0")) {
|
||||
[[UIApplication sharedApplication] setStatusBarStyle:_previousStatusBarStyle];
|
||||
if (_previousStatusBarStyle != -1) {
|
||||
[[UIApplication sharedApplication] setStatusBarStyle:_previousStatusBarStyle];
|
||||
}
|
||||
}
|
||||
|
||||
_previousStatusBarStyle = -1; // this value was reset before reapplying it. caused statusbar to stay black on ios7
|
||||
@@ -477,6 +481,11 @@
|
||||
return self;
|
||||
}
|
||||
|
||||
// Prevent crashes on closing windows
|
||||
-(void)dealloc {
|
||||
self.webView.delegate = nil;
|
||||
}
|
||||
|
||||
- (void)createViews
|
||||
{
|
||||
// We create the views in code for primarily for ease of upgrades and not requiring an external .xib to be included
|
||||
@@ -502,15 +511,15 @@
|
||||
self.webView.scalesPageToFit = NO;
|
||||
self.webView.userInteractionEnabled = YES;
|
||||
|
||||
self.spinner = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhite];
|
||||
self.spinner = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleGray];
|
||||
self.spinner.alpha = 1.000;
|
||||
self.spinner.autoresizesSubviews = YES;
|
||||
self.spinner.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleTopMargin;
|
||||
self.spinner.autoresizingMask = (UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleTopMargin | UIViewAutoresizingFlexibleBottomMargin | UIViewAutoresizingFlexibleRightMargin);
|
||||
self.spinner.clearsContextBeforeDrawing = NO;
|
||||
self.spinner.clipsToBounds = NO;
|
||||
self.spinner.contentMode = UIViewContentModeScaleToFill;
|
||||
self.spinner.frame = CGRectMake(454.0, 231.0, 20.0, 20.0);
|
||||
self.spinner.hidden = YES;
|
||||
self.spinner.frame = CGRectMake(CGRectGetMidX(self.webView.frame), CGRectGetMidY(self.webView.frame), 20.0, 20.0);
|
||||
self.spinner.hidden = NO;
|
||||
self.spinner.hidesWhenStopped = YES;
|
||||
self.spinner.multipleTouchEnabled = NO;
|
||||
self.spinner.opaque = NO;
|
||||
@@ -748,12 +757,14 @@
|
||||
[self.navigationDelegate browserExit];
|
||||
}
|
||||
|
||||
__weak UIViewController* weakSelf = self;
|
||||
|
||||
// Run later to avoid the "took a long time" log message.
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
if ([self respondsToSelector:@selector(presentingViewController)]) {
|
||||
[[self presentingViewController] dismissViewControllerAnimated:YES completion:nil];
|
||||
if ([weakSelf respondsToSelector:@selector(presentingViewController)]) {
|
||||
[[weakSelf presentingViewController] dismissViewControllerAnimated:YES completion:nil];
|
||||
} else {
|
||||
[[self parentViewController] dismissViewControllerAnimated:YES completion:nil];
|
||||
[[weakSelf parentViewController] dismissViewControllerAnimated:YES completion:nil];
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -765,10 +776,11 @@
|
||||
if (_userAgentLockToken != 0) {
|
||||
[self.webView loadRequest:request];
|
||||
} else {
|
||||
__weak CDVInAppBrowserViewController* weakSelf = self;
|
||||
[CDVUserAgentUtil acquireLock:^(NSInteger lockToken) {
|
||||
_userAgentLockToken = lockToken;
|
||||
[CDVUserAgentUtil setUserAgent:_userAgent lockToken:lockToken];
|
||||
[self.webView loadRequest:request];
|
||||
[weakSelf.webView loadRequest:request];
|
||||
}];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
@@ -247,7 +247,8 @@ var IAB = {
|
||||
if (isWebViewAvailable && browserWrap && popup) {
|
||||
var op = popup.invokeScriptAsync("eval", code);
|
||||
op.oncomplete = function (e) {
|
||||
var result = [e.target.result];
|
||||
// return null if event target is unavailable by some reason
|
||||
var result = (e && e.target) ? [e.target.result] : [null];
|
||||
hasCallback && win(result);
|
||||
};
|
||||
op.onerror = function () { };
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
|
||||
<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0"
|
||||
id="cordova-plugin-inappbrowser-tests"
|
||||
version="1.0.1">
|
||||
version="1.1.1">
|
||||
<name>Cordova InAppBrowser Plugin Tests</name>
|
||||
<license>Apache 2.0</license>
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
@@ -20,7 +20,6 @@
|
||||
.inAppBrowserWrap {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
border: 0;
|
||||
outline: 0;
|
||||
font-size: 100%;
|
||||
vertical-align: baseline;
|
||||
@@ -28,15 +27,14 @@
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: calc(100% - 80px);
|
||||
height: calc(100% - 80px);
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
z-index: 9999999;
|
||||
box-sizing: border-box;
|
||||
border: 40px solid #bfbfbf;
|
||||
border: 40px solid rgba(0, 0, 0, 0.25);
|
||||
}
|
||||
|
||||
.inAppBrowserWrapFullscreen {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border: 0;
|
||||
}
|
||||
|
||||
@@ -19,6 +19,12 @@
|
||||
*
|
||||
*/
|
||||
|
||||
// special patch to correctly work on Ripple emulator (CB-9760)
|
||||
if (window.parent && !!window.parent.ripple) { // https://gist.github.com/triceam/4658021
|
||||
module.exports = window.open.bind(window); // fallback to default window.open behaviour
|
||||
return;
|
||||
}
|
||||
|
||||
var exec = require('cordova/exec');
|
||||
var channel = require('cordova/channel');
|
||||
var modulemapper = require('cordova/modulemapper');
|
||||
|
||||
@@ -17,13 +17,12 @@
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
*/
|
||||
*/
|
||||
|
||||
/*jslint sloppy:true */
|
||||
/*global Windows:true, require, document, setTimeout, window, module */
|
||||
|
||||
|
||||
|
||||
var cordova = require('cordova'),
|
||||
channel = require('cordova/channel');
|
||||
|
||||
@@ -39,9 +38,9 @@ var IAB = {
|
||||
},
|
||||
show: function (win, lose) {
|
||||
/* empty block, ran out of bacon?
|
||||
if (browserWrap) {
|
||||
if (browserWrap) {
|
||||
|
||||
}*/
|
||||
}*/
|
||||
},
|
||||
open: function (win, lose, args) {
|
||||
var strUrl = args[0],
|
||||
@@ -62,6 +61,7 @@ var IAB = {
|
||||
browserWrap.style.borderWidth = "40px";
|
||||
browserWrap.style.borderStyle = "solid";
|
||||
browserWrap.style.borderColor = "rgba(0,0,0,0.25)";
|
||||
browserWrap.style.zIndex = "9999999";
|
||||
|
||||
browserWrap.onclick = function () {
|
||||
setTimeout(function () {
|
||||
@@ -71,20 +71,38 @@ var IAB = {
|
||||
|
||||
document.body.appendChild(browserWrap);
|
||||
}
|
||||
var localFile = (strUrl.indexOf('ms-appdata:///') > -1);
|
||||
if (localFile) {
|
||||
elem = document.createElement("x-ms-webview");
|
||||
elem.style.width = (window.innerWidth - 80) + "px";
|
||||
elem.style.height = (window.innerHeight - 80) + "px";
|
||||
elem.style.borderWidth = "0px";
|
||||
elem.name = "targetFrame";
|
||||
elem.src = strUrl;
|
||||
|
||||
elem = document.createElement("iframe");
|
||||
elem.style.width = (window.innerWidth - 80) + "px";
|
||||
elem.style.height = (window.innerHeight - 80) + "px";
|
||||
elem.style.borderWidth = "0px";
|
||||
elem.name = "targetFrame";
|
||||
elem.src = strUrl;
|
||||
window.addEventListener("resize", function () {
|
||||
if (browserWrap && elem) {
|
||||
elem.style.width = (window.innerWidth - 80) + "px";
|
||||
elem.style.height = (window.innerHeight - 80) + "px";
|
||||
}
|
||||
});
|
||||
|
||||
window.addEventListener("resize", function () {
|
||||
if (browserWrap && elem) {
|
||||
elem.style.width = (window.innerWidth - 80) + "px";
|
||||
elem.style.height = (window.innerHeight - 80) + "px";
|
||||
}
|
||||
});
|
||||
} else {
|
||||
elem = document.createElement("iframe");
|
||||
elem.style.width = (window.innerWidth - 80) + "px";
|
||||
elem.style.height = (window.innerHeight - 80) + "px";
|
||||
elem.style.borderWidth = "0px";
|
||||
elem.name = "targetFrame";
|
||||
elem.src = strUrl;
|
||||
|
||||
|
||||
window.addEventListener("resize", function () {
|
||||
if (browserWrap && elem) {
|
||||
elem.style.width = (window.innerWidth - 80) + "px";
|
||||
elem.style.height = (window.innerHeight - 80) + "px";
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
browserWrap.appendChild(elem);
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user