@capgo/inappbrowser 7.0.0 → 7.1.1
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/CapgoInappbrowser.podspec +1 -1
- package/README.md +448 -54
- package/android/build.gradle +14 -13
- package/android/src/main/AndroidManifest.xml +3 -1
- package/android/src/main/java/ee/forgr/capacitor_inappbrowser/InAppBrowserPlugin.java +534 -35
- package/android/src/main/java/ee/forgr/capacitor_inappbrowser/Options.java +251 -0
- package/android/src/main/java/ee/forgr/capacitor_inappbrowser/WebViewCallbacks.java +4 -0
- package/android/src/main/java/ee/forgr/capacitor_inappbrowser/WebViewDialog.java +891 -19
- package/android/src/main/res/drawable/ic_refresh.xml +9 -0
- package/android/src/main/res/layout/tool_bar.xml +25 -3
- package/android/src/main/res/values/strings.xml +2 -0
- package/dist/docs.json +1365 -67
- package/dist/esm/definitions.d.ts +218 -9
- package/dist/esm/definitions.js.map +1 -1
- package/dist/esm/web.d.ts +10 -2
- package/dist/esm/web.js +26 -2
- package/dist/esm/web.js.map +1 -1
- package/dist/plugin.cjs.js +26 -2
- package/dist/plugin.cjs.js.map +1 -1
- package/dist/plugin.js +26 -2
- package/dist/plugin.js.map +1 -1
- package/ios/Plugin/InAppBrowserPlugin.m +5 -1
- package/ios/Plugin/InAppBrowserPlugin.swift +243 -12
- package/ios/Plugin/WKWebViewController.swift +299 -55
- package/package.json +26 -27
|
@@ -17,6 +17,7 @@ export interface BtnEvent {
|
|
|
17
17
|
}
|
|
18
18
|
export type UrlChangeListener = (state: UrlEvent) => void;
|
|
19
19
|
export type ConfirmBtnListener = (state: BtnEvent) => void;
|
|
20
|
+
export type ButtonNearListener = (state: {}) => void;
|
|
20
21
|
export declare enum BackgroundColor {
|
|
21
22
|
WHITE = "white",
|
|
22
23
|
BLACK = "black"
|
|
@@ -30,6 +31,17 @@ export declare enum ToolBarType {
|
|
|
30
31
|
export interface Headers {
|
|
31
32
|
[key: string]: string;
|
|
32
33
|
}
|
|
34
|
+
export interface GetCookieOptions {
|
|
35
|
+
url: string;
|
|
36
|
+
includeHttpOnly?: boolean;
|
|
37
|
+
}
|
|
38
|
+
export interface ClearCookieOptions {
|
|
39
|
+
url: string;
|
|
40
|
+
}
|
|
41
|
+
export interface Credentials {
|
|
42
|
+
username: string;
|
|
43
|
+
password: string;
|
|
44
|
+
}
|
|
33
45
|
export interface OpenOptions {
|
|
34
46
|
/**
|
|
35
47
|
* Target URL to load.
|
|
@@ -41,6 +53,11 @@ export interface OpenOptions {
|
|
|
41
53
|
* @since 0.1.0
|
|
42
54
|
*/
|
|
43
55
|
headers?: Headers;
|
|
56
|
+
/**
|
|
57
|
+
* Credentials to send with the request and all subsequent requests for the same host.
|
|
58
|
+
* @since 6.1.0
|
|
59
|
+
*/
|
|
60
|
+
credentials?: Credentials;
|
|
44
61
|
/**
|
|
45
62
|
* if true, the browser will be presented after the page is loaded, if false, the browser will be presented immediately.
|
|
46
63
|
* @since 0.1.0
|
|
@@ -65,6 +82,11 @@ export interface OpenWebViewOptions {
|
|
|
65
82
|
* @since 0.1.0
|
|
66
83
|
*/
|
|
67
84
|
headers?: Headers;
|
|
85
|
+
/**
|
|
86
|
+
* Credentials to send with the request and all subsequent requests for the same host.
|
|
87
|
+
* @since 6.1.0
|
|
88
|
+
*/
|
|
89
|
+
credentials?: Credentials;
|
|
68
90
|
/**
|
|
69
91
|
* share options
|
|
70
92
|
* @since 0.1.0
|
|
@@ -86,13 +108,26 @@ export interface OpenWebViewOptions {
|
|
|
86
108
|
* @since 0.1.0
|
|
87
109
|
* @default 'New Window'
|
|
88
110
|
*/
|
|
89
|
-
title
|
|
111
|
+
title?: string;
|
|
90
112
|
/**
|
|
91
113
|
* Background color of the browser, only on IOS
|
|
92
114
|
* @since 0.1.0
|
|
93
115
|
* @default BackgroundColor.BLACK
|
|
94
116
|
*/
|
|
95
117
|
backgroundColor?: BackgroundColor;
|
|
118
|
+
/**
|
|
119
|
+
* If true, active the native navigation within the webview, Android only
|
|
120
|
+
*
|
|
121
|
+
* @default false
|
|
122
|
+
*/
|
|
123
|
+
activeNativeNavigationForWebview?: boolean;
|
|
124
|
+
/**
|
|
125
|
+
* Disable the possibility to go back on native application,
|
|
126
|
+
* usefull to force user to stay on the webview, Android only
|
|
127
|
+
*
|
|
128
|
+
* @default false
|
|
129
|
+
*/
|
|
130
|
+
disableGoBackOnNativeApplication?: boolean;
|
|
96
131
|
/**
|
|
97
132
|
* Open url in a new window fullscreen
|
|
98
133
|
*
|
|
@@ -101,6 +136,117 @@ export interface OpenWebViewOptions {
|
|
|
101
136
|
* @default false
|
|
102
137
|
*/
|
|
103
138
|
isPresentAfterPageLoad?: boolean;
|
|
139
|
+
/**
|
|
140
|
+
* Whether the website in the webview is inspectable or not, ios only
|
|
141
|
+
*
|
|
142
|
+
* @default false
|
|
143
|
+
*/
|
|
144
|
+
isInspectable?: boolean;
|
|
145
|
+
/**
|
|
146
|
+
* Whether the webview opening is animated or not, ios only
|
|
147
|
+
*
|
|
148
|
+
* @default true
|
|
149
|
+
*/
|
|
150
|
+
isAnimated?: boolean;
|
|
151
|
+
/**
|
|
152
|
+
* Shows a reload button that reloads the web page
|
|
153
|
+
* @since 1.0.15
|
|
154
|
+
* @default false
|
|
155
|
+
*/
|
|
156
|
+
showReloadButton?: boolean;
|
|
157
|
+
/**
|
|
158
|
+
* CloseModal: if true a confirm will be displayed when user clicks on close button, if false the browser will be closed immediately.
|
|
159
|
+
*
|
|
160
|
+
* @since 1.1.0
|
|
161
|
+
* @default false
|
|
162
|
+
*/
|
|
163
|
+
closeModal?: boolean;
|
|
164
|
+
/**
|
|
165
|
+
* CloseModalTitle: title of the confirm when user clicks on close button, only on IOS
|
|
166
|
+
*
|
|
167
|
+
* @since 1.1.0
|
|
168
|
+
* @default 'Close'
|
|
169
|
+
*/
|
|
170
|
+
closeModalTitle?: string;
|
|
171
|
+
/**
|
|
172
|
+
* CloseModalDescription: description of the confirm when user clicks on close button, only on IOS
|
|
173
|
+
*
|
|
174
|
+
* @since 1.1.0
|
|
175
|
+
* @default 'Are you sure you want to close this window?'
|
|
176
|
+
*/
|
|
177
|
+
closeModalDescription?: string;
|
|
178
|
+
/**
|
|
179
|
+
* CloseModalOk: text of the confirm button when user clicks on close button, only on IOS
|
|
180
|
+
*
|
|
181
|
+
* @since 1.1.0
|
|
182
|
+
* @default 'Close'
|
|
183
|
+
*/
|
|
184
|
+
closeModalOk?: string;
|
|
185
|
+
/**
|
|
186
|
+
* CloseModalCancel: text of the cancel button when user clicks on close button, only on IOS
|
|
187
|
+
*
|
|
188
|
+
* @since 1.1.0
|
|
189
|
+
* @default 'Cancel'
|
|
190
|
+
*/
|
|
191
|
+
closeModalCancel?: string;
|
|
192
|
+
/**
|
|
193
|
+
* visibleTitle: if true the website title would be shown else shown empty
|
|
194
|
+
*
|
|
195
|
+
* @since 1.2.5
|
|
196
|
+
* @default true
|
|
197
|
+
*/
|
|
198
|
+
visibleTitle?: boolean;
|
|
199
|
+
/**
|
|
200
|
+
* toolbarColor: color of the toolbar in hex format
|
|
201
|
+
*
|
|
202
|
+
* @since 1.2.5
|
|
203
|
+
* @default '#ffffff''
|
|
204
|
+
*/
|
|
205
|
+
toolbarColor?: string;
|
|
206
|
+
/**
|
|
207
|
+
* showArrow: if true an arrow would be shown instead of cross for closing the window
|
|
208
|
+
*
|
|
209
|
+
* @since 1.2.5
|
|
210
|
+
* @default false
|
|
211
|
+
*/
|
|
212
|
+
showArrow?: boolean;
|
|
213
|
+
/**
|
|
214
|
+
* ignoreUntrustedSSLError: if true, the webview will ignore untrusted SSL errors allowing the user to view the website.
|
|
215
|
+
*
|
|
216
|
+
* @since 6.1.0
|
|
217
|
+
* @default false
|
|
218
|
+
*/
|
|
219
|
+
ignoreUntrustedSSLError?: boolean;
|
|
220
|
+
/**
|
|
221
|
+
* preShowScript: if isPresentAfterPageLoad is true and this variable is set the plugin will inject a script before showing the browser.
|
|
222
|
+
* This script will be run in an async context. The plugin will wait for the script to finish (max 10 seconds)
|
|
223
|
+
*
|
|
224
|
+
* @since 6.6.0
|
|
225
|
+
*/
|
|
226
|
+
preShowScript?: String;
|
|
227
|
+
/**
|
|
228
|
+
* proxyRequests is a regex expression. Please see [this pr](https://github.com/Cap-go/capacitor-inappbrowser/pull/222) for more info. (Android only)
|
|
229
|
+
*
|
|
230
|
+
* @since 6.9.0
|
|
231
|
+
*/
|
|
232
|
+
proxyRequests?: String;
|
|
233
|
+
/**
|
|
234
|
+
* buttonNearDone allows for a creation of a custom button. Please see [buttonNearDone.md](/buttonNearDone.md) for more info.
|
|
235
|
+
*
|
|
236
|
+
* @since 6.7.0
|
|
237
|
+
*/
|
|
238
|
+
buttonNearDone?: {
|
|
239
|
+
ios: {
|
|
240
|
+
iconType: "sf-symbol" | "asset";
|
|
241
|
+
icon: String;
|
|
242
|
+
};
|
|
243
|
+
android: {
|
|
244
|
+
iconType: "asset";
|
|
245
|
+
icon: String;
|
|
246
|
+
width?: number;
|
|
247
|
+
height?: number;
|
|
248
|
+
};
|
|
249
|
+
};
|
|
104
250
|
}
|
|
105
251
|
export interface InAppBrowserPlugin {
|
|
106
252
|
/**
|
|
@@ -110,43 +256,106 @@ export interface InAppBrowserPlugin {
|
|
|
110
256
|
*/
|
|
111
257
|
open(options: OpenOptions): Promise<any>;
|
|
112
258
|
/**
|
|
113
|
-
* Clear
|
|
259
|
+
* Clear cookies of url
|
|
114
260
|
*
|
|
115
261
|
* @since 0.5.0
|
|
116
262
|
*/
|
|
117
|
-
clearCookies(): Promise<any>;
|
|
263
|
+
clearCookies(options: ClearCookieOptions): Promise<any>;
|
|
264
|
+
/**
|
|
265
|
+
* Clear all cookies
|
|
266
|
+
*
|
|
267
|
+
* @since 6.5.0
|
|
268
|
+
*/
|
|
269
|
+
clearAllCookies(): Promise<any>;
|
|
270
|
+
/**
|
|
271
|
+
* Clear cache
|
|
272
|
+
*
|
|
273
|
+
* @since 6.5.0
|
|
274
|
+
*/
|
|
275
|
+
clearCache(): Promise<any>;
|
|
276
|
+
/**
|
|
277
|
+
* Get cookies for a specific URL.
|
|
278
|
+
* @param options The options, including the URL to get cookies for.
|
|
279
|
+
* @returns A promise that resolves with the cookies.
|
|
280
|
+
*/
|
|
281
|
+
getCookies(options: GetCookieOptions): Promise<Record<string, string>>;
|
|
282
|
+
/**
|
|
283
|
+
* Close the webview.
|
|
284
|
+
*/
|
|
118
285
|
close(): Promise<any>;
|
|
119
286
|
/**
|
|
120
|
-
* Open url in a new webview with toolbars
|
|
287
|
+
* Open url in a new webview with toolbars, and enhanced capabilities, like camera access, file access, listen events, inject javascript, bi directional communication, etc.
|
|
121
288
|
*
|
|
122
289
|
* @since 0.1.0
|
|
123
290
|
*/
|
|
124
291
|
openWebView(options: OpenWebViewOptions): Promise<any>;
|
|
292
|
+
/**
|
|
293
|
+
* Injects JavaScript code into the InAppBrowser window.
|
|
294
|
+
*/
|
|
295
|
+
executeScript({ code }: {
|
|
296
|
+
code: string;
|
|
297
|
+
}): Promise<void>;
|
|
298
|
+
/**
|
|
299
|
+
* Sends an event to the webview. you can listen to this event with addListener("messageFromWebview", listenerFunc: (event: Record<string, any>) => void)
|
|
300
|
+
* detail is the data you want to send to the webview, it's a requirement of Capacitor we cannot send direct objects
|
|
301
|
+
* Your object has to be serializable to JSON, so no functions or other non-JSON-serializable types are allowed.
|
|
302
|
+
*/
|
|
303
|
+
postMessage(options: {
|
|
304
|
+
detail: Record<string, any>;
|
|
305
|
+
}): Promise<void>;
|
|
306
|
+
/**
|
|
307
|
+
* Sets the URL of the webview.
|
|
308
|
+
*/
|
|
125
309
|
setUrl(options: {
|
|
126
310
|
url: string;
|
|
127
311
|
}): Promise<any>;
|
|
128
312
|
/**
|
|
129
|
-
* Listen for url change
|
|
313
|
+
* Listen for url change, only for openWebView
|
|
130
314
|
*
|
|
131
315
|
* @since 0.0.1
|
|
132
316
|
*/
|
|
133
|
-
addListener(eventName: "urlChangeEvent", listenerFunc: UrlChangeListener): Promise<PluginListenerHandle
|
|
317
|
+
addListener(eventName: "urlChangeEvent", listenerFunc: UrlChangeListener): Promise<PluginListenerHandle>;
|
|
318
|
+
addListener(eventName: "buttonNearDoneClick", listenerFunc: ButtonNearListener): Promise<PluginListenerHandle>;
|
|
134
319
|
/**
|
|
135
|
-
* Listen for close click
|
|
320
|
+
* Listen for close click only for openWebView
|
|
136
321
|
*
|
|
137
322
|
* @since 0.4.0
|
|
138
323
|
*/
|
|
139
|
-
addListener(eventName: "closeEvent", listenerFunc: UrlChangeListener): Promise<PluginListenerHandle
|
|
324
|
+
addListener(eventName: "closeEvent", listenerFunc: UrlChangeListener): Promise<PluginListenerHandle>;
|
|
140
325
|
/**
|
|
141
326
|
* Will be triggered when user clicks on confirm button when disclaimer is required, works only on iOS
|
|
142
327
|
*
|
|
143
328
|
* @since 0.0.1
|
|
144
329
|
*/
|
|
145
|
-
addListener(eventName: "confirmBtnClicked", listenerFunc: ConfirmBtnListener): Promise<PluginListenerHandle
|
|
330
|
+
addListener(eventName: "confirmBtnClicked", listenerFunc: ConfirmBtnListener): Promise<PluginListenerHandle>;
|
|
331
|
+
/**
|
|
332
|
+
* Will be triggered when event is sent from webview, to send an event to the webview use window.mobileApp.postMessage({ "detail": { "message": "myMessage" } })
|
|
333
|
+
* detail is the data you want to send to the webview, it's a requirement of Capacitor we cannot send direct objects
|
|
334
|
+
* Your object has to be serializable to JSON, so no functions or other non-JSON-serializable types are allowed.
|
|
335
|
+
*
|
|
336
|
+
* This method is inject at runtime in the webview
|
|
337
|
+
*/
|
|
338
|
+
addListener(eventName: "messageFromWebview", listenerFunc: (event: {
|
|
339
|
+
detail: Record<string, any>;
|
|
340
|
+
}) => void): Promise<PluginListenerHandle>;
|
|
341
|
+
/**
|
|
342
|
+
* Will be triggered when page is loaded
|
|
343
|
+
*/
|
|
344
|
+
addListener(eventName: "browserPageLoaded", listenerFunc: () => void): Promise<PluginListenerHandle>;
|
|
345
|
+
/**
|
|
346
|
+
* Will be triggered when page load error
|
|
347
|
+
*/
|
|
348
|
+
addListener(eventName: "pageLoadError", listenerFunc: () => void): Promise<PluginListenerHandle>;
|
|
146
349
|
/**
|
|
147
350
|
* Remove all listeners for this plugin.
|
|
148
351
|
*
|
|
149
352
|
* @since 1.0.0
|
|
150
353
|
*/
|
|
151
354
|
removeAllListeners(): Promise<void>;
|
|
355
|
+
/**
|
|
356
|
+
* Reload the current web page.
|
|
357
|
+
*
|
|
358
|
+
* @since 1.0.0
|
|
359
|
+
*/
|
|
360
|
+
reload(): Promise<any>;
|
|
152
361
|
}
|
|
@@ -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\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"]}
|
|
1
|
+
{"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"AAuBA,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;\nexport type ButtonNearListener = (state: {}) => 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 GetCookieOptions {\n url: string;\n includeHttpOnly?: boolean;\n}\n\nexport interface ClearCookieOptions {\n url: string;\n}\n\nexport interface Credentials {\n username: string;\n password: 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 * Credentials to send with the request and all subsequent requests for the same host.\n * @since 6.1.0\n */\n credentials?: Credentials;\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 * Credentials to send with the request and all subsequent requests for the same host.\n * @since 6.1.0\n */\n credentials?: Credentials;\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 * If true, active the native navigation within the webview, Android only\n *\n * @default false\n */\n activeNativeNavigationForWebview?: boolean;\n /**\n * Disable the possibility to go back on native application,\n * usefull to force user to stay on the webview, Android only\n *\n * @default false\n */\n disableGoBackOnNativeApplication?: boolean;\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 * Whether the website in the webview is inspectable or not, ios only\n *\n * @default false\n */\n isInspectable?: boolean;\n /**\n * Whether the webview opening is animated or not, ios only\n *\n * @default true\n */\n isAnimated?: boolean;\n /**\n * Shows a reload button that reloads the web page\n * @since 1.0.15\n * @default false\n */\n showReloadButton?: boolean;\n /**\n * CloseModal: if true a confirm will be displayed when user clicks on close button, if false the browser will be closed immediately.\n *\n * @since 1.1.0\n * @default false\n */\n closeModal?: boolean;\n /**\n * CloseModalTitle: title of the confirm when user clicks on close button, only on IOS\n *\n * @since 1.1.0\n * @default 'Close'\n */\n closeModalTitle?: string;\n /**\n * CloseModalDescription: description of the confirm when user clicks on close button, only on IOS\n *\n * @since 1.1.0\n * @default 'Are you sure you want to close this window?'\n */\n closeModalDescription?: string;\n /**\n * CloseModalOk: text of the confirm button when user clicks on close button, only on IOS\n *\n * @since 1.1.0\n * @default 'Close'\n */\n closeModalOk?: string;\n /**\n * CloseModalCancel: text of the cancel button when user clicks on close button, only on IOS\n *\n * @since 1.1.0\n * @default 'Cancel'\n */\n closeModalCancel?: string;\n /**\n * visibleTitle: if true the website title would be shown else shown empty\n *\n * @since 1.2.5\n * @default true\n */\n visibleTitle?: boolean;\n /**\n * toolbarColor: color of the toolbar in hex format\n *\n * @since 1.2.5\n * @default '#ffffff''\n */\n toolbarColor?: string;\n /**\n * showArrow: if true an arrow would be shown instead of cross for closing the window\n *\n * @since 1.2.5\n * @default false\n */\n showArrow?: boolean;\n /**\n * ignoreUntrustedSSLError: if true, the webview will ignore untrusted SSL errors allowing the user to view the website.\n *\n * @since 6.1.0\n * @default false\n */\n ignoreUntrustedSSLError?: boolean;\n /**\n * preShowScript: if isPresentAfterPageLoad is true and this variable is set the plugin will inject a script before showing the browser.\n * This script will be run in an async context. The plugin will wait for the script to finish (max 10 seconds)\n *\n * @since 6.6.0\n */\n preShowScript?: String;\n /**\n * proxyRequests is a regex expression. Please see [this pr](https://github.com/Cap-go/capacitor-inappbrowser/pull/222) for more info. (Android only)\n *\n * @since 6.9.0\n */\n proxyRequests?: String;\n /**\n * buttonNearDone allows for a creation of a custom button. Please see [buttonNearDone.md](/buttonNearDone.md) for more info.\n *\n * @since 6.7.0\n */\n buttonNearDone?: {\n ios: {\n iconType: \"sf-symbol\" | \"asset\";\n icon: String;\n };\n android: {\n iconType: \"asset\";\n icon: String;\n width?: number;\n height?: number;\n };\n };\n}\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 cookies of url\n *\n * @since 0.5.0\n */\n clearCookies(options: ClearCookieOptions): Promise<any>;\n /**\n * Clear all cookies\n *\n * @since 6.5.0\n */\n clearAllCookies(): Promise<any>;\n\n /**\n * Clear cache\n *\n * @since 6.5.0\n */\n clearCache(): Promise<any>;\n\n /**\n * Get cookies for a specific URL.\n * @param options The options, including the URL to get cookies for.\n * @returns A promise that resolves with the cookies.\n */\n getCookies(options: GetCookieOptions): Promise<Record<string, string>>;\n /**\n * Close the webview.\n */\n close(): Promise<any>;\n /**\n * Open url in a new webview with toolbars, and enhanced capabilities, like camera access, file access, listen events, inject javascript, bi directional communication, etc.\n *\n * @since 0.1.0\n */\n openWebView(options: OpenWebViewOptions): Promise<any>;\n /**\n * Injects JavaScript code into the InAppBrowser window.\n */\n executeScript({ code }: { code: string }): Promise<void>;\n /**\n * Sends an event to the webview. you can listen to this event with addListener(\"messageFromWebview\", listenerFunc: (event: Record<string, any>) => void)\n * detail is the data you want to send to the webview, it's a requirement of Capacitor we cannot send direct objects\n * Your object has to be serializable to JSON, so no functions or other non-JSON-serializable types are allowed.\n */\n postMessage(options: { detail: Record<string, any> }): Promise<void>;\n /**\n * Sets the URL of the webview.\n */\n setUrl(options: { url: string }): Promise<any>;\n /**\n * Listen for url change, only for openWebView\n *\n * @since 0.0.1\n */\n addListener(\n eventName: \"urlChangeEvent\",\n listenerFunc: UrlChangeListener,\n ): Promise<PluginListenerHandle>;\n\n addListener(\n eventName: \"buttonNearDoneClick\",\n listenerFunc: ButtonNearListener,\n ): Promise<PluginListenerHandle>;\n\n /**\n * Listen for close click only for openWebView\n *\n * @since 0.4.0\n */\n addListener(\n eventName: \"closeEvent\",\n listenerFunc: UrlChangeListener,\n ): Promise<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>;\n /**\n * Will be triggered when event is sent from webview, to send an event to the webview use window.mobileApp.postMessage({ \"detail\": { \"message\": \"myMessage\" } })\n * detail is the data you want to send to the webview, it's a requirement of Capacitor we cannot send direct objects\n * Your object has to be serializable to JSON, so no functions or other non-JSON-serializable types are allowed.\n *\n * This method is inject at runtime in the webview\n */\n addListener(\n eventName: \"messageFromWebview\",\n listenerFunc: (event: { detail: Record<string, any> }) => void,\n ): Promise<PluginListenerHandle>;\n\n /**\n * Will be triggered when page is loaded\n */\n addListener(\n eventName: \"browserPageLoaded\",\n listenerFunc: () => void,\n ): Promise<PluginListenerHandle>;\n\n /**\n * Will be triggered when page load error\n */\n addListener(\n eventName: \"pageLoadError\",\n listenerFunc: () => void,\n ): Promise<PluginListenerHandle>;\n /**\n * Remove all listeners for this plugin.\n *\n * @since 1.0.0\n */\n removeAllListeners(): Promise<void>;\n\n /**\n * Reload the current web page.\n *\n * @since 1.0.0\n */\n reload(): Promise<any>; // Add this line\n}\n"]}
|
package/dist/esm/web.d.ts
CHANGED
|
@@ -1,11 +1,19 @@
|
|
|
1
1
|
import { WebPlugin } from "@capacitor/core";
|
|
2
|
-
import type { InAppBrowserPlugin, OpenWebViewOptions, OpenOptions } from "./definitions";
|
|
2
|
+
import type { InAppBrowserPlugin, OpenWebViewOptions, OpenOptions, GetCookieOptions, ClearCookieOptions } from "./definitions";
|
|
3
3
|
export declare class InAppBrowserWeb extends WebPlugin implements InAppBrowserPlugin {
|
|
4
|
+
clearAllCookies(): Promise<any>;
|
|
5
|
+
clearCache(): Promise<any>;
|
|
4
6
|
open(options: OpenOptions): Promise<any>;
|
|
5
|
-
clearCookies(): Promise<any>;
|
|
7
|
+
clearCookies(options: ClearCookieOptions): Promise<any>;
|
|
8
|
+
getCookies(options: GetCookieOptions): Promise<any>;
|
|
6
9
|
openWebView(options: OpenWebViewOptions): Promise<any>;
|
|
10
|
+
executeScript({ code }: {
|
|
11
|
+
code: string;
|
|
12
|
+
}): Promise<any>;
|
|
7
13
|
close(): Promise<any>;
|
|
8
14
|
setUrl(options: {
|
|
9
15
|
url: string;
|
|
10
16
|
}): Promise<any>;
|
|
17
|
+
reload(): Promise<any>;
|
|
18
|
+
postMessage(options: Record<string, any>): Promise<any>;
|
|
11
19
|
}
|
package/dist/esm/web.js
CHANGED
|
@@ -1,17 +1,33 @@
|
|
|
1
1
|
import { WebPlugin } from "@capacitor/core";
|
|
2
2
|
export class InAppBrowserWeb extends WebPlugin {
|
|
3
|
+
clearAllCookies() {
|
|
4
|
+
console.log("clearAllCookies");
|
|
5
|
+
return Promise.resolve();
|
|
6
|
+
}
|
|
7
|
+
clearCache() {
|
|
8
|
+
console.log("clearCache");
|
|
9
|
+
return Promise.resolve();
|
|
10
|
+
}
|
|
3
11
|
async open(options) {
|
|
4
12
|
console.log("open", options);
|
|
5
13
|
return options;
|
|
6
14
|
}
|
|
7
|
-
async clearCookies() {
|
|
8
|
-
console.log("cleanCookies");
|
|
15
|
+
async clearCookies(options) {
|
|
16
|
+
console.log("cleanCookies", options);
|
|
9
17
|
return;
|
|
10
18
|
}
|
|
19
|
+
async getCookies(options) {
|
|
20
|
+
// Web implementation to get cookies
|
|
21
|
+
return options;
|
|
22
|
+
}
|
|
11
23
|
async openWebView(options) {
|
|
12
24
|
console.log("openWebView", options);
|
|
13
25
|
return options;
|
|
14
26
|
}
|
|
27
|
+
async executeScript({ code }) {
|
|
28
|
+
console.log("code", code);
|
|
29
|
+
return code;
|
|
30
|
+
}
|
|
15
31
|
async close() {
|
|
16
32
|
console.log("close");
|
|
17
33
|
return;
|
|
@@ -20,5 +36,13 @@ export class InAppBrowserWeb extends WebPlugin {
|
|
|
20
36
|
console.log("setUrl", options.url);
|
|
21
37
|
return;
|
|
22
38
|
}
|
|
39
|
+
async reload() {
|
|
40
|
+
console.log("reload");
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
async postMessage(options) {
|
|
44
|
+
console.log("postMessage", options);
|
|
45
|
+
return options;
|
|
46
|
+
}
|
|
23
47
|
}
|
|
24
48
|
//# sourceMappingURL=web.js.map
|
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;
|
|
1
|
+
{"version":3,"file":"web.js","sourceRoot":"","sources":["../../src/web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAU5C,MAAM,OAAO,eAAgB,SAAQ,SAAS;IAC5C,eAAe;QACb,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;QAC/B,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;IAC3B,CAAC;IACD,UAAU;QACR,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;QAC1B,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;IAC3B,CAAC;IACD,KAAK,CAAC,IAAI,CAAC,OAAoB;QAC7B,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QAC7B,OAAO,OAAO,CAAC;IACjB,CAAC;IAED,KAAK,CAAC,YAAY,CAAC,OAA2B;QAC5C,OAAO,CAAC,GAAG,CAAC,cAAc,EAAE,OAAO,CAAC,CAAC;QACrC,OAAO;IACT,CAAC;IAED,KAAK,CAAC,UAAU,CAAC,OAAyB;QACxC,oCAAoC;QACpC,OAAO,OAAO,CAAC;IACjB,CAAC;IAED,KAAK,CAAC,WAAW,CAAC,OAA2B;QAC3C,OAAO,CAAC,GAAG,CAAC,aAAa,EAAE,OAAO,CAAC,CAAC;QACpC,OAAO,OAAO,CAAC;IACjB,CAAC;IAED,KAAK,CAAC,aAAa,CAAC,EAAE,IAAI,EAAoB;QAC5C,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;QAC1B,OAAO,IAAI,CAAC;IACd,CAAC;IAED,KAAK,CAAC,KAAK;QACT,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;QACrB,OAAO;IACT,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,OAAwB;QACnC,OAAO,CAAC,GAAG,CAAC,QAAQ,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC;QACnC,OAAO;IACT,CAAC;IAED,KAAK,CAAC,MAAM;QACV,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;QACtB,OAAO;IACT,CAAC;IACD,KAAK,CAAC,WAAW,CAAC,OAA4B;QAC5C,OAAO,CAAC,GAAG,CAAC,aAAa,EAAE,OAAO,CAAC,CAAC;QACpC,OAAO,OAAO,CAAC;IACjB,CAAC;CACF","sourcesContent":["import { WebPlugin } from \"@capacitor/core\";\n\nimport type {\n InAppBrowserPlugin,\n OpenWebViewOptions,\n OpenOptions,\n GetCookieOptions,\n ClearCookieOptions,\n} from \"./definitions\";\n\nexport class InAppBrowserWeb extends WebPlugin implements InAppBrowserPlugin {\n clearAllCookies(): Promise<any> {\n console.log(\"clearAllCookies\");\n return Promise.resolve();\n }\n clearCache(): Promise<any> {\n console.log(\"clearCache\");\n return Promise.resolve();\n }\n async open(options: OpenOptions): Promise<any> {\n console.log(\"open\", options);\n return options;\n }\n\n async clearCookies(options: ClearCookieOptions): Promise<any> {\n console.log(\"cleanCookies\", options);\n return;\n }\n\n async getCookies(options: GetCookieOptions): Promise<any> {\n // Web implementation to get cookies\n return options;\n }\n\n async openWebView(options: OpenWebViewOptions): Promise<any> {\n console.log(\"openWebView\", options);\n return options;\n }\n\n async executeScript({ code }: { code: string }): Promise<any> {\n console.log(\"code\", code);\n return code;\n }\n\n async close(): Promise<any> {\n console.log(\"close\");\n return;\n }\n\n async setUrl(options: { url: string }): Promise<any> {\n console.log(\"setUrl\", options.url);\n return;\n }\n\n async reload(): Promise<any> {\n console.log(\"reload\");\n return;\n }\n async postMessage(options: Record<string, any>): Promise<any> {\n console.log(\"postMessage\", options);\n return options;\n }\n}\n"]}
|
package/dist/plugin.cjs.js
CHANGED
|
@@ -20,18 +20,34 @@ const InAppBrowser = core.registerPlugin("InAppBrowser", {
|
|
|
20
20
|
});
|
|
21
21
|
|
|
22
22
|
class InAppBrowserWeb extends core.WebPlugin {
|
|
23
|
+
clearAllCookies() {
|
|
24
|
+
console.log("clearAllCookies");
|
|
25
|
+
return Promise.resolve();
|
|
26
|
+
}
|
|
27
|
+
clearCache() {
|
|
28
|
+
console.log("clearCache");
|
|
29
|
+
return Promise.resolve();
|
|
30
|
+
}
|
|
23
31
|
async open(options) {
|
|
24
32
|
console.log("open", options);
|
|
25
33
|
return options;
|
|
26
34
|
}
|
|
27
|
-
async clearCookies() {
|
|
28
|
-
console.log("cleanCookies");
|
|
35
|
+
async clearCookies(options) {
|
|
36
|
+
console.log("cleanCookies", options);
|
|
29
37
|
return;
|
|
30
38
|
}
|
|
39
|
+
async getCookies(options) {
|
|
40
|
+
// Web implementation to get cookies
|
|
41
|
+
return options;
|
|
42
|
+
}
|
|
31
43
|
async openWebView(options) {
|
|
32
44
|
console.log("openWebView", options);
|
|
33
45
|
return options;
|
|
34
46
|
}
|
|
47
|
+
async executeScript({ code }) {
|
|
48
|
+
console.log("code", code);
|
|
49
|
+
return code;
|
|
50
|
+
}
|
|
35
51
|
async close() {
|
|
36
52
|
console.log("close");
|
|
37
53
|
return;
|
|
@@ -40,6 +56,14 @@ class InAppBrowserWeb extends core.WebPlugin {
|
|
|
40
56
|
console.log("setUrl", options.url);
|
|
41
57
|
return;
|
|
42
58
|
}
|
|
59
|
+
async reload() {
|
|
60
|
+
console.log("reload");
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
async postMessage(options) {
|
|
64
|
+
console.log("postMessage", options);
|
|
65
|
+
return options;
|
|
66
|
+
}
|
|
43
67
|
}
|
|
44
68
|
|
|
45
69
|
var web = /*#__PURE__*/Object.freeze({
|
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 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
|
|
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 clearAllCookies() {\n console.log(\"clearAllCookies\");\n return Promise.resolve();\n }\n clearCache() {\n console.log(\"clearCache\");\n return Promise.resolve();\n }\n async open(options) {\n console.log(\"open\", options);\n return options;\n }\n async clearCookies(options) {\n console.log(\"cleanCookies\", options);\n return;\n }\n async getCookies(options) {\n // Web implementation to get cookies\n return options;\n }\n async openWebView(options) {\n console.log(\"openWebView\", options);\n return options;\n }\n async executeScript({ code }) {\n console.log(\"code\", code);\n return code;\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 async reload() {\n console.log(\"reload\");\n return;\n }\n async postMessage(options) {\n console.log(\"postMessage\", options);\n return options;\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["BackgroundColor","ToolBarType","registerPlugin","WebPlugin"],"mappings":";;;;AAAWA;AACX,CAAC,UAAU,eAAe,EAAE;AAC5B,IAAI,eAAe,CAAC,OAAO,CAAC,GAAG,OAAO;AACtC,IAAI,eAAe,CAAC,OAAO,CAAC,GAAG,OAAO;AACtC,CAAC,EAAEA,uBAAe,KAAKA,uBAAe,GAAG,EAAE,CAAC,CAAC;AAClCC;AACX,CAAC,UAAU,WAAW,EAAE;AACxB,IAAI,WAAW,CAAC,UAAU,CAAC,GAAG,UAAU;AACxC,IAAI,WAAW,CAAC,YAAY,CAAC,GAAG,YAAY;AAC5C,IAAI,WAAW,CAAC,OAAO,CAAC,GAAG,OAAO;AAClC,IAAI,WAAW,CAAC,SAAS,CAAC,GAAG,EAAE;AAC/B,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,eAAe,GAAG;AACtB,QAAQ,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAC;AACtC,QAAQ,OAAO,OAAO,CAAC,OAAO,EAAE;AAChC;AACA,IAAI,UAAU,GAAG;AACjB,QAAQ,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC;AACjC,QAAQ,OAAO,OAAO,CAAC,OAAO,EAAE;AAChC;AACA,IAAI,MAAM,IAAI,CAAC,OAAO,EAAE;AACxB,QAAQ,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC;AACpC,QAAQ,OAAO,OAAO;AACtB;AACA,IAAI,MAAM,YAAY,CAAC,OAAO,EAAE;AAChC,QAAQ,OAAO,CAAC,GAAG,CAAC,cAAc,EAAE,OAAO,CAAC;AAC5C,QAAQ;AACR;AACA,IAAI,MAAM,UAAU,CAAC,OAAO,EAAE;AAC9B;AACA,QAAQ,OAAO,OAAO;AACtB;AACA,IAAI,MAAM,WAAW,CAAC,OAAO,EAAE;AAC/B,QAAQ,OAAO,CAAC,GAAG,CAAC,aAAa,EAAE,OAAO,CAAC;AAC3C,QAAQ,OAAO,OAAO;AACtB;AACA,IAAI,MAAM,aAAa,CAAC,EAAE,IAAI,EAAE,EAAE;AAClC,QAAQ,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,IAAI,CAAC;AACjC,QAAQ,OAAO,IAAI;AACnB;AACA,IAAI,MAAM,KAAK,GAAG;AAClB,QAAQ,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC;AAC5B,QAAQ;AACR;AACA,IAAI,MAAM,MAAM,CAAC,OAAO,EAAE;AAC1B,QAAQ,OAAO,CAAC,GAAG,CAAC,QAAQ,EAAE,OAAO,CAAC,GAAG,CAAC;AAC1C,QAAQ;AACR;AACA,IAAI,MAAM,MAAM,GAAG;AACnB,QAAQ,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC;AAC7B,QAAQ;AACR;AACA,IAAI,MAAM,WAAW,CAAC,OAAO,EAAE;AAC/B,QAAQ,OAAO,CAAC,GAAG,CAAC,aAAa,EAAE,OAAO,CAAC;AAC3C,QAAQ,OAAO,OAAO;AACtB;AACA;;;;;;;;;"}
|
package/dist/plugin.js
CHANGED
|
@@ -19,18 +19,34 @@ var capacitorInAppBrowser = (function (exports, core) {
|
|
|
19
19
|
});
|
|
20
20
|
|
|
21
21
|
class InAppBrowserWeb extends core.WebPlugin {
|
|
22
|
+
clearAllCookies() {
|
|
23
|
+
console.log("clearAllCookies");
|
|
24
|
+
return Promise.resolve();
|
|
25
|
+
}
|
|
26
|
+
clearCache() {
|
|
27
|
+
console.log("clearCache");
|
|
28
|
+
return Promise.resolve();
|
|
29
|
+
}
|
|
22
30
|
async open(options) {
|
|
23
31
|
console.log("open", options);
|
|
24
32
|
return options;
|
|
25
33
|
}
|
|
26
|
-
async clearCookies() {
|
|
27
|
-
console.log("cleanCookies");
|
|
34
|
+
async clearCookies(options) {
|
|
35
|
+
console.log("cleanCookies", options);
|
|
28
36
|
return;
|
|
29
37
|
}
|
|
38
|
+
async getCookies(options) {
|
|
39
|
+
// Web implementation to get cookies
|
|
40
|
+
return options;
|
|
41
|
+
}
|
|
30
42
|
async openWebView(options) {
|
|
31
43
|
console.log("openWebView", options);
|
|
32
44
|
return options;
|
|
33
45
|
}
|
|
46
|
+
async executeScript({ code }) {
|
|
47
|
+
console.log("code", code);
|
|
48
|
+
return code;
|
|
49
|
+
}
|
|
34
50
|
async close() {
|
|
35
51
|
console.log("close");
|
|
36
52
|
return;
|
|
@@ -39,6 +55,14 @@ var capacitorInAppBrowser = (function (exports, core) {
|
|
|
39
55
|
console.log("setUrl", options.url);
|
|
40
56
|
return;
|
|
41
57
|
}
|
|
58
|
+
async reload() {
|
|
59
|
+
console.log("reload");
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
async postMessage(options) {
|
|
63
|
+
console.log("postMessage", options);
|
|
64
|
+
return options;
|
|
65
|
+
}
|
|
42
66
|
}
|
|
43
67
|
|
|
44
68
|
var web = /*#__PURE__*/Object.freeze({
|
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 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
|
|
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 clearAllCookies() {\n console.log(\"clearAllCookies\");\n return Promise.resolve();\n }\n clearCache() {\n console.log(\"clearCache\");\n return Promise.resolve();\n }\n async open(options) {\n console.log(\"open\", options);\n return options;\n }\n async clearCookies(options) {\n console.log(\"cleanCookies\", options);\n return;\n }\n async getCookies(options) {\n // Web implementation to get cookies\n return options;\n }\n async openWebView(options) {\n console.log(\"openWebView\", options);\n return options;\n }\n async executeScript({ code }) {\n console.log(\"code\", code);\n return code;\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 async reload() {\n console.log(\"reload\");\n return;\n }\n async postMessage(options) {\n console.log(\"postMessage\", options);\n return options;\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["BackgroundColor","ToolBarType","registerPlugin","WebPlugin"],"mappings":";;;AAAWA;IACX,CAAC,UAAU,eAAe,EAAE;IAC5B,IAAI,eAAe,CAAC,OAAO,CAAC,GAAG,OAAO;IACtC,IAAI,eAAe,CAAC,OAAO,CAAC,GAAG,OAAO;IACtC,CAAC,EAAEA,uBAAe,KAAKA,uBAAe,GAAG,EAAE,CAAC,CAAC;AAClCC;IACX,CAAC,UAAU,WAAW,EAAE;IACxB,IAAI,WAAW,CAAC,UAAU,CAAC,GAAG,UAAU;IACxC,IAAI,WAAW,CAAC,YAAY,CAAC,GAAG,YAAY;IAC5C,IAAI,WAAW,CAAC,OAAO,CAAC,GAAG,OAAO;IAClC,IAAI,WAAW,CAAC,SAAS,CAAC,GAAG,EAAE;IAC/B,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,eAAe,GAAG;IACtB,QAAQ,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAC;IACtC,QAAQ,OAAO,OAAO,CAAC,OAAO,EAAE;IAChC;IACA,IAAI,UAAU,GAAG;IACjB,QAAQ,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC;IACjC,QAAQ,OAAO,OAAO,CAAC,OAAO,EAAE;IAChC;IACA,IAAI,MAAM,IAAI,CAAC,OAAO,EAAE;IACxB,QAAQ,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC;IACpC,QAAQ,OAAO,OAAO;IACtB;IACA,IAAI,MAAM,YAAY,CAAC,OAAO,EAAE;IAChC,QAAQ,OAAO,CAAC,GAAG,CAAC,cAAc,EAAE,OAAO,CAAC;IAC5C,QAAQ;IACR;IACA,IAAI,MAAM,UAAU,CAAC,OAAO,EAAE;IAC9B;IACA,QAAQ,OAAO,OAAO;IACtB;IACA,IAAI,MAAM,WAAW,CAAC,OAAO,EAAE;IAC/B,QAAQ,OAAO,CAAC,GAAG,CAAC,aAAa,EAAE,OAAO,CAAC;IAC3C,QAAQ,OAAO,OAAO;IACtB;IACA,IAAI,MAAM,aAAa,CAAC,EAAE,IAAI,EAAE,EAAE;IAClC,QAAQ,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,IAAI,CAAC;IACjC,QAAQ,OAAO,IAAI;IACnB;IACA,IAAI,MAAM,KAAK,GAAG;IAClB,QAAQ,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC;IAC5B,QAAQ;IACR;IACA,IAAI,MAAM,MAAM,CAAC,OAAO,EAAE;IAC1B,QAAQ,OAAO,CAAC,GAAG,CAAC,QAAQ,EAAE,OAAO,CAAC,GAAG,CAAC;IAC1C,QAAQ;IACR;IACA,IAAI,MAAM,MAAM,GAAG;IACnB,QAAQ,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC;IAC7B,QAAQ;IACR;IACA,IAAI,MAAM,WAAW,CAAC,OAAO,EAAE;IAC/B,QAAQ,OAAO,CAAC,GAAG,CAAC,aAAa,EAAE,OAAO,CAAC;IAC3C,QAAQ,OAAO,OAAO;IACtB;IACA;;;;;;;;;;;;;;;"}
|
|
@@ -6,12 +6,16 @@
|
|
|
6
6
|
CAP_PLUGIN(InAppBrowserPlugin, "InAppBrowser",
|
|
7
7
|
CAP_PLUGIN_METHOD(openWebView, CAPPluginReturnPromise);
|
|
8
8
|
CAP_PLUGIN_METHOD(clearCookies, CAPPluginReturnPromise);
|
|
9
|
+
CAP_PLUGIN_METHOD(getCookies, CAPPluginReturnPromise);
|
|
10
|
+
CAP_PLUGIN_METHOD(clearAllCookies, CAPPluginReturnPromise);
|
|
11
|
+
CAP_PLUGIN_METHOD(clearCache, CAPPluginReturnPromise);
|
|
12
|
+
CAP_PLUGIN_METHOD(reload, CAPPluginReturnPromise);
|
|
9
13
|
CAP_PLUGIN_METHOD(open, CAPPluginReturnPromise);
|
|
10
14
|
CAP_PLUGIN_METHOD(setUrl, CAPPluginReturnPromise);
|
|
11
15
|
CAP_PLUGIN_METHOD(show, CAPPluginReturnPromise);
|
|
12
16
|
CAP_PLUGIN_METHOD(close, CAPPluginReturnPromise);
|
|
13
17
|
CAP_PLUGIN_METHOD(hide, CAPPluginReturnPromise);
|
|
14
18
|
CAP_PLUGIN_METHOD(executeScript, CAPPluginReturnPromise);
|
|
19
|
+
CAP_PLUGIN_METHOD(postMessage, CAPPluginReturnPromise);
|
|
15
20
|
CAP_PLUGIN_METHOD(insertCSS, CAPPluginReturnPromise);
|
|
16
|
-
CAP_PLUGIN_METHOD(removeAllListeners, CAPPluginReturnPromise);
|
|
17
21
|
)
|