@capgo/inappbrowser 0.4.12 → 0.4.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +16 -0
- package/android/build.gradle +5 -6
- package/android/src/main/java/ee/forgr/capacitor_inappbrowser/InAppBrowserPlugin.java +7 -0
- package/dist/docs.json +15 -0
- package/dist/esm/definitions.d.ts +6 -0
- package/dist/esm/definitions.js.map +1 -1
- package/dist/esm/web.d.ts +1 -0
- package/dist/esm/web.js +4 -0
- package/dist/esm/web.js.map +1 -1
- package/dist/plugin.cjs.js +4 -0
- package/dist/plugin.cjs.js.map +1 -1
- package/dist/plugin.js +4 -0
- package/dist/plugin.js.map +1 -1
- package/ios/Plugin/InAppBrowserPlugin.m +1 -0
- package/ios/Plugin/InAppBrowserPlugin.swift +4 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -24,6 +24,7 @@ InAppBrowser.open("YOUR_URL");
|
|
|
24
24
|
<docgen-index>
|
|
25
25
|
|
|
26
26
|
* [`open(...)`](#open)
|
|
27
|
+
* [`clearCookies()`](#clearcookies)
|
|
27
28
|
* [`close()`](#close)
|
|
28
29
|
* [`openWebView(...)`](#openwebview)
|
|
29
30
|
* [`setUrl(...)`](#seturl)
|
|
@@ -59,6 +60,21 @@ Open url in a new window fullscreen
|
|
|
59
60
|
--------------------
|
|
60
61
|
|
|
61
62
|
|
|
63
|
+
### clearCookies()
|
|
64
|
+
|
|
65
|
+
```typescript
|
|
66
|
+
clearCookies() => any
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
Clear all cookies
|
|
70
|
+
|
|
71
|
+
**Returns:** <code>any</code>
|
|
72
|
+
|
|
73
|
+
**Since:** 0.5.0
|
|
74
|
+
|
|
75
|
+
--------------------
|
|
76
|
+
|
|
77
|
+
|
|
62
78
|
### close()
|
|
63
79
|
|
|
64
80
|
```typescript
|
package/android/build.gradle
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
ext {
|
|
2
|
-
junitVersion =
|
|
3
|
-
androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.1.3'
|
|
4
|
-
androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.4.0'
|
|
2
|
+
junitVersion = project.hasProperty('junitVersion') ? rootProject.ext.junitVersion : '4.13.2'
|
|
5
3
|
androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.4.2'
|
|
4
|
+
androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.1.3'
|
|
5
|
+
androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.4.0'
|
|
6
6
|
}
|
|
7
7
|
|
|
8
8
|
buildscript {
|
|
9
9
|
repositories {
|
|
10
|
-
mavenCentral()
|
|
11
10
|
google()
|
|
11
|
+
mavenCentral()
|
|
12
12
|
}
|
|
13
13
|
dependencies {
|
|
14
14
|
classpath 'com.android.tools.build:gradle:7.3.1'
|
|
@@ -45,7 +45,6 @@ android {
|
|
|
45
45
|
repositories {
|
|
46
46
|
google()
|
|
47
47
|
mavenCentral()
|
|
48
|
-
jcenter()
|
|
49
48
|
}
|
|
50
49
|
|
|
51
50
|
|
|
@@ -61,5 +60,5 @@ dependencies {
|
|
|
61
60
|
implementation 'com.android.support:design:28.0.0'
|
|
62
61
|
implementation 'com.android.support:appcompat-v7:28.0.0'
|
|
63
62
|
implementation 'androidx.coordinatorlayout:coordinatorlayout:1.2.0'
|
|
64
|
-
implementation 'com.google.android.material:material:1.
|
|
63
|
+
implementation 'com.google.android.material:material:1.9.0'
|
|
65
64
|
}
|
|
@@ -8,6 +8,7 @@ import android.net.Uri;
|
|
|
8
8
|
import android.os.Bundle;
|
|
9
9
|
import android.text.TextUtils;
|
|
10
10
|
import android.util.Log;
|
|
11
|
+
import android.webkit.WebStorage;
|
|
11
12
|
import androidx.browser.customtabs.CustomTabsCallback;
|
|
12
13
|
import androidx.browser.customtabs.CustomTabsClient;
|
|
13
14
|
import androidx.browser.customtabs.CustomTabsIntent;
|
|
@@ -109,6 +110,12 @@ public class InAppBrowserPlugin extends Plugin {
|
|
|
109
110
|
call.resolve();
|
|
110
111
|
}
|
|
111
112
|
|
|
113
|
+
@PluginMethod
|
|
114
|
+
public void clearCookies(PluginCall call) {
|
|
115
|
+
WebStorage.getInstance().deleteAllData();
|
|
116
|
+
call.resolve();
|
|
117
|
+
}
|
|
118
|
+
|
|
112
119
|
@PluginMethod
|
|
113
120
|
public void openWebView(PluginCall call) {
|
|
114
121
|
String url = call.getString("url");
|
package/dist/docs.json
CHANGED
|
@@ -28,6 +28,21 @@
|
|
|
28
28
|
],
|
|
29
29
|
"slug": "open"
|
|
30
30
|
},
|
|
31
|
+
{
|
|
32
|
+
"name": "clearCookies",
|
|
33
|
+
"signature": "() => any",
|
|
34
|
+
"parameters": [],
|
|
35
|
+
"returns": "any",
|
|
36
|
+
"tags": [
|
|
37
|
+
{
|
|
38
|
+
"name": "since",
|
|
39
|
+
"text": "0.5.0"
|
|
40
|
+
}
|
|
41
|
+
],
|
|
42
|
+
"docs": "Clear all cookies",
|
|
43
|
+
"complexTypes": [],
|
|
44
|
+
"slug": "clearcookies"
|
|
45
|
+
},
|
|
31
46
|
{
|
|
32
47
|
"name": "close",
|
|
33
48
|
"signature": "() => any",
|
|
@@ -109,6 +109,12 @@ export interface InAppBrowserPlugin {
|
|
|
109
109
|
* @since 0.1.0
|
|
110
110
|
*/
|
|
111
111
|
open(options: OpenOptions): Promise<any>;
|
|
112
|
+
/**
|
|
113
|
+
* Clear all cookies
|
|
114
|
+
*
|
|
115
|
+
* @since 0.5.0
|
|
116
|
+
*/
|
|
117
|
+
clearCookies(): Promise<any>;
|
|
112
118
|
close(): Promise<any>;
|
|
113
119
|
/**
|
|
114
120
|
* Open url in a new webview with toolbars
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"AAsBA,MAAM,CAAN,IAAY,eAGX;AAHD,WAAY,eAAe;IACzB,kCAAe,CAAA;IACf,kCAAe,CAAA;AACjB,CAAC,EAHW,eAAe,KAAf,eAAe,QAG1B;AACD,MAAM,CAAN,IAAY,WAKX;AALD,WAAY,WAAW;IACrB,oCAAqB,CAAA;IACrB,wCAAyB,CAAA;IACzB,8BAAe,CAAA;IACf,2BAAY,CAAA;AACd,CAAC,EALW,WAAW,KAAX,WAAW,QAKtB","sourcesContent":["import type { PluginListenerHandle } from \"@capacitor/core\";\n\nexport interface UrlEvent {\n /**\n * Emit when the url changes\n *\n * @since 0.0.1\n */\n url: string;\n}\nexport interface BtnEvent {\n /**\n * Emit when a button is clicked.\n *\n * @since 0.0.1\n */\n url: string;\n}\n\nexport type UrlChangeListener = (state: UrlEvent) => void;\nexport type ConfirmBtnListener = (state: BtnEvent) => void;\n\nexport enum BackgroundColor {\n WHITE = \"white\",\n BLACK = \"black\",\n}\nexport enum ToolBarType {\n ACTIVITY = \"activity\",\n NAVIGATION = \"navigation\",\n BLANK = \"blank\",\n DEFAULT = \"\",\n}\n\nexport interface Headers {\n [key: string]: string;\n}\n\nexport interface OpenOptions {\n /**\n * Target URL to load.\n * @since 0.1.0\n */\n url: string;\n /**\n * Headers to send with the request.\n * @since 0.1.0\n */\n headers?: Headers;\n /**\n * if true, the browser will be presented after the page is loaded, if false, the browser will be presented immediately.\n * @since 0.1.0\n */\n isPresentAfterPageLoad?: boolean;\n preventDeeplink?: boolean;\n}\n\nexport interface DisclaimerOptions {\n title: string;\n message: string;\n confirmBtn: string;\n cancelBtn: string;\n}\n\nexport interface OpenWebViewOptions {\n /**\n * Target URL to load.\n * @since 0.1.0\n */\n url: string;\n /**\n * Headers to send with the request.\n * @since 0.1.0\n */\n headers?: Headers;\n /**\n * share options\n * @since 0.1.0\n */\n shareDisclaimer?: DisclaimerOptions;\n /**\n * Toolbar type\n * @since 0.1.0\n * @default ToolBarType.DEFAULT\n */\n toolbarType?: ToolBarType;\n /**\n * Share subject\n * @since 0.1.0\n */\n shareSubject?: string;\n /**\n * Title of the browser\n * @since 0.1.0\n * @default 'New Window'\n */\n title: string;\n /**\n * Background color of the browser, only on IOS\n * @since 0.1.0\n * @default BackgroundColor.BLACK\n */\n backgroundColor?: BackgroundColor;\n /**\n * Open url in a new window fullscreen\n *\n * isPresentAfterPageLoad: if true, the browser will be presented after the page is loaded, if false, the browser will be presented immediately.\n * @since 0.1.0\n * @default false\n */\n isPresentAfterPageLoad?: boolean;\n}\n\n// CapBrowser.addListener(\"urlChangeEvent\", (info: any) => {\n// console.log(info.url)\n// })\n\n// CapBrowser.addListener(\"confirmBtnClicked\", (info: any) => {\n// // will be triggered when user clicks on confirm button when disclaimer is required, works only on iOS\n// console.log(info.url)\n// })\nexport interface InAppBrowserPlugin {\n /**\n * Open url in a new window fullscreen\n *\n * @since 0.1.0\n */\n open(options: OpenOptions): Promise<any>;\n close(): Promise<any>;\n /**\n * Open url in a new webview with toolbars\n *\n * @since 0.1.0\n */\n openWebView(options: OpenWebViewOptions): Promise<any>;\n setUrl(options: { url: string }): Promise<any>;\n /**\n * Listen for url change\n *\n * @since 0.0.1\n */\n addListener(\n eventName: \"urlChangeEvent\",\n listenerFunc: UrlChangeListener\n ): Promise<PluginListenerHandle> & PluginListenerHandle;\n\n /**\n * Listen for close click\n *\n * @since 0.4.0\n */\n addListener(\n eventName: \"closeEvent\",\n listenerFunc: UrlChangeListener\n ): Promise<PluginListenerHandle> & PluginListenerHandle;\n /**\n * Will be triggered when user clicks on confirm button when disclaimer is required, works only on iOS\n *\n * @since 0.0.1\n */\n addListener(\n eventName: \"confirmBtnClicked\",\n listenerFunc: ConfirmBtnListener\n ): Promise<PluginListenerHandle> & PluginListenerHandle;\n\n /**\n * Remove all listeners for this plugin.\n *\n * @since 1.0.0\n */\n removeAllListeners(): Promise<void>;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"AAsBA,MAAM,CAAN,IAAY,eAGX;AAHD,WAAY,eAAe;IACzB,kCAAe,CAAA;IACf,kCAAe,CAAA;AACjB,CAAC,EAHW,eAAe,KAAf,eAAe,QAG1B;AACD,MAAM,CAAN,IAAY,WAKX;AALD,WAAY,WAAW;IACrB,oCAAqB,CAAA;IACrB,wCAAyB,CAAA;IACzB,8BAAe,CAAA;IACf,2BAAY,CAAA;AACd,CAAC,EALW,WAAW,KAAX,WAAW,QAKtB","sourcesContent":["import type { PluginListenerHandle } from \"@capacitor/core\";\n\nexport interface UrlEvent {\n /**\n * Emit when the url changes\n *\n * @since 0.0.1\n */\n url: string;\n}\nexport interface BtnEvent {\n /**\n * Emit when a button is clicked.\n *\n * @since 0.0.1\n */\n url: string;\n}\n\nexport type UrlChangeListener = (state: UrlEvent) => void;\nexport type ConfirmBtnListener = (state: BtnEvent) => void;\n\nexport enum BackgroundColor {\n WHITE = \"white\",\n BLACK = \"black\",\n}\nexport enum ToolBarType {\n ACTIVITY = \"activity\",\n NAVIGATION = \"navigation\",\n BLANK = \"blank\",\n DEFAULT = \"\",\n}\n\nexport interface Headers {\n [key: string]: string;\n}\n\nexport interface OpenOptions {\n /**\n * Target URL to load.\n * @since 0.1.0\n */\n url: string;\n /**\n * Headers to send with the request.\n * @since 0.1.0\n */\n headers?: Headers;\n /**\n * if true, the browser will be presented after the page is loaded, if false, the browser will be presented immediately.\n * @since 0.1.0\n */\n isPresentAfterPageLoad?: boolean;\n preventDeeplink?: boolean;\n}\n\nexport interface DisclaimerOptions {\n title: string;\n message: string;\n confirmBtn: string;\n cancelBtn: string;\n}\n\nexport interface OpenWebViewOptions {\n /**\n * Target URL to load.\n * @since 0.1.0\n */\n url: string;\n /**\n * Headers to send with the request.\n * @since 0.1.0\n */\n headers?: Headers;\n /**\n * share options\n * @since 0.1.0\n */\n shareDisclaimer?: DisclaimerOptions;\n /**\n * Toolbar type\n * @since 0.1.0\n * @default ToolBarType.DEFAULT\n */\n toolbarType?: ToolBarType;\n /**\n * Share subject\n * @since 0.1.0\n */\n shareSubject?: string;\n /**\n * Title of the browser\n * @since 0.1.0\n * @default 'New Window'\n */\n title: string;\n /**\n * Background color of the browser, only on IOS\n * @since 0.1.0\n * @default BackgroundColor.BLACK\n */\n backgroundColor?: BackgroundColor;\n /**\n * Open url in a new window fullscreen\n *\n * isPresentAfterPageLoad: if true, the browser will be presented after the page is loaded, if false, the browser will be presented immediately.\n * @since 0.1.0\n * @default false\n */\n isPresentAfterPageLoad?: boolean;\n}\n\n// CapBrowser.addListener(\"urlChangeEvent\", (info: any) => {\n// console.log(info.url)\n// })\n\n// CapBrowser.addListener(\"confirmBtnClicked\", (info: any) => {\n// // will be triggered when user clicks on confirm button when disclaimer is required, works only on iOS\n// console.log(info.url)\n// })\nexport interface InAppBrowserPlugin {\n /**\n * Open url in a new window fullscreen\n *\n * @since 0.1.0\n */\n open(options: OpenOptions): Promise<any>;\n\n /**\n * Clear all cookies\n *\n * @since 0.5.0\n */\n clearCookies(): Promise<any>;\n close(): Promise<any>;\n /**\n * Open url in a new webview with toolbars\n *\n * @since 0.1.0\n */\n openWebView(options: OpenWebViewOptions): Promise<any>;\n setUrl(options: { url: string }): Promise<any>;\n /**\n * Listen for url change\n *\n * @since 0.0.1\n */\n addListener(\n eventName: \"urlChangeEvent\",\n listenerFunc: UrlChangeListener\n ): Promise<PluginListenerHandle> & PluginListenerHandle;\n\n /**\n * Listen for close click\n *\n * @since 0.4.0\n */\n addListener(\n eventName: \"closeEvent\",\n listenerFunc: UrlChangeListener\n ): Promise<PluginListenerHandle> & PluginListenerHandle;\n /**\n * Will be triggered when user clicks on confirm button when disclaimer is required, works only on iOS\n *\n * @since 0.0.1\n */\n addListener(\n eventName: \"confirmBtnClicked\",\n listenerFunc: ConfirmBtnListener\n ): Promise<PluginListenerHandle> & PluginListenerHandle;\n\n /**\n * Remove all listeners for this plugin.\n *\n * @since 1.0.0\n */\n removeAllListeners(): Promise<void>;\n}\n"]}
|
package/dist/esm/web.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import { WebPlugin } from "@capacitor/core";
|
|
|
2
2
|
import type { InAppBrowserPlugin, OpenWebViewOptions, OpenOptions } from "./definitions";
|
|
3
3
|
export declare class InAppBrowserWeb extends WebPlugin implements InAppBrowserPlugin {
|
|
4
4
|
open(options: OpenOptions): Promise<any>;
|
|
5
|
+
clearCookies(): Promise<any>;
|
|
5
6
|
openWebView(options: OpenWebViewOptions): Promise<any>;
|
|
6
7
|
close(): Promise<any>;
|
|
7
8
|
setUrl(options: {
|
package/dist/esm/web.js
CHANGED
|
@@ -4,6 +4,10 @@ export class InAppBrowserWeb extends WebPlugin {
|
|
|
4
4
|
console.log("open", options);
|
|
5
5
|
return options;
|
|
6
6
|
}
|
|
7
|
+
async clearCookies() {
|
|
8
|
+
console.log("cleanCookies");
|
|
9
|
+
return;
|
|
10
|
+
}
|
|
7
11
|
async openWebView(options) {
|
|
8
12
|
console.log("openWebView", options);
|
|
9
13
|
return options;
|
package/dist/esm/web.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"web.js","sourceRoot":"","sources":["../../src/web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAQ5C,MAAM,OAAO,eAAgB,SAAQ,SAAS;IAC5C,KAAK,CAAC,IAAI,CAAC,OAAoB;QAC7B,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QAC7B,OAAO,OAAO,CAAC;IACjB,CAAC;IACD,KAAK,CAAC,WAAW,CAAC,OAA2B;QAC3C,OAAO,CAAC,GAAG,CAAC,aAAa,EAAE,OAAO,CAAC,CAAC;QACpC,OAAO,OAAO,CAAC;IACjB,CAAC;IACD,KAAK,CAAC,KAAK;QACT,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;QACrB,OAAO;IACT,CAAC;IACD,KAAK,CAAC,MAAM,CAAC,OAAwB;QACnC,OAAO,CAAC,GAAG,CAAC,QAAQ,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC;QACnC,OAAO;IACT,CAAC;CACF","sourcesContent":["import { WebPlugin } from \"@capacitor/core\";\n\nimport type {\n InAppBrowserPlugin,\n OpenWebViewOptions,\n OpenOptions,\n} from \"./definitions\";\n\nexport class InAppBrowserWeb extends WebPlugin implements InAppBrowserPlugin {\n async open(options: OpenOptions): Promise<any> {\n console.log(\"open\", options);\n return options;\n }\n async openWebView(options: OpenWebViewOptions): Promise<any> {\n console.log(\"openWebView\", options);\n return options;\n }\n async close(): Promise<any> {\n console.log(\"close\");\n return;\n }\n async setUrl(options: { url: string }): Promise<any> {\n console.log(\"setUrl\", options.url);\n return;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"web.js","sourceRoot":"","sources":["../../src/web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAQ5C,MAAM,OAAO,eAAgB,SAAQ,SAAS;IAC5C,KAAK,CAAC,IAAI,CAAC,OAAoB;QAC7B,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QAC7B,OAAO,OAAO,CAAC;IACjB,CAAC;IACD,KAAK,CAAC,YAAY;QAChB,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;QAC5B,OAAO;IACT,CAAC;IACD,KAAK,CAAC,WAAW,CAAC,OAA2B;QAC3C,OAAO,CAAC,GAAG,CAAC,aAAa,EAAE,OAAO,CAAC,CAAC;QACpC,OAAO,OAAO,CAAC;IACjB,CAAC;IACD,KAAK,CAAC,KAAK;QACT,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;QACrB,OAAO;IACT,CAAC;IACD,KAAK,CAAC,MAAM,CAAC,OAAwB;QACnC,OAAO,CAAC,GAAG,CAAC,QAAQ,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC;QACnC,OAAO;IACT,CAAC;CACF","sourcesContent":["import { WebPlugin } from \"@capacitor/core\";\n\nimport type {\n InAppBrowserPlugin,\n OpenWebViewOptions,\n OpenOptions,\n} from \"./definitions\";\n\nexport class InAppBrowserWeb extends WebPlugin implements InAppBrowserPlugin {\n async open(options: OpenOptions): Promise<any> {\n console.log(\"open\", options);\n return options;\n }\n async clearCookies(): Promise<any> {\n console.log(\"cleanCookies\");\n return;\n }\n async openWebView(options: OpenWebViewOptions): Promise<any> {\n console.log(\"openWebView\", options);\n return options;\n }\n async close(): Promise<any> {\n console.log(\"close\");\n return;\n }\n async setUrl(options: { url: string }): Promise<any> {\n console.log(\"setUrl\", options.url);\n return;\n }\n}\n"]}
|
package/dist/plugin.cjs.js
CHANGED
|
@@ -24,6 +24,10 @@ class InAppBrowserWeb extends core.WebPlugin {
|
|
|
24
24
|
console.log("open", options);
|
|
25
25
|
return options;
|
|
26
26
|
}
|
|
27
|
+
async clearCookies() {
|
|
28
|
+
console.log("cleanCookies");
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
27
31
|
async openWebView(options) {
|
|
28
32
|
console.log("openWebView", options);
|
|
29
33
|
return options;
|
package/dist/plugin.cjs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.cjs.js","sources":["esm/definitions.js","esm/index.js","esm/web.js"],"sourcesContent":["export var BackgroundColor;\n(function (BackgroundColor) {\n BackgroundColor[\"WHITE\"] = \"white\";\n BackgroundColor[\"BLACK\"] = \"black\";\n})(BackgroundColor || (BackgroundColor = {}));\nexport var ToolBarType;\n(function (ToolBarType) {\n ToolBarType[\"ACTIVITY\"] = \"activity\";\n ToolBarType[\"NAVIGATION\"] = \"navigation\";\n ToolBarType[\"BLANK\"] = \"blank\";\n ToolBarType[\"DEFAULT\"] = \"\";\n})(ToolBarType || (ToolBarType = {}));\n//# sourceMappingURL=definitions.js.map","import { registerPlugin } from \"@capacitor/core\";\nconst InAppBrowser = registerPlugin(\"InAppBrowser\", {\n web: () => import(\"./web\").then((m) => new m.InAppBrowserWeb()),\n});\nexport * from \"./definitions\";\nexport { InAppBrowser };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from \"@capacitor/core\";\nexport class InAppBrowserWeb extends WebPlugin {\n async open(options) {\n console.log(\"open\", options);\n return options;\n }\n async openWebView(options) {\n console.log(\"openWebView\", options);\n return options;\n }\n async close() {\n console.log(\"close\");\n return;\n }\n async setUrl(options) {\n console.log(\"setUrl\", options.url);\n return;\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["BackgroundColor","ToolBarType","registerPlugin","WebPlugin"],"mappings":";;;;AAAWA,iCAAgB;AAC3B,CAAC,UAAU,eAAe,EAAE;AAC5B,IAAI,eAAe,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC;AACvC,IAAI,eAAe,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC;AACvC,CAAC,EAAEA,uBAAe,KAAKA,uBAAe,GAAG,EAAE,CAAC,CAAC,CAAC;AACnCC,6BAAY;AACvB,CAAC,UAAU,WAAW,EAAE;AACxB,IAAI,WAAW,CAAC,UAAU,CAAC,GAAG,UAAU,CAAC;AACzC,IAAI,WAAW,CAAC,YAAY,CAAC,GAAG,YAAY,CAAC;AAC7C,IAAI,WAAW,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC;AACnC,IAAI,WAAW,CAAC,SAAS,CAAC,GAAG,EAAE,CAAC;AAChC,CAAC,EAAEA,mBAAW,KAAKA,mBAAW,GAAG,EAAE,CAAC,CAAC;;ACVhC,MAAC,YAAY,GAAGC,mBAAc,CAAC,cAAc,EAAE;AACpD,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,eAAe,EAAE,CAAC;AACnE,CAAC;;ACFM,MAAM,eAAe,SAASC,cAAS,CAAC;AAC/C,IAAI,MAAM,IAAI,CAAC,OAAO,EAAE;AACxB,QAAQ,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AACrC,QAAQ,OAAO,OAAO,CAAC;AACvB,KAAK;AACL,IAAI,MAAM,WAAW,CAAC,OAAO,EAAE;AAC/B,QAAQ,OAAO,CAAC,GAAG,CAAC,aAAa,EAAE,OAAO,CAAC,CAAC;AAC5C,QAAQ,OAAO,OAAO,CAAC;AACvB,KAAK;AACL,IAAI,MAAM,KAAK,GAAG;AAClB,QAAQ,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;AAC7B,QAAQ,OAAO;AACf,KAAK;AACL,IAAI,MAAM,MAAM,CAAC,OAAO,EAAE;AAC1B,QAAQ,OAAO,CAAC,GAAG,CAAC,QAAQ,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC;AAC3C,QAAQ,OAAO;AACf,KAAK;AACL;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"plugin.cjs.js","sources":["esm/definitions.js","esm/index.js","esm/web.js"],"sourcesContent":["export var BackgroundColor;\n(function (BackgroundColor) {\n BackgroundColor[\"WHITE\"] = \"white\";\n BackgroundColor[\"BLACK\"] = \"black\";\n})(BackgroundColor || (BackgroundColor = {}));\nexport var ToolBarType;\n(function (ToolBarType) {\n ToolBarType[\"ACTIVITY\"] = \"activity\";\n ToolBarType[\"NAVIGATION\"] = \"navigation\";\n ToolBarType[\"BLANK\"] = \"blank\";\n ToolBarType[\"DEFAULT\"] = \"\";\n})(ToolBarType || (ToolBarType = {}));\n//# sourceMappingURL=definitions.js.map","import { registerPlugin } from \"@capacitor/core\";\nconst InAppBrowser = registerPlugin(\"InAppBrowser\", {\n web: () => import(\"./web\").then((m) => new m.InAppBrowserWeb()),\n});\nexport * from \"./definitions\";\nexport { InAppBrowser };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from \"@capacitor/core\";\nexport class InAppBrowserWeb extends WebPlugin {\n async open(options) {\n console.log(\"open\", options);\n return options;\n }\n async clearCookies() {\n console.log(\"cleanCookies\");\n return;\n }\n async openWebView(options) {\n console.log(\"openWebView\", options);\n return options;\n }\n async close() {\n console.log(\"close\");\n return;\n }\n async setUrl(options) {\n console.log(\"setUrl\", options.url);\n return;\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["BackgroundColor","ToolBarType","registerPlugin","WebPlugin"],"mappings":";;;;AAAWA,iCAAgB;AAC3B,CAAC,UAAU,eAAe,EAAE;AAC5B,IAAI,eAAe,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC;AACvC,IAAI,eAAe,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC;AACvC,CAAC,EAAEA,uBAAe,KAAKA,uBAAe,GAAG,EAAE,CAAC,CAAC,CAAC;AACnCC,6BAAY;AACvB,CAAC,UAAU,WAAW,EAAE;AACxB,IAAI,WAAW,CAAC,UAAU,CAAC,GAAG,UAAU,CAAC;AACzC,IAAI,WAAW,CAAC,YAAY,CAAC,GAAG,YAAY,CAAC;AAC7C,IAAI,WAAW,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC;AACnC,IAAI,WAAW,CAAC,SAAS,CAAC,GAAG,EAAE,CAAC;AAChC,CAAC,EAAEA,mBAAW,KAAKA,mBAAW,GAAG,EAAE,CAAC,CAAC;;ACVhC,MAAC,YAAY,GAAGC,mBAAc,CAAC,cAAc,EAAE;AACpD,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,eAAe,EAAE,CAAC;AACnE,CAAC;;ACFM,MAAM,eAAe,SAASC,cAAS,CAAC;AAC/C,IAAI,MAAM,IAAI,CAAC,OAAO,EAAE;AACxB,QAAQ,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AACrC,QAAQ,OAAO,OAAO,CAAC;AACvB,KAAK;AACL,IAAI,MAAM,YAAY,GAAG;AACzB,QAAQ,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;AACpC,QAAQ,OAAO;AACf,KAAK;AACL,IAAI,MAAM,WAAW,CAAC,OAAO,EAAE;AAC/B,QAAQ,OAAO,CAAC,GAAG,CAAC,aAAa,EAAE,OAAO,CAAC,CAAC;AAC5C,QAAQ,OAAO,OAAO,CAAC;AACvB,KAAK;AACL,IAAI,MAAM,KAAK,GAAG;AAClB,QAAQ,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;AAC7B,QAAQ,OAAO;AACf,KAAK;AACL,IAAI,MAAM,MAAM,CAAC,OAAO,EAAE;AAC1B,QAAQ,OAAO,CAAC,GAAG,CAAC,QAAQ,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC;AAC3C,QAAQ,OAAO;AACf,KAAK;AACL;;;;;;;;;"}
|
package/dist/plugin.js
CHANGED
|
@@ -23,6 +23,10 @@ var capacitorInAppBrowser = (function (exports, core) {
|
|
|
23
23
|
console.log("open", options);
|
|
24
24
|
return options;
|
|
25
25
|
}
|
|
26
|
+
async clearCookies() {
|
|
27
|
+
console.log("cleanCookies");
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
26
30
|
async openWebView(options) {
|
|
27
31
|
console.log("openWebView", options);
|
|
28
32
|
return options;
|
package/dist/plugin.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.js","sources":["esm/definitions.js","esm/index.js","esm/web.js"],"sourcesContent":["export var BackgroundColor;\n(function (BackgroundColor) {\n BackgroundColor[\"WHITE\"] = \"white\";\n BackgroundColor[\"BLACK\"] = \"black\";\n})(BackgroundColor || (BackgroundColor = {}));\nexport var ToolBarType;\n(function (ToolBarType) {\n ToolBarType[\"ACTIVITY\"] = \"activity\";\n ToolBarType[\"NAVIGATION\"] = \"navigation\";\n ToolBarType[\"BLANK\"] = \"blank\";\n ToolBarType[\"DEFAULT\"] = \"\";\n})(ToolBarType || (ToolBarType = {}));\n//# sourceMappingURL=definitions.js.map","import { registerPlugin } from \"@capacitor/core\";\nconst InAppBrowser = registerPlugin(\"InAppBrowser\", {\n web: () => import(\"./web\").then((m) => new m.InAppBrowserWeb()),\n});\nexport * from \"./definitions\";\nexport { InAppBrowser };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from \"@capacitor/core\";\nexport class InAppBrowserWeb extends WebPlugin {\n async open(options) {\n console.log(\"open\", options);\n return options;\n }\n async openWebView(options) {\n console.log(\"openWebView\", options);\n return options;\n }\n async close() {\n console.log(\"close\");\n return;\n }\n async setUrl(options) {\n console.log(\"setUrl\", options.url);\n return;\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["BackgroundColor","ToolBarType","registerPlugin","WebPlugin"],"mappings":";;;AAAWA,qCAAgB;IAC3B,CAAC,UAAU,eAAe,EAAE;IAC5B,IAAI,eAAe,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC;IACvC,IAAI,eAAe,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC;IACvC,CAAC,EAAEA,uBAAe,KAAKA,uBAAe,GAAG,EAAE,CAAC,CAAC,CAAC;AACnCC,iCAAY;IACvB,CAAC,UAAU,WAAW,EAAE;IACxB,IAAI,WAAW,CAAC,UAAU,CAAC,GAAG,UAAU,CAAC;IACzC,IAAI,WAAW,CAAC,YAAY,CAAC,GAAG,YAAY,CAAC;IAC7C,IAAI,WAAW,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC;IACnC,IAAI,WAAW,CAAC,SAAS,CAAC,GAAG,EAAE,CAAC;IAChC,CAAC,EAAEA,mBAAW,KAAKA,mBAAW,GAAG,EAAE,CAAC,CAAC;;ACVhC,UAAC,YAAY,GAAGC,mBAAc,CAAC,cAAc,EAAE;IACpD,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,eAAe,EAAE,CAAC;IACnE,CAAC;;ICFM,MAAM,eAAe,SAASC,cAAS,CAAC;IAC/C,IAAI,MAAM,IAAI,CAAC,OAAO,EAAE;IACxB,QAAQ,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACrC,QAAQ,OAAO,OAAO,CAAC;IACvB,KAAK;IACL,IAAI,MAAM,WAAW,CAAC,OAAO,EAAE;IAC/B,QAAQ,OAAO,CAAC,GAAG,CAAC,aAAa,EAAE,OAAO,CAAC,CAAC;IAC5C,QAAQ,OAAO,OAAO,CAAC;IACvB,KAAK;IACL,IAAI,MAAM,KAAK,GAAG;IAClB,QAAQ,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IAC7B,QAAQ,OAAO;IACf,KAAK;IACL,IAAI,MAAM,MAAM,CAAC,OAAO,EAAE;IAC1B,QAAQ,OAAO,CAAC,GAAG,CAAC,QAAQ,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC;IAC3C,QAAQ,OAAO;IACf,KAAK;IACL;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"plugin.js","sources":["esm/definitions.js","esm/index.js","esm/web.js"],"sourcesContent":["export var BackgroundColor;\n(function (BackgroundColor) {\n BackgroundColor[\"WHITE\"] = \"white\";\n BackgroundColor[\"BLACK\"] = \"black\";\n})(BackgroundColor || (BackgroundColor = {}));\nexport var ToolBarType;\n(function (ToolBarType) {\n ToolBarType[\"ACTIVITY\"] = \"activity\";\n ToolBarType[\"NAVIGATION\"] = \"navigation\";\n ToolBarType[\"BLANK\"] = \"blank\";\n ToolBarType[\"DEFAULT\"] = \"\";\n})(ToolBarType || (ToolBarType = {}));\n//# sourceMappingURL=definitions.js.map","import { registerPlugin } from \"@capacitor/core\";\nconst InAppBrowser = registerPlugin(\"InAppBrowser\", {\n web: () => import(\"./web\").then((m) => new m.InAppBrowserWeb()),\n});\nexport * from \"./definitions\";\nexport { InAppBrowser };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from \"@capacitor/core\";\nexport class InAppBrowserWeb extends WebPlugin {\n async open(options) {\n console.log(\"open\", options);\n return options;\n }\n async clearCookies() {\n console.log(\"cleanCookies\");\n return;\n }\n async openWebView(options) {\n console.log(\"openWebView\", options);\n return options;\n }\n async close() {\n console.log(\"close\");\n return;\n }\n async setUrl(options) {\n console.log(\"setUrl\", options.url);\n return;\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["BackgroundColor","ToolBarType","registerPlugin","WebPlugin"],"mappings":";;;AAAWA,qCAAgB;IAC3B,CAAC,UAAU,eAAe,EAAE;IAC5B,IAAI,eAAe,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC;IACvC,IAAI,eAAe,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC;IACvC,CAAC,EAAEA,uBAAe,KAAKA,uBAAe,GAAG,EAAE,CAAC,CAAC,CAAC;AACnCC,iCAAY;IACvB,CAAC,UAAU,WAAW,EAAE;IACxB,IAAI,WAAW,CAAC,UAAU,CAAC,GAAG,UAAU,CAAC;IACzC,IAAI,WAAW,CAAC,YAAY,CAAC,GAAG,YAAY,CAAC;IAC7C,IAAI,WAAW,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC;IACnC,IAAI,WAAW,CAAC,SAAS,CAAC,GAAG,EAAE,CAAC;IAChC,CAAC,EAAEA,mBAAW,KAAKA,mBAAW,GAAG,EAAE,CAAC,CAAC;;ACVhC,UAAC,YAAY,GAAGC,mBAAc,CAAC,cAAc,EAAE;IACpD,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,eAAe,EAAE,CAAC;IACnE,CAAC;;ICFM,MAAM,eAAe,SAASC,cAAS,CAAC;IAC/C,IAAI,MAAM,IAAI,CAAC,OAAO,EAAE;IACxB,QAAQ,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACrC,QAAQ,OAAO,OAAO,CAAC;IACvB,KAAK;IACL,IAAI,MAAM,YAAY,GAAG;IACzB,QAAQ,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;IACpC,QAAQ,OAAO;IACf,KAAK;IACL,IAAI,MAAM,WAAW,CAAC,OAAO,EAAE;IAC/B,QAAQ,OAAO,CAAC,GAAG,CAAC,aAAa,EAAE,OAAO,CAAC,CAAC;IAC5C,QAAQ,OAAO,OAAO,CAAC;IACvB,KAAK;IACL,IAAI,MAAM,KAAK,GAAG;IAClB,QAAQ,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IAC7B,QAAQ,OAAO;IACf,KAAK;IACL,IAAI,MAAM,MAAM,CAAC,OAAO,EAAE;IAC1B,QAAQ,OAAO,CAAC,GAAG,CAAC,QAAQ,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC;IAC3C,QAAQ,OAAO;IACf,KAAK;IACL;;;;;;;;;;;;;;;"}
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
// each method the plugin supports using the CAP_PLUGIN_METHOD macro.
|
|
6
6
|
CAP_PLUGIN(InAppBrowserPlugin, "InAppBrowser",
|
|
7
7
|
CAP_PLUGIN_METHOD(openWebView, CAPPluginReturnPromise);
|
|
8
|
+
CAP_PLUGIN_METHOD(clearCookies, CAPPluginReturnPromise);
|
|
8
9
|
CAP_PLUGIN_METHOD(open, CAPPluginReturnPromise);
|
|
9
10
|
CAP_PLUGIN_METHOD(setUrl, CAPPluginReturnPromise);
|
|
10
11
|
CAP_PLUGIN_METHOD(show, CAPPluginReturnPromise);
|
|
@@ -32,6 +32,10 @@ public class InAppBrowserPlugin: CAPPlugin {
|
|
|
32
32
|
})
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
+
func clearCookies() {
|
|
36
|
+
HTTPCookieStorage.shared.cookies?.forEach(HTTPCookieStorage.shared.deleteCookie)
|
|
37
|
+
}
|
|
38
|
+
|
|
35
39
|
@objc func openWebView(_ call: CAPPluginCall) {
|
|
36
40
|
if !self.isSetupDone {
|
|
37
41
|
self.setup()
|