Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| c8cd3f6575 | |||
| afac0acb9c | |||
| accc23bcae |
@@ -21,9 +21,9 @@ description: Open an in-app browser window.
|
|||||||
# under the License.
|
# under the License.
|
||||||
-->
|
-->
|
||||||
|
|
||||||
|Android 4.4|Android 5.1|iOS 9.3|iOS 10.0|Windows 10 Store|Travis CI|
|
|Android 4.4|Android 5.1|iOS|Windows 10 Store|Travis CI|
|
||||||
|:-:|:-:|:-:|:-:|:-:|:-:|
|
|:-:|:-:|:-:|:-:|:-:|
|
||||||
|[](http://cordova-ci.cloudapp.net:8080/job/cordova-periodic-build/PLATFORM=android-4.4,PLUGIN=cordova-plugin-inappbrowser/)|[](http://cordova-ci.cloudapp.net:8080/job/cordova-periodic-build/PLATFORM=android-5.1,PLUGIN=cordova-plugin-inappbrowser/)|[](http://cordova-ci.cloudapp.net:8080/job/cordova-periodic-build/PLATFORM=ios-9.3,PLUGIN=cordova-plugin-inappbrowser/)|[](http://cordova-ci.cloudapp.net:8080/job/cordova-periodic-build/PLATFORM=ios-10.0,PLUGIN=cordova-plugin-inappbrowser/)|[](http://cordova-ci.cloudapp.net:8080/job/cordova-periodic-build/PLATFORM=windows-10-store,PLUGIN=cordova-plugin-inappbrowser/)|[](https://travis-ci.org/apache/cordova-plugin-inappbrowser)|
|
|[](http://cordova-ci.cloudapp.net:8080/job/cordova-periodic-build/PLATFORM=android-4.4,PLUGIN=cordova-plugin-inappbrowser/)|[](http://cordova-ci.cloudapp.net:8080/job/cordova-periodic-build/PLATFORM=android-5.1,PLUGIN=cordova-plugin-inappbrowser/)|[](http://cordova-ci.cloudapp.net:8080/job/cordova-periodic-build/PLATFORM=ios,PLUGIN=cordova-plugin-inappbrowser/)|[](http://cordova-ci.cloudapp.net:8080/job/cordova-periodic-build/PLATFORM=windows-10-store,PLUGIN=cordova-plugin-inappbrowser/)|[](https://travis-ci.org/apache/cordova-plugin-inappbrowser)|
|
||||||
|
|
||||||
# cordova-plugin-inappbrowser
|
# cordova-plugin-inappbrowser
|
||||||
|
|
||||||
|
|||||||
@@ -20,16 +20,6 @@
|
|||||||
-->
|
-->
|
||||||
# Release Notes
|
# Release Notes
|
||||||
|
|
||||||
### 1.7.0 (Feb 28, 2017)
|
|
||||||
* [CB-12366](https://issues.apache.org/jira/browse/CB-12366) **iOS:** Reduce `tmpWindow` level to prevent overlapping statusbar
|
|
||||||
* [CB-12364](https://issues.apache.org/jira/browse/CB-12364) **Windows:** `Inappbrowser` inject file manual tests are not working
|
|
||||||
* [CB-12353](https://issues.apache.org/jira/browse/CB-12353) Corrected merges usage in `plugin.xml`
|
|
||||||
* [CB-12369](https://issues.apache.org/jira/browse/CB-12369) Add plugin typings from `DefinitelyTyped`
|
|
||||||
* [CB-12363](https://issues.apache.org/jira/browse/CB-12363) Added build badges for **iOS 9.3** and **iOS 10.0**
|
|
||||||
* [CB-9148](https://issues.apache.org/jira/browse/CB-9148) **Android:** Add Support for `input[type=file]` File Chooser
|
|
||||||
* [CB-11136](https://issues.apache.org/jira/browse/CB-11136) (ios) Fix `InAppBrowser` when closing with `WKWebView`
|
|
||||||
* [CB-10799](https://issues.apache.org/jira/browse/CB-10799) **iOS:** fix toolbar is shown in incorrect position when in-call status bar
|
|
||||||
|
|
||||||
### 1.6.1 (Dec 14, 2016)
|
### 1.6.1 (Dec 14, 2016)
|
||||||
* [CB-12237](https://issues.apache.org/jira/browse/CB-12237) - Update version in package.json to correct 1.6.1-dev
|
* [CB-12237](https://issues.apache.org/jira/browse/CB-12237) - Update version in package.json to correct 1.6.1-dev
|
||||||
* [CB-12236](https://issues.apache.org/jira/browse/CB-12236) - Fixed RELEASENOTES for cordova-plugin-inappbrowser
|
* [CB-12236](https://issues.apache.org/jira/browse/CB-12236) - Fixed RELEASENOTES for cordova-plugin-inappbrowser
|
||||||
|
|||||||
+1
-2
@@ -1,8 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "cordova-plugin-inappbrowser",
|
"name": "cordova-plugin-inappbrowser",
|
||||||
"version": "1.7.0",
|
"version": "1.6.1",
|
||||||
"description": "Cordova InAppBrowser Plugin",
|
"description": "Cordova InAppBrowser Plugin",
|
||||||
"types": "./types/index.d.ts",
|
|
||||||
"cordova": {
|
"cordova": {
|
||||||
"id": "cordova-plugin-inappbrowser",
|
"id": "cordova-plugin-inappbrowser",
|
||||||
"platforms": [
|
"platforms": [
|
||||||
|
|||||||
+15
-15
@@ -20,7 +20,7 @@
|
|||||||
|
|
||||||
<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0"
|
<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0"
|
||||||
id="cordova-plugin-inappbrowser"
|
id="cordova-plugin-inappbrowser"
|
||||||
version="1.7.0">
|
version="1.6.1">
|
||||||
|
|
||||||
<name>InAppBrowser</name>
|
<name>InAppBrowser</name>
|
||||||
<description>Cordova InAppBrowser Plugin</description>
|
<description>Cordova InAppBrowser Plugin</description>
|
||||||
@@ -40,7 +40,7 @@
|
|||||||
<clobbers target="window.open" />
|
<clobbers target="window.open" />
|
||||||
</js-module>
|
</js-module>
|
||||||
<config-file target="res/xml/config.xml" parent="/*">
|
<config-file target="res/xml/config.xml" parent="/*">
|
||||||
<feature name="InAppBrowser">
|
<feature name="InAppBrowser">
|
||||||
<param name="android-package" value="org.apache.cordova.inappbrowser.InAppBrowser"/>
|
<param name="android-package" value="org.apache.cordova.inappbrowser.InAppBrowser"/>
|
||||||
</feature>
|
</feature>
|
||||||
</config-file>
|
</config-file>
|
||||||
@@ -74,7 +74,7 @@
|
|||||||
<clobbers target="window.open" />
|
<clobbers target="window.open" />
|
||||||
</js-module>
|
</js-module>
|
||||||
<config-file target="res/xml/config.xml" parent="/*">
|
<config-file target="res/xml/config.xml" parent="/*">
|
||||||
<feature name="InAppBrowser">
|
<feature name="InAppBrowser">
|
||||||
<param name="android-package" value="org.apache.cordova.inappbrowser.InAppBrowser"/>
|
<param name="android-package" value="org.apache.cordova.inappbrowser.InAppBrowser"/>
|
||||||
</feature>
|
</feature>
|
||||||
</config-file>
|
</config-file>
|
||||||
@@ -82,24 +82,24 @@
|
|||||||
<source-file src="src/amazon/InAppBrowser.java" target-dir="src/org/apache/cordova/inappbrowser" />
|
<source-file src="src/amazon/InAppBrowser.java" target-dir="src/org/apache/cordova/inappbrowser" />
|
||||||
<source-file src="src/android/InAppBrowserDialog.java" target-dir="src/org/apache/cordova/inappbrowser" />
|
<source-file src="src/android/InAppBrowserDialog.java" target-dir="src/org/apache/cordova/inappbrowser" />
|
||||||
<source-file src="src/amazon/InAppChromeClient.java" target-dir="src/org/apache/cordova/inappbrowser" />
|
<source-file src="src/amazon/InAppChromeClient.java" target-dir="src/org/apache/cordova/inappbrowser" />
|
||||||
|
|
||||||
<!-- drawable src/android/resources -->
|
<!-- drawable src/android/resources -->
|
||||||
<resource-file src="src/android/res/drawable-hdpi/ic_action_next_item.png" target="res/drawable-hdpi/ic_action_next_item.png" />
|
<resource-file src="src/android/res/drawable-hdpi/ic_action_next_item.png" target="res/drawable-hdpi/ic_action_next_item.png" />
|
||||||
<resource-file src="src/android/res/drawable-mdpi/ic_action_next_item.png" target="res/drawable-mdpi/ic_action_next_item.png" />
|
<resource-file src="src/android/res/drawable-mdpi/ic_action_next_item.png" target="res/drawable-mdpi/ic_action_next_item.png" />
|
||||||
<resource-file src="src/android/res/drawable-xhdpi/ic_action_next_item.png" target="res/drawable-xhdpi/ic_action_next_item.png" />
|
<resource-file src="src/android/res/drawable-xhdpi/ic_action_next_item.png" target="res/drawable-xhdpi/ic_action_next_item.png" />
|
||||||
<resource-file src="src/android/res/drawable-xxhdpi/ic_action_next_item.png" target="res/drawable-xxhdpi/ic_action_next_item.png" />
|
<resource-file src="src/android/res/drawable-xxhdpi/ic_action_next_item.png" target="res/drawable-xxhdpi/ic_action_next_item.png" />
|
||||||
|
|
||||||
<resource-file src="src/android/res/drawable-hdpi/ic_action_previous_item.png" target="res/drawable-hdpi/ic_action_previous_item.png" />
|
<resource-file src="src/android/res/drawable-hdpi/ic_action_previous_item.png" target="res/drawable-hdpi/ic_action_previous_item.png" />
|
||||||
<resource-file src="src/android/res/drawable-mdpi/ic_action_previous_item.png" target="res/drawable-mdpi/ic_action_previous_item.png" />
|
<resource-file src="src/android/res/drawable-mdpi/ic_action_previous_item.png" target="res/drawable-mdpi/ic_action_previous_item.png" />
|
||||||
<resource-file src="src/android/res/drawable-xhdpi/ic_action_previous_item.png" target="res/drawable-xhdpi/ic_action_previous_item.png" />
|
<resource-file src="src/android/res/drawable-xhdpi/ic_action_previous_item.png" target="res/drawable-xhdpi/ic_action_previous_item.png" />
|
||||||
<resource-file src="src/android/res/drawable-xxhdpi/ic_action_previous_item.png" target="res/drawable-xxhdpi/ic_action_previous_item.png" />
|
<resource-file src="src/android/res/drawable-xxhdpi/ic_action_previous_item.png" target="res/drawable-xxhdpi/ic_action_previous_item.png" />
|
||||||
|
|
||||||
<resource-file src="src/android/res/drawable-hdpi/ic_action_remove.png" target="res/drawable-hdpi/ic_action_remove.png" />
|
<resource-file src="src/android/res/drawable-hdpi/ic_action_remove.png" target="res/drawable-hdpi/ic_action_remove.png" />
|
||||||
<resource-file src="src/android/res/drawable-mdpi/ic_action_remove.png" target="res/drawable-mdpi/ic_action_remove.png" />
|
<resource-file src="src/android/res/drawable-mdpi/ic_action_remove.png" target="res/drawable-mdpi/ic_action_remove.png" />
|
||||||
<resource-file src="src/android/res/drawable-xhdpi/ic_action_remove.png" target="res/drawable-xhdpi/ic_action_remove.png" />
|
<resource-file src="src/android/res/drawable-xhdpi/ic_action_remove.png" target="res/drawable-xhdpi/ic_action_remove.png" />
|
||||||
<resource-file src="src/android/res/drawable-xxhdpi/ic_action_remove.png" target="res/drawable-xxhdpi/ic_action_remove.png" />
|
<resource-file src="src/android/res/drawable-xxhdpi/ic_action_remove.png" target="res/drawable-xxhdpi/ic_action_remove.png" />
|
||||||
</platform>
|
</platform>
|
||||||
|
|
||||||
<!-- ubuntu -->
|
<!-- ubuntu -->
|
||||||
<platform name="ubuntu">
|
<platform name="ubuntu">
|
||||||
<js-module src="www/inappbrowser.js" name="inappbrowser">
|
<js-module src="www/inappbrowser.js" name="inappbrowser">
|
||||||
@@ -118,16 +118,16 @@
|
|||||||
<js-module src="www/inappbrowser.js" name="inappbrowser">
|
<js-module src="www/inappbrowser.js" name="inappbrowser">
|
||||||
<clobbers target="cordova.InAppBrowser.open" />
|
<clobbers target="cordova.InAppBrowser.open" />
|
||||||
<clobbers target="window.open" />
|
<clobbers target="window.open" />
|
||||||
</js-module>
|
</js-module>
|
||||||
<config-file target="config.xml" parent="/*">
|
<config-file target="config.xml" parent="/*">
|
||||||
<feature name="InAppBrowser">
|
<feature name="InAppBrowser">
|
||||||
<param name="ios-package" value="CDVInAppBrowser" />
|
<param name="ios-package" value="CDVInAppBrowser" />
|
||||||
</feature>
|
</feature>
|
||||||
</config-file>
|
</config-file>
|
||||||
|
|
||||||
<header-file src="src/ios/CDVInAppBrowser.h" />
|
<header-file src="src/ios/CDVInAppBrowser.h" />
|
||||||
<source-file src="src/ios/CDVInAppBrowser.m" />
|
<source-file src="src/ios/CDVInAppBrowser.m" />
|
||||||
|
|
||||||
<framework src="CoreGraphics.framework" />
|
<framework src="CoreGraphics.framework" />
|
||||||
</platform>
|
</platform>
|
||||||
|
|
||||||
@@ -175,7 +175,7 @@
|
|||||||
<config-file target="Properties/WMAppManifest.xml" parent="/Deployment/App/Capabilities">
|
<config-file target="Properties/WMAppManifest.xml" parent="/Deployment/App/Capabilities">
|
||||||
<Capability Name="ID_CAP_NETWORKING"/>
|
<Capability Name="ID_CAP_NETWORKING"/>
|
||||||
</config-file>
|
</config-file>
|
||||||
|
|
||||||
<js-module src="www/inappbrowser.js" name="inappbrowser">
|
<js-module src="www/inappbrowser.js" name="inappbrowser">
|
||||||
<clobbers target="cordova.InAppBrowser.open" />
|
<clobbers target="cordova.InAppBrowser.open" />
|
||||||
<clobbers target="window.open" />
|
<clobbers target="window.open" />
|
||||||
@@ -211,11 +211,11 @@
|
|||||||
<clobbers target="window.open" />
|
<clobbers target="window.open" />
|
||||||
</js-module>
|
</js-module>
|
||||||
<js-module src="src/windows/InAppBrowserProxy.js" name="InAppBrowserProxy">
|
<js-module src="src/windows/InAppBrowserProxy.js" name="InAppBrowserProxy">
|
||||||
<runs />
|
<merges target="" />
|
||||||
</js-module>
|
</js-module>
|
||||||
<asset src="www/inappbrowser.css" target="css/inappbrowser.css" />
|
<asset src="www/inappbrowser.css" target="css/inappbrowser.css" />
|
||||||
</platform>
|
</platform>
|
||||||
|
|
||||||
<!-- firefoxos -->
|
<!-- firefoxos -->
|
||||||
<platform name="firefoxos">
|
<platform name="firefoxos">
|
||||||
<config-file target="config.xml" parent="/*">
|
<config-file target="config.xml" parent="/*">
|
||||||
@@ -226,7 +226,7 @@
|
|||||||
<clobbers target="window.open" />
|
<clobbers target="window.open" />
|
||||||
</js-module>
|
</js-module>
|
||||||
<js-module src="src/firefoxos/InAppBrowserProxy.js" name="InAppBrowserProxy">
|
<js-module src="src/firefoxos/InAppBrowserProxy.js" name="InAppBrowserProxy">
|
||||||
<runs />
|
<merges target="" />
|
||||||
</js-module>
|
</js-module>
|
||||||
</platform>
|
</platform>
|
||||||
|
|
||||||
@@ -237,7 +237,7 @@
|
|||||||
<clobbers target="window.open" />
|
<clobbers target="window.open" />
|
||||||
</js-module>
|
</js-module>
|
||||||
<js-module src="src/browser/InAppBrowserProxy.js" name="InAppBrowserProxy">
|
<js-module src="src/browser/InAppBrowserProxy.js" name="InAppBrowserProxy">
|
||||||
<runs />
|
<merges target="" />
|
||||||
</js-module>
|
</js-module>
|
||||||
</platform>
|
</platform>
|
||||||
</plugin>
|
</plugin>
|
||||||
|
|||||||
@@ -41,8 +41,6 @@ import android.view.inputmethod.InputMethodManager;
|
|||||||
import android.webkit.CookieManager;
|
import android.webkit.CookieManager;
|
||||||
import android.webkit.CookieSyncManager;
|
import android.webkit.CookieSyncManager;
|
||||||
import android.webkit.HttpAuthHandler;
|
import android.webkit.HttpAuthHandler;
|
||||||
import android.webkit.ValueCallback;
|
|
||||||
import android.webkit.WebChromeClient;
|
|
||||||
import android.webkit.WebSettings;
|
import android.webkit.WebSettings;
|
||||||
import android.webkit.WebView;
|
import android.webkit.WebView;
|
||||||
import android.webkit.WebViewClient;
|
import android.webkit.WebViewClient;
|
||||||
@@ -105,10 +103,6 @@ public class InAppBrowser extends CordovaPlugin {
|
|||||||
private boolean mediaPlaybackRequiresUserGesture = false;
|
private boolean mediaPlaybackRequiresUserGesture = false;
|
||||||
private boolean shouldPauseInAppBrowser = false;
|
private boolean shouldPauseInAppBrowser = false;
|
||||||
private boolean useWideViewPort = true;
|
private boolean useWideViewPort = true;
|
||||||
private ValueCallback<Uri> mUploadCallback;
|
|
||||||
private ValueCallback<Uri[]> mUploadCallbackLollipop;
|
|
||||||
private final static int FILECHOOSER_REQUESTCODE = 1;
|
|
||||||
private final static int FILECHOOSER_REQUESTCODE_LOLLIPOP = 2;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Executes the request and returns PluginResult.
|
* Executes the request and returns PluginResult.
|
||||||
@@ -728,49 +722,7 @@ public class InAppBrowser extends CordovaPlugin {
|
|||||||
inAppWebView = new WebView(cordova.getActivity());
|
inAppWebView = new WebView(cordova.getActivity());
|
||||||
inAppWebView.setLayoutParams(new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT));
|
inAppWebView.setLayoutParams(new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT));
|
||||||
inAppWebView.setId(Integer.valueOf(6));
|
inAppWebView.setId(Integer.valueOf(6));
|
||||||
// File Chooser Implemented ChromeClient
|
inAppWebView.setWebChromeClient(new InAppChromeClient(thatWebView));
|
||||||
inAppWebView.setWebChromeClient(new InAppChromeClient(thatWebView) {
|
|
||||||
// For Android 5.0+
|
|
||||||
public boolean onShowFileChooser (WebView webView, ValueCallback<Uri[]> filePathCallback, WebChromeClient.FileChooserParams fileChooserParams)
|
|
||||||
{
|
|
||||||
LOG.d(LOG_TAG, "File Chooser 5.0+");
|
|
||||||
// If callback exists, finish it.
|
|
||||||
if(mUploadCallbackLollipop != null) {
|
|
||||||
mUploadCallbackLollipop.onReceiveValue(null);
|
|
||||||
}
|
|
||||||
mUploadCallbackLollipop = filePathCallback;
|
|
||||||
|
|
||||||
// Create File Chooser Intent
|
|
||||||
Intent content = new Intent(Intent.ACTION_GET_CONTENT);
|
|
||||||
content.addCategory(Intent.CATEGORY_OPENABLE);
|
|
||||||
content.setType("*/*");
|
|
||||||
|
|
||||||
// Run cordova startActivityForResult
|
|
||||||
cordova.startActivityForResult(InAppBrowser.this, Intent.createChooser(content, "Select File"), FILECHOOSER_REQUESTCODE_LOLLIPOP);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
// For Android 4.1+
|
|
||||||
public void openFileChooser(ValueCallback<Uri> uploadMsg, String acceptType, String capture)
|
|
||||||
{
|
|
||||||
LOG.d(LOG_TAG, "File Chooser 4.1+");
|
|
||||||
// Call file chooser for Android 3.0+
|
|
||||||
openFileChooser(uploadMsg, acceptType);
|
|
||||||
}
|
|
||||||
|
|
||||||
// For Android 3.0+
|
|
||||||
public void openFileChooser(ValueCallback<Uri> uploadMsg, String acceptType)
|
|
||||||
{
|
|
||||||
LOG.d(LOG_TAG, "File Chooser 3.0+");
|
|
||||||
mUploadCallback = uploadMsg;
|
|
||||||
Intent content = new Intent(Intent.ACTION_GET_CONTENT);
|
|
||||||
content.addCategory(Intent.CATEGORY_OPENABLE);
|
|
||||||
|
|
||||||
// run startActivityForResult
|
|
||||||
cordova.startActivityForResult(InAppBrowser.this, Intent.createChooser(content, "Select File"), FILECHOOSER_REQUESTCODE);
|
|
||||||
}
|
|
||||||
|
|
||||||
});
|
|
||||||
WebViewClient client = new InAppBrowserClient(thatWebView, edittext);
|
WebViewClient client = new InAppBrowserClient(thatWebView, edittext);
|
||||||
inAppWebView.setWebViewClient(client);
|
inAppWebView.setWebViewClient(client);
|
||||||
WebSettings settings = inAppWebView.getSettings();
|
WebSettings settings = inAppWebView.getSettings();
|
||||||
@@ -879,42 +831,6 @@ public class InAppBrowser extends CordovaPlugin {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Receive File Data from File Chooser
|
|
||||||
*
|
|
||||||
* @param requestCode the requested code from chromeclient
|
|
||||||
* @param resultCode the result code returned from android system
|
|
||||||
* @param intent the data from android file chooser
|
|
||||||
*/
|
|
||||||
public void onActivityResult(int requestCode, int resultCode, Intent intent) {
|
|
||||||
// For Android >= 5.0
|
|
||||||
if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
|
||||||
LOG.d(LOG_TAG, "onActivityResult (For Android >= 5.0)");
|
|
||||||
// If RequestCode or Callback is Invalid
|
|
||||||
if(requestCode != FILECHOOSER_REQUESTCODE_LOLLIPOP || mUploadCallbackLollipop == null) {
|
|
||||||
super.onActivityResult(requestCode, resultCode, intent);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
mUploadCallbackLollipop.onReceiveValue(WebChromeClient.FileChooserParams.parseResult(resultCode, intent));
|
|
||||||
mUploadCallbackLollipop = null;
|
|
||||||
}
|
|
||||||
// For Android < 5.0
|
|
||||||
else {
|
|
||||||
LOG.d(LOG_TAG, "onActivityResult (For Android < 5.0)");
|
|
||||||
// If RequestCode or Callback is Invalid
|
|
||||||
if(requestCode != FILECHOOSER_REQUESTCODE || mUploadCallback == null) {
|
|
||||||
super.onActivityResult(requestCode, resultCode, intent);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (null == mUploadCallback) return;
|
|
||||||
Uri result = intent == null || resultCode != cordova.getActivity().RESULT_OK ? null : intent.getData();
|
|
||||||
|
|
||||||
mUploadCallback.onReceiveValue(result);
|
|
||||||
mUploadCallback = null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The webview client receives notifications about appView
|
* The webview client receives notifications about appView
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -29,7 +29,6 @@
|
|||||||
#define kInAppBrowserToolbarBarPositionTop @"top"
|
#define kInAppBrowserToolbarBarPositionTop @"top"
|
||||||
|
|
||||||
#define TOOLBAR_HEIGHT 44.0
|
#define TOOLBAR_HEIGHT 44.0
|
||||||
#define STATUSBAR_HEIGHT 20.0
|
|
||||||
#define LOCATIONBAR_HEIGHT 21.0
|
#define LOCATIONBAR_HEIGHT 21.0
|
||||||
#define FOOTER_HEIGHT ((TOOLBAR_HEIGHT) + (LOCATIONBAR_HEIGHT))
|
#define FOOTER_HEIGHT ((TOOLBAR_HEIGHT) + (LOCATIONBAR_HEIGHT))
|
||||||
|
|
||||||
@@ -239,14 +238,7 @@
|
|||||||
// Run later to avoid the "took a long time" log message.
|
// Run later to avoid the "took a long time" log message.
|
||||||
dispatch_async(dispatch_get_main_queue(), ^{
|
dispatch_async(dispatch_get_main_queue(), ^{
|
||||||
if (weakSelf.inAppBrowserViewController != nil) {
|
if (weakSelf.inAppBrowserViewController != nil) {
|
||||||
CGRect frame = [[UIScreen mainScreen] bounds];
|
[weakSelf.viewController presentViewController:nav animated:YES completion:nil];
|
||||||
UIWindow *tmpWindow = [[UIWindow alloc] initWithFrame:frame];
|
|
||||||
UIViewController *tmpController = [[UIViewController alloc] init];
|
|
||||||
[tmpWindow setRootViewController:tmpController];
|
|
||||||
[tmpWindow setWindowLevel:UIWindowLevelNormal];
|
|
||||||
|
|
||||||
[tmpWindow makeKeyAndVisible];
|
|
||||||
[tmpController presentViewController:nav animated:YES completion:nil];
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -433,7 +425,7 @@
|
|||||||
[self.commandDelegate sendPluginResult:pluginResult callbackId:scriptCallbackId];
|
[self.commandDelegate sendPluginResult:pluginResult callbackId:scriptCallbackId];
|
||||||
return NO;
|
return NO;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//if is an app store link, let the system handle it, otherwise it fails to load it
|
//if is an app store link, let the system handle it, otherwise it fails to load it
|
||||||
else if ([[ url scheme] isEqualToString:@"itms-appss"] || [[ url scheme] isEqualToString:@"itms-apps"]) {
|
else if ([[ url scheme] isEqualToString:@"itms-appss"] || [[ url scheme] isEqualToString:@"itms-apps"]) {
|
||||||
[theWebView stopLoading];
|
[theWebView stopLoading];
|
||||||
@@ -524,7 +516,7 @@
|
|||||||
#else
|
#else
|
||||||
_webViewDelegate = [[CDVWebViewDelegate alloc] initWithDelegate:self];
|
_webViewDelegate = [[CDVWebViewDelegate alloc] initWithDelegate:self];
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
[self createViews];
|
[self createViews];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1049,11 +1041,11 @@
|
|||||||
|
|
||||||
- (void) viewDidLoad {
|
- (void) viewDidLoad {
|
||||||
|
|
||||||
CGRect statusBarFrame = [self invertFrameIfNeeded:[UIApplication sharedApplication].statusBarFrame];
|
CGRect frame = [UIApplication sharedApplication].statusBarFrame;
|
||||||
statusBarFrame.size.height = STATUSBAR_HEIGHT;
|
|
||||||
// simplified from: http://stackoverflow.com/a/25669695/219684
|
// simplified from: http://stackoverflow.com/a/25669695/219684
|
||||||
|
|
||||||
UIToolbar* bgToolbar = [[UIToolbar alloc] initWithFrame:statusBarFrame];
|
UIToolbar* bgToolbar = [[UIToolbar alloc] initWithFrame:[self invertFrameIfNeeded:frame]];
|
||||||
bgToolbar.barStyle = UIBarStyleDefault;
|
bgToolbar.barStyle = UIBarStyleDefault;
|
||||||
[bgToolbar setAutoresizingMask:UIViewAutoresizingFlexibleWidth];
|
[bgToolbar setAutoresizingMask:UIViewAutoresizingFlexibleWidth];
|
||||||
[self.view addSubview:bgToolbar];
|
[self.view addSubview:bgToolbar];
|
||||||
|
|||||||
@@ -313,8 +313,7 @@ var IAB = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (isWebViewAvailable && browserWrap && popup) {
|
if (isWebViewAvailable && browserWrap && popup) {
|
||||||
// CB-12364 getFileFromApplicationUriAsync does not support ms-appx-web
|
var uri = new Windows.Foundation.Uri(filePath);
|
||||||
var uri = new Windows.Foundation.Uri(filePath.replace('ms-appx-web:', 'ms-appx:'));
|
|
||||||
Windows.Storage.StorageFile.getFileFromApplicationUriAsync(uri).done(function (file) {
|
Windows.Storage.StorageFile.getFileFromApplicationUriAsync(uri).done(function (file) {
|
||||||
Windows.Storage.FileIO.readTextAsync(file).done(function (code) {
|
Windows.Storage.FileIO.readTextAsync(file).done(function (code) {
|
||||||
var op = popup.invokeScriptAsync("eval", code);
|
var op = popup.invokeScriptAsync("eval", code);
|
||||||
@@ -351,8 +350,7 @@ var IAB = {
|
|||||||
filePath = filePath && urlutil.makeAbsolute(filePath);
|
filePath = filePath && urlutil.makeAbsolute(filePath);
|
||||||
|
|
||||||
if (isWebViewAvailable && browserWrap && popup) {
|
if (isWebViewAvailable && browserWrap && popup) {
|
||||||
// CB-12364 getFileFromApplicationUriAsync does not support ms-appx-web
|
var uri = new Windows.Foundation.Uri(filePath);
|
||||||
var uri = new Windows.Foundation.Uri(filePath.replace('ms-appx-web:', 'ms-appx:'));
|
|
||||||
Windows.Storage.StorageFile.getFileFromApplicationUriAsync(uri).then(function (file) {
|
Windows.Storage.StorageFile.getFileFromApplicationUriAsync(uri).then(function (file) {
|
||||||
return Windows.Storage.FileIO.readTextAsync(file);
|
return Windows.Storage.FileIO.readTextAsync(file);
|
||||||
}).done(function (code) {
|
}).done(function (code) {
|
||||||
|
|||||||
+1
-1
@@ -20,7 +20,7 @@
|
|||||||
|
|
||||||
<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0"
|
<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0"
|
||||||
id="cordova-plugin-inappbrowser-tests"
|
id="cordova-plugin-inappbrowser-tests"
|
||||||
version="1.7.0">
|
version="1.6.1">
|
||||||
<name>Cordova InAppBrowser Plugin Tests</name>
|
<name>Cordova InAppBrowser Plugin Tests</name>
|
||||||
<license>Apache 2.0</license>
|
<license>Apache 2.0</license>
|
||||||
|
|
||||||
|
|||||||
@@ -26,10 +26,6 @@ var cordova = require('cordova');
|
|||||||
var isWindows = cordova.platformId == 'windows';
|
var isWindows = cordova.platformId == 'windows';
|
||||||
|
|
||||||
window.alert = window.alert || navigator.notification.alert;
|
window.alert = window.alert || navigator.notification.alert;
|
||||||
if (isWindows && navigator && navigator.notification && navigator.notification.alert) {
|
|
||||||
// window.alert is defined but not functional on UWP
|
|
||||||
window.alert = navigator.notification.alert;
|
|
||||||
}
|
|
||||||
|
|
||||||
exports.defineAutoTests = function () {
|
exports.defineAutoTests = function () {
|
||||||
|
|
||||||
|
|||||||
Vendored
-219
@@ -1,219 +0,0 @@
|
|||||||
// Type definitions for Apache Cordova InAppBrowser plugin
|
|
||||||
// Project: https://github.com/apache/cordova-plugin-inappbrowser
|
|
||||||
// Definitions by: Microsoft Open Technologies Inc <http://msopentech.com>
|
|
||||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
|
||||||
//
|
|
||||||
// Copyright (c) Microsoft Open Technologies Inc
|
|
||||||
// Licensed under the MIT license.
|
|
||||||
|
|
||||||
interface Window {
|
|
||||||
/**
|
|
||||||
* Opens a URL in a new InAppBrowser instance, the current browser instance, or the system browser.
|
|
||||||
* @param url The URL to load.
|
|
||||||
* @param target The target in which to load the URL, an optional parameter that defaults to _self.
|
|
||||||
* @param options Options for the InAppBrowser. Optional, defaulting to: location=yes.
|
|
||||||
* The options string must not contain any blank space, and each feature's
|
|
||||||
* name/value pairs must be separated by a comma. Feature names are case insensitive.
|
|
||||||
*/
|
|
||||||
open(url: string, target?: "_self", options?: string): InAppBrowser;
|
|
||||||
/**
|
|
||||||
* Opens a URL in a new InAppBrowser instance, the current browser instance, or the system browser.
|
|
||||||
* @param url The URL to load.
|
|
||||||
* @param target The target in which to load the URL, an optional parameter that defaults to _self.
|
|
||||||
* @param options Options for the InAppBrowser. Optional, defaulting to: location=yes.
|
|
||||||
* The options string must not contain any blank space, and each feature's
|
|
||||||
* name/value pairs must be separated by a comma. Feature names are case insensitive.
|
|
||||||
*/
|
|
||||||
open(url: string, target?: "_blank", options?: string): InAppBrowser;
|
|
||||||
/**
|
|
||||||
* Opens a URL in a new InAppBrowser instance, the current browser instance, or the system browser.
|
|
||||||
* @param url The URL to load.
|
|
||||||
* @param target The target in which to load the URL, an optional parameter that defaults to _self.
|
|
||||||
* @param options Options for the InAppBrowser. Optional, defaulting to: location=yes.
|
|
||||||
* The options string must not contain any blank space, and each feature's
|
|
||||||
* name/value pairs must be separated by a comma. Feature names are case insensitive.
|
|
||||||
*/
|
|
||||||
open(url: string, target?: "_system", options?: string): InAppBrowser;
|
|
||||||
/**
|
|
||||||
* Opens a URL in a new InAppBrowser instance, the current browser instance, or the system browser.
|
|
||||||
* @param url The URL to load.
|
|
||||||
* @param target The target in which to load the URL, an optional parameter that defaults to _self.
|
|
||||||
* @param options Options for the InAppBrowser. Optional, defaulting to: location=yes.
|
|
||||||
* The options string must not contain any blank space, and each feature's
|
|
||||||
* name/value pairs must be separated by a comma. Feature names are case insensitive.
|
|
||||||
*/
|
|
||||||
open(url: string, target?: string, options?: string, replace?: boolean): InAppBrowser;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The object returned from a call to window.open.
|
|
||||||
* NOTE: The InAppBrowser window behaves like a standard web browser, and can't access Cordova APIs.
|
|
||||||
*/
|
|
||||||
interface InAppBrowser extends Window {
|
|
||||||
onloadstart: (type: InAppBrowserEvent) => void;
|
|
||||||
onloadstop: (type: InAppBrowserEvent) => void;
|
|
||||||
onloaderror: (type: InAppBrowserEvent) => void;
|
|
||||||
onexit: (type: InAppBrowserEvent) => void;
|
|
||||||
// addEventListener overloads
|
|
||||||
/**
|
|
||||||
* Adds a listener for an event from the InAppBrowser.
|
|
||||||
* @param type the event to listen for
|
|
||||||
* loadstart: event fires when the InAppBrowser starts to load a URL.
|
|
||||||
* loadstop: event fires when the InAppBrowser finishes loading a URL.
|
|
||||||
* loaderror: event fires when the InAppBrowser encounters an error when loading a URL.
|
|
||||||
* exit: event fires when the InAppBrowser window is closed.
|
|
||||||
* @param callback the function that executes when the event fires. The function is
|
|
||||||
* passed an InAppBrowserEvent object as a parameter.
|
|
||||||
*/
|
|
||||||
addEventListener(type: "loadstart", callback: (event: InAppBrowserEvent) => void): void;
|
|
||||||
/**
|
|
||||||
* Adds a listener for an event from the InAppBrowser.
|
|
||||||
* @param type the event to listen for
|
|
||||||
* loadstart: event fires when the InAppBrowser starts to load a URL.
|
|
||||||
* loadstop: event fires when the InAppBrowser finishes loading a URL.
|
|
||||||
* loaderror: event fires when the InAppBrowser encounters an error when loading a URL.
|
|
||||||
* exit: event fires when the InAppBrowser window is closed.
|
|
||||||
* @param callback the function that executes when the event fires. The function is
|
|
||||||
* passed an InAppBrowserEvent object as a parameter.
|
|
||||||
*/
|
|
||||||
addEventListener(type: "loadstop", callback: (event: InAppBrowserEvent) => void): void;
|
|
||||||
/**
|
|
||||||
* Adds a listener for an event from the InAppBrowser.
|
|
||||||
* @param type the event to listen for
|
|
||||||
* loadstart: event fires when the InAppBrowser starts to load a URL.
|
|
||||||
* loadstop: event fires when the InAppBrowser finishes loading a URL.
|
|
||||||
* loaderror: event fires when the InAppBrowser encounters an error when loading a URL.
|
|
||||||
* exit: event fires when the InAppBrowser window is closed.
|
|
||||||
* @param callback the function that executes when the event fires. The function is
|
|
||||||
* passed an InAppBrowserEvent object as a parameter.
|
|
||||||
*/
|
|
||||||
addEventListener(type: "loaderror", callback: (event: InAppBrowserEvent) => void): void;
|
|
||||||
/**
|
|
||||||
* Adds a listener for an event from the InAppBrowser.
|
|
||||||
* @param type the event to listen for
|
|
||||||
* loadstart: event fires when the InAppBrowser starts to load a URL.
|
|
||||||
* loadstop: event fires when the InAppBrowser finishes loading a URL.
|
|
||||||
* loaderror: event fires when the InAppBrowser encounters an error when loading a URL.
|
|
||||||
* exit: event fires when the InAppBrowser window is closed.
|
|
||||||
* @param callback the function that executes when the event fires. The function is
|
|
||||||
* passed an InAppBrowserEvent object as a parameter.
|
|
||||||
*/
|
|
||||||
addEventListener(type: "exit", callback: (event: InAppBrowserEvent) => void): void;
|
|
||||||
/**
|
|
||||||
* Adds a listener for an event from the InAppBrowser.
|
|
||||||
* @param type the event to listen for
|
|
||||||
* loadstart: event fires when the InAppBrowser starts to load a URL.
|
|
||||||
* loadstop: event fires when the InAppBrowser finishes loading a URL.
|
|
||||||
* loaderror: event fires when the InAppBrowser encounters an error when loading a URL.
|
|
||||||
* exit: event fires when the InAppBrowser window is closed.
|
|
||||||
* @param callback the function that executes when the event fires. The function is
|
|
||||||
* passed an Event object as a parameter.
|
|
||||||
*/
|
|
||||||
addEventListener(type: string, callback: (event: Event) => void): void;
|
|
||||||
// removeEventListener overloads
|
|
||||||
/**
|
|
||||||
* Removes a listener for an event from the InAppBrowser.
|
|
||||||
* @param type The event to stop listening for.
|
|
||||||
* loadstart: event fires when the InAppBrowser starts to load a URL.
|
|
||||||
* loadstop: event fires when the InAppBrowser finishes loading a URL.
|
|
||||||
* loaderror: event fires when the InAppBrowser encounters an error when loading a URL.
|
|
||||||
* exit: event fires when the InAppBrowser window is closed.
|
|
||||||
* @param callback the function that executes when the event fires. The function is
|
|
||||||
* passed an InAppBrowserEvent object as a parameter.
|
|
||||||
*/
|
|
||||||
removeEventListener(type: "loadstart", callback: (event: InAppBrowserEvent) => void): void;
|
|
||||||
/**
|
|
||||||
* Removes a listener for an event from the InAppBrowser.
|
|
||||||
* @param type The event to stop listening for.
|
|
||||||
* loadstart: event fires when the InAppBrowser starts to load a URL.
|
|
||||||
* loadstop: event fires when the InAppBrowser finishes loading a URL.
|
|
||||||
* loaderror: event fires when the InAppBrowser encounters an error when loading a URL.
|
|
||||||
* exit: event fires when the InAppBrowser window is closed.
|
|
||||||
* @param callback the function that executes when the event fires. The function is
|
|
||||||
* passed an InAppBrowserEvent object as a parameter.
|
|
||||||
*/
|
|
||||||
removeEventListener(type: "loadstop", callback: (event: InAppBrowserEvent) => void): void;
|
|
||||||
/**
|
|
||||||
* Removes a listener for an event from the InAppBrowser.
|
|
||||||
* @param type The event to stop listening for.
|
|
||||||
* loadstart: event fires when the InAppBrowser starts to load a URL.
|
|
||||||
* loadstop: event fires when the InAppBrowser finishes loading a URL.
|
|
||||||
* loaderror: event fires when the InAppBrowser encounters an error when loading a URL.
|
|
||||||
* exit: event fires when the InAppBrowser window is closed.
|
|
||||||
* @param callback the function that executes when the event fires. The function is
|
|
||||||
* passed an InAppBrowserEvent object as a parameter.
|
|
||||||
*/
|
|
||||||
removeEventListener(type: "loaderror", callback: (event: InAppBrowserEvent) => void): void;
|
|
||||||
/**
|
|
||||||
* Removes a listener for an event from the InAppBrowser.
|
|
||||||
* @param type The event to stop listening for.
|
|
||||||
* loadstart: event fires when the InAppBrowser starts to load a URL.
|
|
||||||
* loadstop: event fires when the InAppBrowser finishes loading a URL.
|
|
||||||
* loaderror: event fires when the InAppBrowser encounters an error when loading a URL.
|
|
||||||
* exit: event fires when the InAppBrowser window is closed.
|
|
||||||
* @param callback the function that executes when the event fires. The function is
|
|
||||||
* passed an InAppBrowserEvent object as a parameter.
|
|
||||||
*/
|
|
||||||
removeEventListener(type: "exit", callback: (event: InAppBrowserEvent) => void): void;
|
|
||||||
/**
|
|
||||||
* Removes a listener for an event from the InAppBrowser.
|
|
||||||
* @param type The event to stop listening for.
|
|
||||||
* loadstart: event fires when the InAppBrowser starts to load a URL.
|
|
||||||
* loadstop: event fires when the InAppBrowser finishes loading a URL.
|
|
||||||
* loaderror: event fires when the InAppBrowser encounters an error when loading a URL.
|
|
||||||
* exit: event fires when the InAppBrowser window is closed.
|
|
||||||
* @param callback the function that executes when the event fires. The function is
|
|
||||||
* passed an Event object as a parameter.
|
|
||||||
*/
|
|
||||||
removeEventListener(type: string, callback: (event: Event) => void): void;
|
|
||||||
/** Closes the InAppBrowser window. */
|
|
||||||
close(): void;
|
|
||||||
/**
|
|
||||||
* Displays an InAppBrowser window that was opened hidden. Calling this has no effect
|
|
||||||
* if the InAppBrowser was already visible.
|
|
||||||
*/
|
|
||||||
show(): void;
|
|
||||||
/**
|
|
||||||
* Injects JavaScript code into the InAppBrowser window.
|
|
||||||
* @param script Details of the script to run, specifying either a file or code key.
|
|
||||||
* @param callback The function that executes after the JavaScript code is injected.
|
|
||||||
* If the injected script is of type code, the callback executes with
|
|
||||||
* a single parameter, which is the return value of the script, wrapped in an Array.
|
|
||||||
* For multi-line scripts, this is the return value of the last statement,
|
|
||||||
* or the last expression evaluated.
|
|
||||||
*/
|
|
||||||
executeScript(script: { code: string }, callback: (result: any) => void): void;
|
|
||||||
/**
|
|
||||||
* Injects JavaScript code into the InAppBrowser window.
|
|
||||||
* @param script Details of the script to run, specifying either a file or code key.
|
|
||||||
* @param callback The function that executes after the JavaScript code is injected.
|
|
||||||
* If the injected script is of type code, the callback executes with
|
|
||||||
* a single parameter, which is the return value of the script, wrapped in an Array.
|
|
||||||
* For multi-line scripts, this is the return value of the last statement,
|
|
||||||
* or the last expression evaluated.
|
|
||||||
*/
|
|
||||||
executeScript(script: { file: string }, callback: (result: any) => void): void;
|
|
||||||
/**
|
|
||||||
* Injects CSS into the InAppBrowser window.
|
|
||||||
* @param css Details of the script to run, specifying either a file or code key.
|
|
||||||
* @param callback The function that executes after the CSS is injected.
|
|
||||||
*/
|
|
||||||
insertCSS(css: { code: string }, callback: () => void): void;
|
|
||||||
/**
|
|
||||||
* Injects CSS into the InAppBrowser window.
|
|
||||||
* @param css Details of the script to run, specifying either a file or code key.
|
|
||||||
* @param callback The function that executes after the CSS is injected.
|
|
||||||
*/
|
|
||||||
insertCSS(css: { file: string }, callback: () => void): void;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface InAppBrowserEvent extends Event {
|
|
||||||
/** the eventname, either loadstart, loadstop, loaderror, or exit. */
|
|
||||||
type: string;
|
|
||||||
/** the URL that was loaded. */
|
|
||||||
url: string;
|
|
||||||
/** the error code, only in the case of loaderror. */
|
|
||||||
code: number;
|
|
||||||
/** the error message, only in the case of loaderror. */
|
|
||||||
message: string;
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user