@capawesome/capacitor-in-app-browser 0.0.1 → 0.0.2
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 +108 -48
- package/android/src/main/java/io/capawesome/capacitorjs/plugins/inappbrowser/InAppBrowser.java +25 -5
- package/android/src/main/java/io/capawesome/capacitorjs/plugins/inappbrowser/InAppBrowserPlugin.java +37 -10
- package/android/src/main/java/io/capawesome/capacitorjs/plugins/inappbrowser/classes/WebViewDialog.java +40 -2
- package/android/src/main/java/io/capawesome/capacitorjs/plugins/inappbrowser/classes/events/{MessageReceivedEvent.java → BrowserMessageReceivedEvent.java} +2 -2
- package/android/src/main/java/io/capawesome/capacitorjs/plugins/inappbrowser/classes/events/{BrowserPageNavigationCompletedEvent.java → BrowserNavigationCompletedEvent.java} +2 -2
- package/android/src/main/java/io/capawesome/capacitorjs/plugins/inappbrowser/classes/events/BrowserUrlChangedEvent.java +23 -0
- package/android/src/main/java/io/capawesome/capacitorjs/plugins/inappbrowser/classes/options/OpenInWebViewOptions.java +7 -0
- package/dist/docs.json +114 -24
- package/dist/esm/definitions.d.ts +62 -12
- package/dist/esm/definitions.js.map +1 -1
- package/dist/esm/web.d.ts +1 -0
- package/dist/esm/web.js +3 -0
- package/dist/esm/web.js.map +1 -1
- package/dist/plugin.cjs.js +3 -0
- package/dist/plugin.cjs.js.map +1 -1
- package/dist/plugin.js +3 -0
- package/dist/plugin.js.map +1 -1
- package/ios/Plugin/Classes/Events/{MessageReceivedEvent.swift → BrowserMessageReceivedEvent.swift} +1 -1
- package/ios/Plugin/Classes/Events/{BrowserPageNavigationCompletedEvent.swift → BrowserNavigationCompletedEvent.swift} +1 -1
- package/ios/Plugin/Classes/Events/BrowserUrlChangedEvent.swift +16 -0
- package/ios/Plugin/Classes/Options/OpenInWebViewOptions.swift +2 -0
- package/ios/Plugin/Classes/WebViewController.swift +18 -2
- package/ios/Plugin/InAppBrowser.swift +45 -4
- package/ios/Plugin/InAppBrowserPlugin.swift +25 -9
- package/package.json +2 -2
package/dist/docs.json
CHANGED
|
@@ -190,6 +190,21 @@
|
|
|
190
190
|
],
|
|
191
191
|
"slug": "postmessage"
|
|
192
192
|
},
|
|
193
|
+
{
|
|
194
|
+
"name": "show",
|
|
195
|
+
"signature": "() => Promise<void>",
|
|
196
|
+
"parameters": [],
|
|
197
|
+
"returns": "Promise<void>",
|
|
198
|
+
"tags": [
|
|
199
|
+
{
|
|
200
|
+
"name": "since",
|
|
201
|
+
"text": "0.1.0"
|
|
202
|
+
}
|
|
203
|
+
],
|
|
204
|
+
"docs": "Show the web view if it was opened with `visible: false`.\n\nThis method is only available for browsers opened with\n`openInWebView(...)`.\n\nOnly available on Android and iOS.",
|
|
205
|
+
"complexTypes": [],
|
|
206
|
+
"slug": "show"
|
|
207
|
+
},
|
|
193
208
|
{
|
|
194
209
|
"name": "addListener",
|
|
195
210
|
"signature": "(eventName: 'browserClosed', listenerFunc: () => void) => Promise<PluginListenerHandle>",
|
|
@@ -220,17 +235,17 @@
|
|
|
220
235
|
},
|
|
221
236
|
{
|
|
222
237
|
"name": "addListener",
|
|
223
|
-
"signature": "(eventName: '
|
|
238
|
+
"signature": "(eventName: 'browserMessageReceived', listenerFunc: (event: BrowserMessageReceivedEvent) => void) => Promise<PluginListenerHandle>",
|
|
224
239
|
"parameters": [
|
|
225
240
|
{
|
|
226
241
|
"name": "eventName",
|
|
227
242
|
"docs": "",
|
|
228
|
-
"type": "'
|
|
243
|
+
"type": "'browserMessageReceived'"
|
|
229
244
|
},
|
|
230
245
|
{
|
|
231
246
|
"name": "listenerFunc",
|
|
232
247
|
"docs": "",
|
|
233
|
-
"type": "() => void"
|
|
248
|
+
"type": "(event: BrowserMessageReceivedEvent) => void"
|
|
234
249
|
}
|
|
235
250
|
],
|
|
236
251
|
"returns": "Promise<PluginListenerHandle>",
|
|
@@ -240,25 +255,26 @@
|
|
|
240
255
|
"text": "0.1.0"
|
|
241
256
|
}
|
|
242
257
|
],
|
|
243
|
-
"docs": "Called when the
|
|
258
|
+
"docs": "Called when the web page posts a message to the app using the injected\n`window.CapacitorInAppBrowser.postMessage(...)` function.\n\nThis event is only emitted for browsers opened with `openInWebView(...)`.\n\nOnly available on Android and iOS.",
|
|
244
259
|
"complexTypes": [
|
|
245
|
-
"PluginListenerHandle"
|
|
260
|
+
"PluginListenerHandle",
|
|
261
|
+
"BrowserMessageReceivedEvent"
|
|
246
262
|
],
|
|
247
|
-
"slug": "
|
|
263
|
+
"slug": "addlistenerbrowsermessagereceived-"
|
|
248
264
|
},
|
|
249
265
|
{
|
|
250
266
|
"name": "addListener",
|
|
251
|
-
"signature": "(eventName: '
|
|
267
|
+
"signature": "(eventName: 'browserNavigationCompleted', listenerFunc: (event: BrowserNavigationCompletedEvent) => void) => Promise<PluginListenerHandle>",
|
|
252
268
|
"parameters": [
|
|
253
269
|
{
|
|
254
270
|
"name": "eventName",
|
|
255
271
|
"docs": "",
|
|
256
|
-
"type": "'
|
|
272
|
+
"type": "'browserNavigationCompleted'"
|
|
257
273
|
},
|
|
258
274
|
{
|
|
259
275
|
"name": "listenerFunc",
|
|
260
276
|
"docs": "",
|
|
261
|
-
"type": "(event:
|
|
277
|
+
"type": "(event: BrowserNavigationCompletedEvent) => void"
|
|
262
278
|
}
|
|
263
279
|
],
|
|
264
280
|
"returns": "Promise<PluginListenerHandle>",
|
|
@@ -271,23 +287,23 @@
|
|
|
271
287
|
"docs": "Called when a page navigation has been completed in the web view.\n\nThis event is only emitted for browsers opened with `openInWebView(...)`.\n\nOnly available on Android and iOS.",
|
|
272
288
|
"complexTypes": [
|
|
273
289
|
"PluginListenerHandle",
|
|
274
|
-
"
|
|
290
|
+
"BrowserNavigationCompletedEvent"
|
|
275
291
|
],
|
|
276
|
-
"slug": "
|
|
292
|
+
"slug": "addlistenerbrowsernavigationcompleted-"
|
|
277
293
|
},
|
|
278
294
|
{
|
|
279
295
|
"name": "addListener",
|
|
280
|
-
"signature": "(eventName: '
|
|
296
|
+
"signature": "(eventName: 'browserPageLoaded', listenerFunc: () => void) => Promise<PluginListenerHandle>",
|
|
281
297
|
"parameters": [
|
|
282
298
|
{
|
|
283
299
|
"name": "eventName",
|
|
284
300
|
"docs": "",
|
|
285
|
-
"type": "'
|
|
301
|
+
"type": "'browserPageLoaded'"
|
|
286
302
|
},
|
|
287
303
|
{
|
|
288
304
|
"name": "listenerFunc",
|
|
289
305
|
"docs": "",
|
|
290
|
-
"type": "(
|
|
306
|
+
"type": "() => void"
|
|
291
307
|
}
|
|
292
308
|
],
|
|
293
309
|
"returns": "Promise<PluginListenerHandle>",
|
|
@@ -297,12 +313,40 @@
|
|
|
297
313
|
"text": "0.1.0"
|
|
298
314
|
}
|
|
299
315
|
],
|
|
300
|
-
"docs": "Called when the
|
|
316
|
+
"docs": "Called when the initial page of the browser has finished loading.\n\nOn Android, this event is only emitted for browsers opened with\n`openInWebView(...)`.\n\nOnly available on Android and iOS.",
|
|
317
|
+
"complexTypes": [
|
|
318
|
+
"PluginListenerHandle"
|
|
319
|
+
],
|
|
320
|
+
"slug": "addlistenerbrowserpageloaded-"
|
|
321
|
+
},
|
|
322
|
+
{
|
|
323
|
+
"name": "addListener",
|
|
324
|
+
"signature": "(eventName: 'browserUrlChanged', listenerFunc: (event: BrowserUrlChangedEvent) => void) => Promise<PluginListenerHandle>",
|
|
325
|
+
"parameters": [
|
|
326
|
+
{
|
|
327
|
+
"name": "eventName",
|
|
328
|
+
"docs": "",
|
|
329
|
+
"type": "'browserUrlChanged'"
|
|
330
|
+
},
|
|
331
|
+
{
|
|
332
|
+
"name": "listenerFunc",
|
|
333
|
+
"docs": "",
|
|
334
|
+
"type": "(event: BrowserUrlChangedEvent) => void"
|
|
335
|
+
}
|
|
336
|
+
],
|
|
337
|
+
"returns": "Promise<PluginListenerHandle>",
|
|
338
|
+
"tags": [
|
|
339
|
+
{
|
|
340
|
+
"name": "since",
|
|
341
|
+
"text": "0.1.0"
|
|
342
|
+
}
|
|
343
|
+
],
|
|
344
|
+
"docs": "Called when the current URL of the web view changes, e.g. when the user\nnavigates to a new page, a server redirect occurs, or a single-page\napplication updates the browser history.\n\nThis event is also emitted for the initial URL and fires earlier than\n`browserNavigationCompleted`.\n\nThis event is only emitted for browsers opened with `openInWebView(...)`.\n\nOnly available on Android and iOS.",
|
|
301
345
|
"complexTypes": [
|
|
302
346
|
"PluginListenerHandle",
|
|
303
|
-
"
|
|
347
|
+
"BrowserUrlChangedEvent"
|
|
304
348
|
],
|
|
305
|
-
"slug": "
|
|
349
|
+
"slug": "addlistenerbrowserurlchanged-"
|
|
306
350
|
},
|
|
307
351
|
{
|
|
308
352
|
"name": "removeAllListeners",
|
|
@@ -796,6 +840,22 @@
|
|
|
796
840
|
"docs": "The custom user agent to use for the web view.",
|
|
797
841
|
"complexTypes": [],
|
|
798
842
|
"type": "string | undefined"
|
|
843
|
+
},
|
|
844
|
+
{
|
|
845
|
+
"name": "visible",
|
|
846
|
+
"tags": [
|
|
847
|
+
{
|
|
848
|
+
"text": "true",
|
|
849
|
+
"name": "default"
|
|
850
|
+
},
|
|
851
|
+
{
|
|
852
|
+
"text": "0.1.0",
|
|
853
|
+
"name": "since"
|
|
854
|
+
}
|
|
855
|
+
],
|
|
856
|
+
"docs": "Whether or not the web view is presented when opened.\n\nIf `false`, the web view loads the URL in the background and stays\nhidden until `show()` is called. The `browserPageLoaded` event is\nstill emitted and `close()` can be called while the web view is\nhidden.",
|
|
857
|
+
"complexTypes": [],
|
|
858
|
+
"type": "boolean | undefined"
|
|
799
859
|
}
|
|
800
860
|
]
|
|
801
861
|
},
|
|
@@ -1076,8 +1136,34 @@
|
|
|
1076
1136
|
]
|
|
1077
1137
|
},
|
|
1078
1138
|
{
|
|
1079
|
-
"name": "
|
|
1080
|
-
"slug": "
|
|
1139
|
+
"name": "BrowserMessageReceivedEvent",
|
|
1140
|
+
"slug": "browsermessagereceivedevent",
|
|
1141
|
+
"docs": "",
|
|
1142
|
+
"tags": [
|
|
1143
|
+
{
|
|
1144
|
+
"text": "0.1.0",
|
|
1145
|
+
"name": "since"
|
|
1146
|
+
}
|
|
1147
|
+
],
|
|
1148
|
+
"methods": [],
|
|
1149
|
+
"properties": [
|
|
1150
|
+
{
|
|
1151
|
+
"name": "data",
|
|
1152
|
+
"tags": [
|
|
1153
|
+
{
|
|
1154
|
+
"text": "0.1.0",
|
|
1155
|
+
"name": "since"
|
|
1156
|
+
}
|
|
1157
|
+
],
|
|
1158
|
+
"docs": "The message data posted by the web page.",
|
|
1159
|
+
"complexTypes": [],
|
|
1160
|
+
"type": "unknown"
|
|
1161
|
+
}
|
|
1162
|
+
]
|
|
1163
|
+
},
|
|
1164
|
+
{
|
|
1165
|
+
"name": "BrowserNavigationCompletedEvent",
|
|
1166
|
+
"slug": "browsernavigationcompletedevent",
|
|
1081
1167
|
"docs": "",
|
|
1082
1168
|
"tags": [
|
|
1083
1169
|
{
|
|
@@ -1106,8 +1192,8 @@
|
|
|
1106
1192
|
]
|
|
1107
1193
|
},
|
|
1108
1194
|
{
|
|
1109
|
-
"name": "
|
|
1110
|
-
"slug": "
|
|
1195
|
+
"name": "BrowserUrlChangedEvent",
|
|
1196
|
+
"slug": "browserurlchangedevent",
|
|
1111
1197
|
"docs": "",
|
|
1112
1198
|
"tags": [
|
|
1113
1199
|
{
|
|
@@ -1118,16 +1204,20 @@
|
|
|
1118
1204
|
"methods": [],
|
|
1119
1205
|
"properties": [
|
|
1120
1206
|
{
|
|
1121
|
-
"name": "
|
|
1207
|
+
"name": "url",
|
|
1122
1208
|
"tags": [
|
|
1209
|
+
{
|
|
1210
|
+
"text": "'https://capawesome.io'",
|
|
1211
|
+
"name": "example"
|
|
1212
|
+
},
|
|
1123
1213
|
{
|
|
1124
1214
|
"text": "0.1.0",
|
|
1125
1215
|
"name": "since"
|
|
1126
1216
|
}
|
|
1127
1217
|
],
|
|
1128
|
-
"docs": "The
|
|
1218
|
+
"docs": "The new URL of the web view.",
|
|
1129
1219
|
"complexTypes": [],
|
|
1130
|
-
"type": "
|
|
1220
|
+
"type": "string"
|
|
1131
1221
|
}
|
|
1132
1222
|
]
|
|
1133
1223
|
}
|
|
@@ -87,6 +87,17 @@ export interface InAppBrowserPlugin {
|
|
|
87
87
|
* @since 0.1.0
|
|
88
88
|
*/
|
|
89
89
|
postMessage(options: PostMessageOptions): Promise<void>;
|
|
90
|
+
/**
|
|
91
|
+
* Show the web view if it was opened with `visible: false`.
|
|
92
|
+
*
|
|
93
|
+
* This method is only available for browsers opened with
|
|
94
|
+
* `openInWebView(...)`.
|
|
95
|
+
*
|
|
96
|
+
* Only available on Android and iOS.
|
|
97
|
+
*
|
|
98
|
+
* @since 0.1.0
|
|
99
|
+
*/
|
|
100
|
+
show(): Promise<void>;
|
|
90
101
|
/**
|
|
91
102
|
* Called when the browser is closed.
|
|
92
103
|
*
|
|
@@ -96,16 +107,16 @@ export interface InAppBrowserPlugin {
|
|
|
96
107
|
*/
|
|
97
108
|
addListener(eventName: 'browserClosed', listenerFunc: () => void): Promise<PluginListenerHandle>;
|
|
98
109
|
/**
|
|
99
|
-
* Called when the
|
|
110
|
+
* Called when the web page posts a message to the app using the injected
|
|
111
|
+
* `window.CapacitorInAppBrowser.postMessage(...)` function.
|
|
100
112
|
*
|
|
101
|
-
*
|
|
102
|
-
* `openInWebView(...)`.
|
|
113
|
+
* This event is only emitted for browsers opened with `openInWebView(...)`.
|
|
103
114
|
*
|
|
104
115
|
* Only available on Android and iOS.
|
|
105
116
|
*
|
|
106
117
|
* @since 0.1.0
|
|
107
118
|
*/
|
|
108
|
-
addListener(eventName: '
|
|
119
|
+
addListener(eventName: 'browserMessageReceived', listenerFunc: (event: BrowserMessageReceivedEvent) => void): Promise<PluginListenerHandle>;
|
|
109
120
|
/**
|
|
110
121
|
* Called when a page navigation has been completed in the web view.
|
|
111
122
|
*
|
|
@@ -115,10 +126,25 @@ export interface InAppBrowserPlugin {
|
|
|
115
126
|
*
|
|
116
127
|
* @since 0.1.0
|
|
117
128
|
*/
|
|
118
|
-
addListener(eventName: '
|
|
129
|
+
addListener(eventName: 'browserNavigationCompleted', listenerFunc: (event: BrowserNavigationCompletedEvent) => void): Promise<PluginListenerHandle>;
|
|
119
130
|
/**
|
|
120
|
-
* Called when the
|
|
121
|
-
*
|
|
131
|
+
* Called when the initial page of the browser has finished loading.
|
|
132
|
+
*
|
|
133
|
+
* On Android, this event is only emitted for browsers opened with
|
|
134
|
+
* `openInWebView(...)`.
|
|
135
|
+
*
|
|
136
|
+
* Only available on Android and iOS.
|
|
137
|
+
*
|
|
138
|
+
* @since 0.1.0
|
|
139
|
+
*/
|
|
140
|
+
addListener(eventName: 'browserPageLoaded', listenerFunc: () => void): Promise<PluginListenerHandle>;
|
|
141
|
+
/**
|
|
142
|
+
* Called when the current URL of the web view changes, e.g. when the user
|
|
143
|
+
* navigates to a new page, a server redirect occurs, or a single-page
|
|
144
|
+
* application updates the browser history.
|
|
145
|
+
*
|
|
146
|
+
* This event is also emitted for the initial URL and fires earlier than
|
|
147
|
+
* `browserNavigationCompleted`.
|
|
122
148
|
*
|
|
123
149
|
* This event is only emitted for browsers opened with `openInWebView(...)`.
|
|
124
150
|
*
|
|
@@ -126,7 +152,7 @@ export interface InAppBrowserPlugin {
|
|
|
126
152
|
*
|
|
127
153
|
* @since 0.1.0
|
|
128
154
|
*/
|
|
129
|
-
addListener(eventName: '
|
|
155
|
+
addListener(eventName: 'browserUrlChanged', listenerFunc: (event: BrowserUrlChangedEvent) => void): Promise<PluginListenerHandle>;
|
|
130
156
|
/**
|
|
131
157
|
* Remove all listeners for this plugin.
|
|
132
158
|
*
|
|
@@ -301,6 +327,18 @@ export interface OpenInWebViewOptions {
|
|
|
301
327
|
* @since 0.1.0
|
|
302
328
|
*/
|
|
303
329
|
userAgent?: string;
|
|
330
|
+
/**
|
|
331
|
+
* Whether or not the web view is presented when opened.
|
|
332
|
+
*
|
|
333
|
+
* If `false`, the web view loads the URL in the background and stays
|
|
334
|
+
* hidden until `show()` is called. The `browserPageLoaded` event is
|
|
335
|
+
* still emitted and `close()` can be called while the web view is
|
|
336
|
+
* hidden.
|
|
337
|
+
*
|
|
338
|
+
* @default true
|
|
339
|
+
* @since 0.1.0
|
|
340
|
+
*/
|
|
341
|
+
visible?: boolean;
|
|
304
342
|
}
|
|
305
343
|
/**
|
|
306
344
|
* @since 0.1.0
|
|
@@ -480,7 +518,18 @@ export interface GetCookiesResult {
|
|
|
480
518
|
/**
|
|
481
519
|
* @since 0.1.0
|
|
482
520
|
*/
|
|
483
|
-
export interface
|
|
521
|
+
export interface BrowserMessageReceivedEvent {
|
|
522
|
+
/**
|
|
523
|
+
* The message data posted by the web page.
|
|
524
|
+
*
|
|
525
|
+
* @since 0.1.0
|
|
526
|
+
*/
|
|
527
|
+
data: unknown;
|
|
528
|
+
}
|
|
529
|
+
/**
|
|
530
|
+
* @since 0.1.0
|
|
531
|
+
*/
|
|
532
|
+
export interface BrowserNavigationCompletedEvent {
|
|
484
533
|
/**
|
|
485
534
|
* The URL of the page that was navigated to.
|
|
486
535
|
*
|
|
@@ -492,13 +541,14 @@ export interface BrowserPageNavigationCompletedEvent {
|
|
|
492
541
|
/**
|
|
493
542
|
* @since 0.1.0
|
|
494
543
|
*/
|
|
495
|
-
export interface
|
|
544
|
+
export interface BrowserUrlChangedEvent {
|
|
496
545
|
/**
|
|
497
|
-
* The
|
|
546
|
+
* The new URL of the web view.
|
|
498
547
|
*
|
|
548
|
+
* @example 'https://capawesome.io'
|
|
499
549
|
* @since 0.1.0
|
|
500
550
|
*/
|
|
501
|
-
|
|
551
|
+
url: string;
|
|
502
552
|
}
|
|
503
553
|
/**
|
|
504
554
|
* The style of the dismiss button in the toolbar of the system browser.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"AAoiBA;;GAEG;AACH,MAAM,CAAN,IAAY,SAaX;AAbD,WAAY,SAAS;IACnB;;;;OAIG;IACH,kDAAqC,CAAA;IACrC;;;;OAIG;IACH,8CAAiC,CAAA;AACnC,CAAC,EAbW,SAAS,KAAT,SAAS,QAapB","sourcesContent":["import type { PluginListenerHandle } from '@capacitor/core';\n\nexport interface InAppBrowserPlugin {\n /**\n * Clear the cache of the web view.\n *\n * Only available on Android and iOS.\n *\n * @since 0.1.0\n */\n clearCache(): Promise<void>;\n /**\n * Clear the session data (cookies and web storage) of the web view.\n *\n * Only available on Android and iOS.\n *\n * @since 0.1.0\n */\n clearSessionData(): Promise<void>;\n /**\n * Close the currently open browser.\n *\n * This closes browsers opened with `openInWebView(...)` or\n * `openInSystemBrowser(...)`.\n *\n * Only available on Android and iOS.\n *\n * @since 0.1.0\n */\n close(): Promise<void>;\n /**\n * Execute a JavaScript script in the currently open web view.\n *\n * This method is only available for browsers opened with\n * `openInWebView(...)`.\n *\n * Only available on Android and iOS.\n *\n * @since 0.1.0\n */\n executeScript(options: ExecuteScriptOptions): Promise<ExecuteScriptResult>;\n /**\n * Get the cookies for a specific URL.\n *\n * On iOS, only cookies from the shared data store are returned. Cookies from\n * a web view opened with `dataStore: 'isolated'` are not included.\n *\n * Only available on Android and iOS.\n *\n * @since 0.1.0\n */\n getCookies(options: GetCookiesOptions): Promise<GetCookiesResult>;\n /**\n * Open a URL in the default browser app of the device.\n *\n * @since 0.1.0\n */\n openInExternalBrowser(options: OpenInExternalBrowserOptions): Promise<void>;\n /**\n * Open a URL in the system browser (Custom Tabs on Android,\n * `SFSafariViewController` on iOS).\n *\n * Only available on Android and iOS.\n *\n * @since 0.1.0\n */\n openInSystemBrowser(options: OpenInSystemBrowserOptions): Promise<void>;\n /**\n * Open a URL in an embedded web view with a native toolbar.\n *\n * Only available on Android and iOS.\n *\n * @since 0.1.0\n */\n openInWebView(options: OpenInWebViewOptions): Promise<void>;\n /**\n * Post a message to the currently open web view.\n *\n * The web page receives the message by listening for the\n * `capacitorInAppBrowserMessage` window event. The message data is\n * available in the `detail` property of the event.\n *\n * This method is only available for browsers opened with\n * `openInWebView(...)`.\n *\n * Only available on Android and iOS.\n *\n * @since 0.1.0\n */\n postMessage(options: PostMessageOptions): Promise<void>;\n /**\n * Called when the browser is closed.\n *\n * Only available on Android and iOS.\n *\n * @since 0.1.0\n */\n addListener(\n eventName: 'browserClosed',\n listenerFunc: () => void,\n ): Promise<PluginListenerHandle>;\n /**\n * Called when the initial page of the browser has finished loading.\n *\n * On Android, this event is only emitted for browsers opened with\n * `openInWebView(...)`.\n *\n * Only available on Android and iOS.\n *\n * @since 0.1.0\n */\n addListener(\n eventName: 'browserPageLoaded',\n listenerFunc: () => void,\n ): Promise<PluginListenerHandle>;\n /**\n * Called when a page navigation has been completed in the web view.\n *\n * This event is only emitted for browsers opened with `openInWebView(...)`.\n *\n * Only available on Android and iOS.\n *\n * @since 0.1.0\n */\n addListener(\n eventName: 'browserPageNavigationCompleted',\n listenerFunc: (event: BrowserPageNavigationCompletedEvent) => void,\n ): Promise<PluginListenerHandle>;\n /**\n * Called when the web page posts a message to the app using the injected\n * `window.CapacitorInAppBrowser.postMessage(...)` function.\n *\n * This event is only emitted for browsers opened with `openInWebView(...)`.\n *\n * Only available on Android and iOS.\n *\n * @since 0.1.0\n */\n addListener(\n eventName: 'messageReceived',\n listenerFunc: (event: MessageReceivedEvent) => void,\n ): Promise<PluginListenerHandle>;\n /**\n * Remove all listeners for this plugin.\n *\n * @since 0.1.0\n */\n removeAllListeners(): Promise<void>;\n}\n\n/**\n * @since 0.1.0\n */\nexport interface OpenInExternalBrowserOptions {\n /**\n * The URL to open in the external browser.\n *\n * @example 'https://capawesome.io'\n * @since 0.1.0\n */\n url: string;\n}\n\n/**\n * @since 0.1.0\n */\nexport interface OpenInSystemBrowserOptions {\n /**\n * Options that are only applied on Android.\n *\n * Only available on Android.\n *\n * @since 0.1.0\n */\n android?: OpenInSystemBrowserAndroidOptions;\n /**\n * Options that are only applied on iOS.\n *\n * Only available on iOS.\n *\n * @since 0.1.0\n */\n ios?: OpenInSystemBrowserIosOptions;\n /**\n * The URL to open in the system browser.\n *\n * @example 'https://capawesome.io'\n * @since 0.1.0\n */\n url: string;\n}\n\n/**\n * @since 0.1.0\n */\nexport interface OpenInSystemBrowserAndroidOptions {\n /**\n * Whether or not the toolbar should be hidden when the user scrolls down\n * and shown when the user scrolls up.\n *\n * @default false\n * @since 0.1.0\n */\n hideToolbarOnScroll?: boolean;\n /**\n * Whether or not the title of the web page should be shown in the toolbar.\n *\n * @default false\n * @since 0.1.0\n */\n showTitle?: boolean;\n /**\n * The background color of the toolbar as a hex color code.\n *\n * @example '#008080'\n * @since 0.1.0\n */\n toolbarColor?: string;\n}\n\n/**\n * @since 0.1.0\n */\nexport interface OpenInSystemBrowserIosOptions {\n /**\n * Whether or not the toolbar should collapse when the user scrolls down.\n *\n * @default true\n * @since 0.1.0\n */\n barCollapsing?: boolean;\n /**\n * The style of the dismiss button in the toolbar.\n *\n * @default 'done'\n * @since 0.1.0\n */\n dismissButtonStyle?: DismissButtonStyle;\n /**\n * Whether or not the reader mode should be entered if it is available for\n * the web page.\n *\n * @default false\n * @since 0.1.0\n */\n readerMode?: boolean;\n /**\n * The background color of the toolbar as a hex color code.\n *\n * @example '#008080'\n * @since 0.1.0\n */\n toolbarColor?: string;\n}\n\n/**\n * @since 0.1.0\n */\nexport interface OpenInWebViewOptions {\n /**\n * Options that are only applied on Android.\n *\n * Only available on Android.\n *\n * @since 0.1.0\n */\n android?: OpenInWebViewAndroidOptions;\n /**\n * The data store to use for the web view.\n *\n * On Android, this option is ignored. The web view always uses the\n * app-global (`shared`) data store.\n *\n * Only available on iOS.\n *\n * @default 'shared'\n * @since 0.1.0\n */\n dataStore?: WebViewDataStore;\n /**\n * Additional HTTP headers to send with the initial request.\n *\n * @since 0.1.0\n */\n headers?: { [key: string]: string };\n /**\n * Options that are only applied on iOS.\n *\n * Only available on iOS.\n *\n * @since 0.1.0\n */\n ios?: OpenInWebViewIosOptions;\n /**\n * Whether or not media playback requires user action.\n *\n * @default false\n * @since 0.1.0\n */\n mediaPlaybackRequiresUserAction?: boolean;\n /**\n * Options for the toolbar of the web view.\n *\n * @since 0.1.0\n */\n toolbar?: WebViewToolbarOptions;\n /**\n * The URL to open in the web view.\n *\n * @example 'https://capawesome.io'\n * @since 0.1.0\n */\n url: string;\n /**\n * The custom user agent to use for the web view.\n *\n * @since 0.1.0\n */\n userAgent?: string;\n}\n\n/**\n * @since 0.1.0\n */\nexport interface WebViewToolbarOptions {\n /**\n * The background color of the toolbar as a hex color code.\n *\n * @example '#008080'\n * @since 0.1.0\n */\n backgroundColor?: string;\n /**\n * The text of the close button in the toolbar.\n *\n * @default 'Close'\n * @since 0.1.0\n */\n closeButtonText?: string;\n /**\n * The text color of the toolbar as a hex color code.\n *\n * @example '#FFFFFF'\n * @since 0.1.0\n */\n color?: string;\n /**\n * Whether or not the back and forward navigation buttons should be shown\n * in the toolbar.\n *\n * @default false\n * @since 0.1.0\n */\n showNavigationButtons?: boolean;\n /**\n * Whether or not the current URL should be displayed in the toolbar\n * instead of the title.\n *\n * @default false\n * @since 0.1.0\n */\n showUrl?: boolean;\n /**\n * The fixed title to display in the toolbar.\n *\n * If not set, the title of the current web page is displayed.\n *\n * @since 0.1.0\n */\n title?: string;\n /**\n * Whether or not the toolbar should be visible.\n *\n * @default true\n * @since 0.1.0\n */\n visible?: boolean;\n}\n\n/**\n * @since 0.1.0\n */\nexport interface OpenInWebViewAndroidOptions {\n /**\n * Whether or not the user can zoom the web page.\n *\n * @default false\n * @since 0.1.0\n */\n allowZoom?: boolean;\n /**\n * Whether or not the hardware back button navigates back in the web view's\n * history before closing the web view.\n *\n * If `false`, the hardware back button closes the web view immediately.\n *\n * @default true\n * @since 0.1.0\n */\n hardwareBackButton?: boolean;\n /**\n * Whether or not media playback is paused when the app is hidden.\n *\n * @default true\n * @since 0.1.0\n */\n pauseMediaWhenHidden?: boolean;\n}\n\n/**\n * @since 0.1.0\n */\nexport interface OpenInWebViewIosOptions {\n /**\n * Whether or not horizontal swipe gestures navigate back and forward in\n * the web view's history.\n *\n * @default false\n * @since 0.1.0\n */\n allowsBackForwardNavigationGestures?: boolean;\n /**\n * Whether or not the web view bounces when scrolled past the edge of the\n * content.\n *\n * @default true\n * @since 0.1.0\n */\n overscroll?: boolean;\n}\n\n/**\n * @since 0.1.0\n */\nexport interface ExecuteScriptOptions {\n /**\n * The JavaScript code to execute in the web view.\n *\n * @example 'document.title'\n * @since 0.1.0\n */\n script: string;\n}\n\n/**\n * @since 0.1.0\n */\nexport interface ExecuteScriptResult {\n /**\n * The result of the script execution serialized as a JSON string.\n *\n * If the script does not return a JSON-serializable value, `null` is\n * returned.\n *\n * @example '\"Capawesome\"'\n * @since 0.1.0\n */\n result: string | null;\n}\n\n/**\n * @since 0.1.0\n */\nexport interface PostMessageOptions {\n /**\n * The message data to post to the web view.\n *\n * Must be a JSON-serializable object.\n *\n * @example { name: 'Capawesome' }\n * @since 0.1.0\n */\n data: { [key: string]: unknown };\n}\n\n/**\n * @since 0.1.0\n */\nexport interface GetCookiesOptions {\n /**\n * The URL to get the cookies for.\n *\n * @example 'https://capawesome.io'\n * @since 0.1.0\n */\n url: string;\n}\n\n/**\n * @since 0.1.0\n */\nexport interface GetCookiesResult {\n /**\n * The cookies for the URL as a map of cookie names to values.\n *\n * @since 0.1.0\n */\n cookies: { [key: string]: string };\n}\n\n/**\n * @since 0.1.0\n */\nexport interface BrowserPageNavigationCompletedEvent {\n /**\n * The URL of the page that was navigated to.\n *\n * @example 'https://capawesome.io'\n * @since 0.1.0\n */\n url: string;\n}\n\n/**\n * @since 0.1.0\n */\nexport interface MessageReceivedEvent {\n /**\n * The message data posted by the web page.\n *\n * @since 0.1.0\n */\n data: unknown;\n}\n\n/**\n * The style of the dismiss button in the toolbar of the system browser.\n *\n * - `cancel`: A button with the text \"Cancel\".\n * - `close`: A button with the text \"Close\".\n * - `done`: A button with the text \"Done\".\n *\n * @since 0.1.0\n */\nexport type DismissButtonStyle = 'cancel' | 'close' | 'done';\n\n/**\n * The data store to use for the web view.\n *\n * - `isolated`: The web view uses a non-persistent data store. Cookies and\n * web storage are discarded when the web view is closed.\n * - `shared`: The web view uses the app-global data store which is shared\n * with other web views.\n *\n * @since 0.1.0\n */\nexport type WebViewDataStore = 'isolated' | 'shared';\n\n/**\n * @since 0.1.0\n */\nexport enum ErrorCode {\n /**\n * No app was found on the device that can open the URL.\n *\n * @since 0.1.0\n */\n BrowserNotFound = 'BROWSER_NOT_FOUND',\n /**\n * No browser is currently open.\n *\n * @since 0.1.0\n */\n NoBrowserOpen = 'NO_BROWSER_OPEN',\n}\n"]}
|
|
1
|
+
{"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"AA0lBA;;GAEG;AACH,MAAM,CAAN,IAAY,SAaX;AAbD,WAAY,SAAS;IACnB;;;;OAIG;IACH,kDAAqC,CAAA;IACrC;;;;OAIG;IACH,8CAAiC,CAAA;AACnC,CAAC,EAbW,SAAS,KAAT,SAAS,QAapB","sourcesContent":["import type { PluginListenerHandle } from '@capacitor/core';\n\nexport interface InAppBrowserPlugin {\n /**\n * Clear the cache of the web view.\n *\n * Only available on Android and iOS.\n *\n * @since 0.1.0\n */\n clearCache(): Promise<void>;\n /**\n * Clear the session data (cookies and web storage) of the web view.\n *\n * Only available on Android and iOS.\n *\n * @since 0.1.0\n */\n clearSessionData(): Promise<void>;\n /**\n * Close the currently open browser.\n *\n * This closes browsers opened with `openInWebView(...)` or\n * `openInSystemBrowser(...)`.\n *\n * Only available on Android and iOS.\n *\n * @since 0.1.0\n */\n close(): Promise<void>;\n /**\n * Execute a JavaScript script in the currently open web view.\n *\n * This method is only available for browsers opened with\n * `openInWebView(...)`.\n *\n * Only available on Android and iOS.\n *\n * @since 0.1.0\n */\n executeScript(options: ExecuteScriptOptions): Promise<ExecuteScriptResult>;\n /**\n * Get the cookies for a specific URL.\n *\n * On iOS, only cookies from the shared data store are returned. Cookies from\n * a web view opened with `dataStore: 'isolated'` are not included.\n *\n * Only available on Android and iOS.\n *\n * @since 0.1.0\n */\n getCookies(options: GetCookiesOptions): Promise<GetCookiesResult>;\n /**\n * Open a URL in the default browser app of the device.\n *\n * @since 0.1.0\n */\n openInExternalBrowser(options: OpenInExternalBrowserOptions): Promise<void>;\n /**\n * Open a URL in the system browser (Custom Tabs on Android,\n * `SFSafariViewController` on iOS).\n *\n * Only available on Android and iOS.\n *\n * @since 0.1.0\n */\n openInSystemBrowser(options: OpenInSystemBrowserOptions): Promise<void>;\n /**\n * Open a URL in an embedded web view with a native toolbar.\n *\n * Only available on Android and iOS.\n *\n * @since 0.1.0\n */\n openInWebView(options: OpenInWebViewOptions): Promise<void>;\n /**\n * Post a message to the currently open web view.\n *\n * The web page receives the message by listening for the\n * `capacitorInAppBrowserMessage` window event. The message data is\n * available in the `detail` property of the event.\n *\n * This method is only available for browsers opened with\n * `openInWebView(...)`.\n *\n * Only available on Android and iOS.\n *\n * @since 0.1.0\n */\n postMessage(options: PostMessageOptions): Promise<void>;\n /**\n * Show the web view if it was opened with `visible: false`.\n *\n * This method is only available for browsers opened with\n * `openInWebView(...)`.\n *\n * Only available on Android and iOS.\n *\n * @since 0.1.0\n */\n show(): Promise<void>;\n /**\n * Called when the browser is closed.\n *\n * Only available on Android and iOS.\n *\n * @since 0.1.0\n */\n addListener(\n eventName: 'browserClosed',\n listenerFunc: () => void,\n ): Promise<PluginListenerHandle>;\n /**\n * Called when the web page posts a message to the app using the injected\n * `window.CapacitorInAppBrowser.postMessage(...)` function.\n *\n * This event is only emitted for browsers opened with `openInWebView(...)`.\n *\n * Only available on Android and iOS.\n *\n * @since 0.1.0\n */\n addListener(\n eventName: 'browserMessageReceived',\n listenerFunc: (event: BrowserMessageReceivedEvent) => void,\n ): Promise<PluginListenerHandle>;\n /**\n * Called when a page navigation has been completed in the web view.\n *\n * This event is only emitted for browsers opened with `openInWebView(...)`.\n *\n * Only available on Android and iOS.\n *\n * @since 0.1.0\n */\n addListener(\n eventName: 'browserNavigationCompleted',\n listenerFunc: (event: BrowserNavigationCompletedEvent) => void,\n ): Promise<PluginListenerHandle>;\n /**\n * Called when the initial page of the browser has finished loading.\n *\n * On Android, this event is only emitted for browsers opened with\n * `openInWebView(...)`.\n *\n * Only available on Android and iOS.\n *\n * @since 0.1.0\n */\n addListener(\n eventName: 'browserPageLoaded',\n listenerFunc: () => void,\n ): Promise<PluginListenerHandle>;\n /**\n * Called when the current URL of the web view changes, e.g. when the user\n * navigates to a new page, a server redirect occurs, or a single-page\n * application updates the browser history.\n *\n * This event is also emitted for the initial URL and fires earlier than\n * `browserNavigationCompleted`.\n *\n * This event is only emitted for browsers opened with `openInWebView(...)`.\n *\n * Only available on Android and iOS.\n *\n * @since 0.1.0\n */\n addListener(\n eventName: 'browserUrlChanged',\n listenerFunc: (event: BrowserUrlChangedEvent) => void,\n ): Promise<PluginListenerHandle>;\n /**\n * Remove all listeners for this plugin.\n *\n * @since 0.1.0\n */\n removeAllListeners(): Promise<void>;\n}\n\n/**\n * @since 0.1.0\n */\nexport interface OpenInExternalBrowserOptions {\n /**\n * The URL to open in the external browser.\n *\n * @example 'https://capawesome.io'\n * @since 0.1.0\n */\n url: string;\n}\n\n/**\n * @since 0.1.0\n */\nexport interface OpenInSystemBrowserOptions {\n /**\n * Options that are only applied on Android.\n *\n * Only available on Android.\n *\n * @since 0.1.0\n */\n android?: OpenInSystemBrowserAndroidOptions;\n /**\n * Options that are only applied on iOS.\n *\n * Only available on iOS.\n *\n * @since 0.1.0\n */\n ios?: OpenInSystemBrowserIosOptions;\n /**\n * The URL to open in the system browser.\n *\n * @example 'https://capawesome.io'\n * @since 0.1.0\n */\n url: string;\n}\n\n/**\n * @since 0.1.0\n */\nexport interface OpenInSystemBrowserAndroidOptions {\n /**\n * Whether or not the toolbar should be hidden when the user scrolls down\n * and shown when the user scrolls up.\n *\n * @default false\n * @since 0.1.0\n */\n hideToolbarOnScroll?: boolean;\n /**\n * Whether or not the title of the web page should be shown in the toolbar.\n *\n * @default false\n * @since 0.1.0\n */\n showTitle?: boolean;\n /**\n * The background color of the toolbar as a hex color code.\n *\n * @example '#008080'\n * @since 0.1.0\n */\n toolbarColor?: string;\n}\n\n/**\n * @since 0.1.0\n */\nexport interface OpenInSystemBrowserIosOptions {\n /**\n * Whether or not the toolbar should collapse when the user scrolls down.\n *\n * @default true\n * @since 0.1.0\n */\n barCollapsing?: boolean;\n /**\n * The style of the dismiss button in the toolbar.\n *\n * @default 'done'\n * @since 0.1.0\n */\n dismissButtonStyle?: DismissButtonStyle;\n /**\n * Whether or not the reader mode should be entered if it is available for\n * the web page.\n *\n * @default false\n * @since 0.1.0\n */\n readerMode?: boolean;\n /**\n * The background color of the toolbar as a hex color code.\n *\n * @example '#008080'\n * @since 0.1.0\n */\n toolbarColor?: string;\n}\n\n/**\n * @since 0.1.0\n */\nexport interface OpenInWebViewOptions {\n /**\n * Options that are only applied on Android.\n *\n * Only available on Android.\n *\n * @since 0.1.0\n */\n android?: OpenInWebViewAndroidOptions;\n /**\n * The data store to use for the web view.\n *\n * On Android, this option is ignored. The web view always uses the\n * app-global (`shared`) data store.\n *\n * Only available on iOS.\n *\n * @default 'shared'\n * @since 0.1.0\n */\n dataStore?: WebViewDataStore;\n /**\n * Additional HTTP headers to send with the initial request.\n *\n * @since 0.1.0\n */\n headers?: { [key: string]: string };\n /**\n * Options that are only applied on iOS.\n *\n * Only available on iOS.\n *\n * @since 0.1.0\n */\n ios?: OpenInWebViewIosOptions;\n /**\n * Whether or not media playback requires user action.\n *\n * @default false\n * @since 0.1.0\n */\n mediaPlaybackRequiresUserAction?: boolean;\n /**\n * Options for the toolbar of the web view.\n *\n * @since 0.1.0\n */\n toolbar?: WebViewToolbarOptions;\n /**\n * The URL to open in the web view.\n *\n * @example 'https://capawesome.io'\n * @since 0.1.0\n */\n url: string;\n /**\n * The custom user agent to use for the web view.\n *\n * @since 0.1.0\n */\n userAgent?: string;\n /**\n * Whether or not the web view is presented when opened.\n *\n * If `false`, the web view loads the URL in the background and stays\n * hidden until `show()` is called. The `browserPageLoaded` event is\n * still emitted and `close()` can be called while the web view is\n * hidden.\n *\n * @default true\n * @since 0.1.0\n */\n visible?: boolean;\n}\n\n/**\n * @since 0.1.0\n */\nexport interface WebViewToolbarOptions {\n /**\n * The background color of the toolbar as a hex color code.\n *\n * @example '#008080'\n * @since 0.1.0\n */\n backgroundColor?: string;\n /**\n * The text of the close button in the toolbar.\n *\n * @default 'Close'\n * @since 0.1.0\n */\n closeButtonText?: string;\n /**\n * The text color of the toolbar as a hex color code.\n *\n * @example '#FFFFFF'\n * @since 0.1.0\n */\n color?: string;\n /**\n * Whether or not the back and forward navigation buttons should be shown\n * in the toolbar.\n *\n * @default false\n * @since 0.1.0\n */\n showNavigationButtons?: boolean;\n /**\n * Whether or not the current URL should be displayed in the toolbar\n * instead of the title.\n *\n * @default false\n * @since 0.1.0\n */\n showUrl?: boolean;\n /**\n * The fixed title to display in the toolbar.\n *\n * If not set, the title of the current web page is displayed.\n *\n * @since 0.1.0\n */\n title?: string;\n /**\n * Whether or not the toolbar should be visible.\n *\n * @default true\n * @since 0.1.0\n */\n visible?: boolean;\n}\n\n/**\n * @since 0.1.0\n */\nexport interface OpenInWebViewAndroidOptions {\n /**\n * Whether or not the user can zoom the web page.\n *\n * @default false\n * @since 0.1.0\n */\n allowZoom?: boolean;\n /**\n * Whether or not the hardware back button navigates back in the web view's\n * history before closing the web view.\n *\n * If `false`, the hardware back button closes the web view immediately.\n *\n * @default true\n * @since 0.1.0\n */\n hardwareBackButton?: boolean;\n /**\n * Whether or not media playback is paused when the app is hidden.\n *\n * @default true\n * @since 0.1.0\n */\n pauseMediaWhenHidden?: boolean;\n}\n\n/**\n * @since 0.1.0\n */\nexport interface OpenInWebViewIosOptions {\n /**\n * Whether or not horizontal swipe gestures navigate back and forward in\n * the web view's history.\n *\n * @default false\n * @since 0.1.0\n */\n allowsBackForwardNavigationGestures?: boolean;\n /**\n * Whether or not the web view bounces when scrolled past the edge of the\n * content.\n *\n * @default true\n * @since 0.1.0\n */\n overscroll?: boolean;\n}\n\n/**\n * @since 0.1.0\n */\nexport interface ExecuteScriptOptions {\n /**\n * The JavaScript code to execute in the web view.\n *\n * @example 'document.title'\n * @since 0.1.0\n */\n script: string;\n}\n\n/**\n * @since 0.1.0\n */\nexport interface ExecuteScriptResult {\n /**\n * The result of the script execution serialized as a JSON string.\n *\n * If the script does not return a JSON-serializable value, `null` is\n * returned.\n *\n * @example '\"Capawesome\"'\n * @since 0.1.0\n */\n result: string | null;\n}\n\n/**\n * @since 0.1.0\n */\nexport interface PostMessageOptions {\n /**\n * The message data to post to the web view.\n *\n * Must be a JSON-serializable object.\n *\n * @example { name: 'Capawesome' }\n * @since 0.1.0\n */\n data: { [key: string]: unknown };\n}\n\n/**\n * @since 0.1.0\n */\nexport interface GetCookiesOptions {\n /**\n * The URL to get the cookies for.\n *\n * @example 'https://capawesome.io'\n * @since 0.1.0\n */\n url: string;\n}\n\n/**\n * @since 0.1.0\n */\nexport interface GetCookiesResult {\n /**\n * The cookies for the URL as a map of cookie names to values.\n *\n * @since 0.1.0\n */\n cookies: { [key: string]: string };\n}\n\n/**\n * @since 0.1.0\n */\nexport interface BrowserMessageReceivedEvent {\n /**\n * The message data posted by the web page.\n *\n * @since 0.1.0\n */\n data: unknown;\n}\n\n/**\n * @since 0.1.0\n */\nexport interface BrowserNavigationCompletedEvent {\n /**\n * The URL of the page that was navigated to.\n *\n * @example 'https://capawesome.io'\n * @since 0.1.0\n */\n url: string;\n}\n\n/**\n * @since 0.1.0\n */\nexport interface BrowserUrlChangedEvent {\n /**\n * The new URL of the web view.\n *\n * @example 'https://capawesome.io'\n * @since 0.1.0\n */\n url: string;\n}\n\n/**\n * The style of the dismiss button in the toolbar of the system browser.\n *\n * - `cancel`: A button with the text \"Cancel\".\n * - `close`: A button with the text \"Close\".\n * - `done`: A button with the text \"Done\".\n *\n * @since 0.1.0\n */\nexport type DismissButtonStyle = 'cancel' | 'close' | 'done';\n\n/**\n * The data store to use for the web view.\n *\n * - `isolated`: The web view uses a non-persistent data store. Cookies and\n * web storage are discarded when the web view is closed.\n * - `shared`: The web view uses the app-global data store which is shared\n * with other web views.\n *\n * @since 0.1.0\n */\nexport type WebViewDataStore = 'isolated' | 'shared';\n\n/**\n * @since 0.1.0\n */\nexport enum ErrorCode {\n /**\n * No app was found on the device that can open the URL.\n *\n * @since 0.1.0\n */\n BrowserNotFound = 'BROWSER_NOT_FOUND',\n /**\n * No browser is currently open.\n *\n * @since 0.1.0\n */\n NoBrowserOpen = 'NO_BROWSER_OPEN',\n}\n"]}
|
package/dist/esm/web.d.ts
CHANGED
package/dist/esm/web.js
CHANGED
|
@@ -30,6 +30,9 @@ export class InAppBrowserWeb extends WebPlugin {
|
|
|
30
30
|
async postMessage() {
|
|
31
31
|
throw this.unimplemented('Not implemented on web.');
|
|
32
32
|
}
|
|
33
|
+
async show() {
|
|
34
|
+
throw this.unimplemented('Not implemented on web.');
|
|
35
|
+
}
|
|
33
36
|
}
|
|
34
37
|
InAppBrowserWeb.errorUrlMissing = 'url must be provided.';
|
|
35
38
|
//# 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;AAS5C,MAAM,OAAO,eAAgB,SAAQ,SAAS;IAG5C,KAAK,CAAC,UAAU;QACd,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC,CAAC;IACtD,CAAC;IAED,KAAK,CAAC,gBAAgB;QACpB,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC,CAAC;IACtD,CAAC;IAED,KAAK,CAAC,KAAK;QACT,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC,CAAC;IACtD,CAAC;IAED,KAAK,CAAC,aAAa;QACjB,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC,CAAC;IACtD,CAAC;IAED,KAAK,CAAC,UAAU;QACd,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC,CAAC;IACtD,CAAC;IAED,KAAK,CAAC,qBAAqB,CACzB,OAAqC;QAErC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC;YACjB,MAAM,IAAI,KAAK,CAAC,eAAe,CAAC,eAAe,CAAC,CAAC;QACnD,CAAC;QACD,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC;IACrC,CAAC;IAED,KAAK,CAAC,mBAAmB;QACvB,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC,CAAC;IACtD,CAAC;IAED,KAAK,CAAC,aAAa;QACjB,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC,CAAC;IACtD,CAAC;IAED,KAAK,CAAC,WAAW;QACf,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC,CAAC;IACtD,CAAC;;
|
|
1
|
+
{"version":3,"file":"web.js","sourceRoot":"","sources":["../../src/web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAS5C,MAAM,OAAO,eAAgB,SAAQ,SAAS;IAG5C,KAAK,CAAC,UAAU;QACd,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC,CAAC;IACtD,CAAC;IAED,KAAK,CAAC,gBAAgB;QACpB,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC,CAAC;IACtD,CAAC;IAED,KAAK,CAAC,KAAK;QACT,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC,CAAC;IACtD,CAAC;IAED,KAAK,CAAC,aAAa;QACjB,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC,CAAC;IACtD,CAAC;IAED,KAAK,CAAC,UAAU;QACd,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC,CAAC;IACtD,CAAC;IAED,KAAK,CAAC,qBAAqB,CACzB,OAAqC;QAErC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC;YACjB,MAAM,IAAI,KAAK,CAAC,eAAe,CAAC,eAAe,CAAC,CAAC;QACnD,CAAC;QACD,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC;IACrC,CAAC;IAED,KAAK,CAAC,mBAAmB;QACvB,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC,CAAC;IACtD,CAAC;IAED,KAAK,CAAC,aAAa;QACjB,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC,CAAC;IACtD,CAAC;IAED,KAAK,CAAC,WAAW;QACf,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC,CAAC;IACtD,CAAC;IAED,KAAK,CAAC,IAAI;QACR,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC,CAAC;IACtD,CAAC;;AA7Cc,+BAAe,GAAG,uBAAuB,CAAC","sourcesContent":["import { WebPlugin } from '@capacitor/core';\n\nimport type {\n ExecuteScriptResult,\n GetCookiesResult,\n InAppBrowserPlugin,\n OpenInExternalBrowserOptions,\n} from './definitions';\n\nexport class InAppBrowserWeb extends WebPlugin implements InAppBrowserPlugin {\n private static errorUrlMissing = 'url must be provided.';\n\n async clearCache(): Promise<void> {\n throw this.unimplemented('Not implemented on web.');\n }\n\n async clearSessionData(): Promise<void> {\n throw this.unimplemented('Not implemented on web.');\n }\n\n async close(): Promise<void> {\n throw this.unimplemented('Not implemented on web.');\n }\n\n async executeScript(): Promise<ExecuteScriptResult> {\n throw this.unimplemented('Not implemented on web.');\n }\n\n async getCookies(): Promise<GetCookiesResult> {\n throw this.unimplemented('Not implemented on web.');\n }\n\n async openInExternalBrowser(\n options: OpenInExternalBrowserOptions,\n ): Promise<void> {\n if (!options.url) {\n throw new Error(InAppBrowserWeb.errorUrlMissing);\n }\n window.open(options.url, '_blank');\n }\n\n async openInSystemBrowser(): Promise<void> {\n throw this.unimplemented('Not implemented on web.');\n }\n\n async openInWebView(): Promise<void> {\n throw this.unimplemented('Not implemented on web.');\n }\n\n async postMessage(): Promise<void> {\n throw this.unimplemented('Not implemented on web.');\n }\n\n async show(): Promise<void> {\n throw this.unimplemented('Not implemented on web.');\n }\n}\n"]}
|
package/dist/plugin.cjs.js
CHANGED
|
@@ -56,6 +56,9 @@ class InAppBrowserWeb extends core.WebPlugin {
|
|
|
56
56
|
async postMessage() {
|
|
57
57
|
throw this.unimplemented('Not implemented on web.');
|
|
58
58
|
}
|
|
59
|
+
async show() {
|
|
60
|
+
throw this.unimplemented('Not implemented on web.');
|
|
61
|
+
}
|
|
59
62
|
}
|
|
60
63
|
InAppBrowserWeb.errorUrlMissing = 'url must be provided.';
|
|
61
64
|
|
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":["/**\n * @since 0.1.0\n */\nexport var ErrorCode;\n(function (ErrorCode) {\n /**\n * No app was found on the device that can open the URL.\n *\n * @since 0.1.0\n */\n ErrorCode[\"BrowserNotFound\"] = \"BROWSER_NOT_FOUND\";\n /**\n * No browser is currently open.\n *\n * @since 0.1.0\n */\n ErrorCode[\"NoBrowserOpen\"] = \"NO_BROWSER_OPEN\";\n})(ErrorCode || (ErrorCode = {}));\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 clearCache() {\n throw this.unimplemented('Not implemented on web.');\n }\n async clearSessionData() {\n throw this.unimplemented('Not implemented on web.');\n }\n async close() {\n throw this.unimplemented('Not implemented on web.');\n }\n async executeScript() {\n throw this.unimplemented('Not implemented on web.');\n }\n async getCookies() {\n throw this.unimplemented('Not implemented on web.');\n }\n async openInExternalBrowser(options) {\n if (!options.url) {\n throw new Error(InAppBrowserWeb.errorUrlMissing);\n }\n window.open(options.url, '_blank');\n }\n async openInSystemBrowser() {\n throw this.unimplemented('Not implemented on web.');\n }\n async openInWebView() {\n throw this.unimplemented('Not implemented on web.');\n }\n async postMessage() {\n throw this.unimplemented('Not implemented on web.');\n }\n}\nInAppBrowserWeb.errorUrlMissing = 'url must be provided.';\n//# sourceMappingURL=web.js.map"],"names":["ErrorCode","registerPlugin","WebPlugin"],"mappings":";;;;AAAA;AACA;AACA;AACWA;AACX,CAAC,UAAU,SAAS,EAAE;AACtB;AACA;AACA;AACA;AACA;AACA,IAAI,SAAS,CAAC,iBAAiB,CAAC,GAAG,mBAAmB;AACtD;AACA;AACA;AACA;AACA;AACA,IAAI,SAAS,CAAC,eAAe,CAAC,GAAG,iBAAiB;AAClD,CAAC,EAAEA,iBAAS,KAAKA,iBAAS,GAAG,EAAE,CAAC,CAAC;;AChB5B,MAAC,YAAY,GAAGC,mBAAc,CAAC,cAAc,EAAE;AACpD,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,eAAe,EAAE,CAAC;AACjE,CAAC;;ACFM,MAAM,eAAe,SAASC,cAAS,CAAC;AAC/C,IAAI,MAAM,UAAU,GAAG;AACvB,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC;AAC3D,IAAI;AACJ,IAAI,MAAM,gBAAgB,GAAG;AAC7B,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC;AAC3D,IAAI;AACJ,IAAI,MAAM,KAAK,GAAG;AAClB,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC;AAC3D,IAAI;AACJ,IAAI,MAAM,aAAa,GAAG;AAC1B,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC;AAC3D,IAAI;AACJ,IAAI,MAAM,UAAU,GAAG;AACvB,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC;AAC3D,IAAI;AACJ,IAAI,MAAM,qBAAqB,CAAC,OAAO,EAAE;AACzC,QAAQ,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE;AAC1B,YAAY,MAAM,IAAI,KAAK,CAAC,eAAe,CAAC,eAAe,CAAC;AAC5D,QAAQ;AACR,QAAQ,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,QAAQ,CAAC;AAC1C,IAAI;AACJ,IAAI,MAAM,mBAAmB,GAAG;AAChC,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC;AAC3D,IAAI;AACJ,IAAI,MAAM,aAAa,GAAG;AAC1B,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC;AAC3D,IAAI;AACJ,IAAI,MAAM,WAAW,GAAG;AACxB,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC;AAC3D,IAAI;AACJ;AACA,eAAe,CAAC,eAAe,GAAG,uBAAuB;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"plugin.cjs.js","sources":["esm/definitions.js","esm/index.js","esm/web.js"],"sourcesContent":["/**\n * @since 0.1.0\n */\nexport var ErrorCode;\n(function (ErrorCode) {\n /**\n * No app was found on the device that can open the URL.\n *\n * @since 0.1.0\n */\n ErrorCode[\"BrowserNotFound\"] = \"BROWSER_NOT_FOUND\";\n /**\n * No browser is currently open.\n *\n * @since 0.1.0\n */\n ErrorCode[\"NoBrowserOpen\"] = \"NO_BROWSER_OPEN\";\n})(ErrorCode || (ErrorCode = {}));\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 clearCache() {\n throw this.unimplemented('Not implemented on web.');\n }\n async clearSessionData() {\n throw this.unimplemented('Not implemented on web.');\n }\n async close() {\n throw this.unimplemented('Not implemented on web.');\n }\n async executeScript() {\n throw this.unimplemented('Not implemented on web.');\n }\n async getCookies() {\n throw this.unimplemented('Not implemented on web.');\n }\n async openInExternalBrowser(options) {\n if (!options.url) {\n throw new Error(InAppBrowserWeb.errorUrlMissing);\n }\n window.open(options.url, '_blank');\n }\n async openInSystemBrowser() {\n throw this.unimplemented('Not implemented on web.');\n }\n async openInWebView() {\n throw this.unimplemented('Not implemented on web.');\n }\n async postMessage() {\n throw this.unimplemented('Not implemented on web.');\n }\n async show() {\n throw this.unimplemented('Not implemented on web.');\n }\n}\nInAppBrowserWeb.errorUrlMissing = 'url must be provided.';\n//# sourceMappingURL=web.js.map"],"names":["ErrorCode","registerPlugin","WebPlugin"],"mappings":";;;;AAAA;AACA;AACA;AACWA;AACX,CAAC,UAAU,SAAS,EAAE;AACtB;AACA;AACA;AACA;AACA;AACA,IAAI,SAAS,CAAC,iBAAiB,CAAC,GAAG,mBAAmB;AACtD;AACA;AACA;AACA;AACA;AACA,IAAI,SAAS,CAAC,eAAe,CAAC,GAAG,iBAAiB;AAClD,CAAC,EAAEA,iBAAS,KAAKA,iBAAS,GAAG,EAAE,CAAC,CAAC;;AChB5B,MAAC,YAAY,GAAGC,mBAAc,CAAC,cAAc,EAAE;AACpD,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,eAAe,EAAE,CAAC;AACjE,CAAC;;ACFM,MAAM,eAAe,SAASC,cAAS,CAAC;AAC/C,IAAI,MAAM,UAAU,GAAG;AACvB,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC;AAC3D,IAAI;AACJ,IAAI,MAAM,gBAAgB,GAAG;AAC7B,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC;AAC3D,IAAI;AACJ,IAAI,MAAM,KAAK,GAAG;AAClB,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC;AAC3D,IAAI;AACJ,IAAI,MAAM,aAAa,GAAG;AAC1B,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC;AAC3D,IAAI;AACJ,IAAI,MAAM,UAAU,GAAG;AACvB,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC;AAC3D,IAAI;AACJ,IAAI,MAAM,qBAAqB,CAAC,OAAO,EAAE;AACzC,QAAQ,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE;AAC1B,YAAY,MAAM,IAAI,KAAK,CAAC,eAAe,CAAC,eAAe,CAAC;AAC5D,QAAQ;AACR,QAAQ,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,QAAQ,CAAC;AAC1C,IAAI;AACJ,IAAI,MAAM,mBAAmB,GAAG;AAChC,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC;AAC3D,IAAI;AACJ,IAAI,MAAM,aAAa,GAAG;AAC1B,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC;AAC3D,IAAI;AACJ,IAAI,MAAM,WAAW,GAAG;AACxB,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC;AAC3D,IAAI;AACJ,IAAI,MAAM,IAAI,GAAG;AACjB,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC;AAC3D,IAAI;AACJ;AACA,eAAe,CAAC,eAAe,GAAG,uBAAuB;;;;;;;;;"}
|
package/dist/plugin.js
CHANGED
|
@@ -55,6 +55,9 @@ var capacitorInAppBrowser = (function (exports, core) {
|
|
|
55
55
|
async postMessage() {
|
|
56
56
|
throw this.unimplemented('Not implemented on web.');
|
|
57
57
|
}
|
|
58
|
+
async show() {
|
|
59
|
+
throw this.unimplemented('Not implemented on web.');
|
|
60
|
+
}
|
|
58
61
|
}
|
|
59
62
|
InAppBrowserWeb.errorUrlMissing = 'url must be provided.';
|
|
60
63
|
|
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":["/**\n * @since 0.1.0\n */\nexport var ErrorCode;\n(function (ErrorCode) {\n /**\n * No app was found on the device that can open the URL.\n *\n * @since 0.1.0\n */\n ErrorCode[\"BrowserNotFound\"] = \"BROWSER_NOT_FOUND\";\n /**\n * No browser is currently open.\n *\n * @since 0.1.0\n */\n ErrorCode[\"NoBrowserOpen\"] = \"NO_BROWSER_OPEN\";\n})(ErrorCode || (ErrorCode = {}));\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 clearCache() {\n throw this.unimplemented('Not implemented on web.');\n }\n async clearSessionData() {\n throw this.unimplemented('Not implemented on web.');\n }\n async close() {\n throw this.unimplemented('Not implemented on web.');\n }\n async executeScript() {\n throw this.unimplemented('Not implemented on web.');\n }\n async getCookies() {\n throw this.unimplemented('Not implemented on web.');\n }\n async openInExternalBrowser(options) {\n if (!options.url) {\n throw new Error(InAppBrowserWeb.errorUrlMissing);\n }\n window.open(options.url, '_blank');\n }\n async openInSystemBrowser() {\n throw this.unimplemented('Not implemented on web.');\n }\n async openInWebView() {\n throw this.unimplemented('Not implemented on web.');\n }\n async postMessage() {\n throw this.unimplemented('Not implemented on web.');\n }\n}\nInAppBrowserWeb.errorUrlMissing = 'url must be provided.';\n//# sourceMappingURL=web.js.map"],"names":["ErrorCode","registerPlugin","WebPlugin"],"mappings":";;;IAAA;IACA;IACA;AACWA;IACX,CAAC,UAAU,SAAS,EAAE;IACtB;IACA;IACA;IACA;IACA;IACA,IAAI,SAAS,CAAC,iBAAiB,CAAC,GAAG,mBAAmB;IACtD;IACA;IACA;IACA;IACA;IACA,IAAI,SAAS,CAAC,eAAe,CAAC,GAAG,iBAAiB;IAClD,CAAC,EAAEA,iBAAS,KAAKA,iBAAS,GAAG,EAAE,CAAC,CAAC;;AChB5B,UAAC,YAAY,GAAGC,mBAAc,CAAC,cAAc,EAAE;IACpD,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,eAAe,EAAE,CAAC;IACjE,CAAC;;ICFM,MAAM,eAAe,SAASC,cAAS,CAAC;IAC/C,IAAI,MAAM,UAAU,GAAG;IACvB,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC;IAC3D,IAAI;IACJ,IAAI,MAAM,gBAAgB,GAAG;IAC7B,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC;IAC3D,IAAI;IACJ,IAAI,MAAM,KAAK,GAAG;IAClB,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC;IAC3D,IAAI;IACJ,IAAI,MAAM,aAAa,GAAG;IAC1B,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC;IAC3D,IAAI;IACJ,IAAI,MAAM,UAAU,GAAG;IACvB,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC;IAC3D,IAAI;IACJ,IAAI,MAAM,qBAAqB,CAAC,OAAO,EAAE;IACzC,QAAQ,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE;IAC1B,YAAY,MAAM,IAAI,KAAK,CAAC,eAAe,CAAC,eAAe,CAAC;IAC5D,QAAQ;IACR,QAAQ,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,QAAQ,CAAC;IAC1C,IAAI;IACJ,IAAI,MAAM,mBAAmB,GAAG;IAChC,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC;IAC3D,IAAI;IACJ,IAAI,MAAM,aAAa,GAAG;IAC1B,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC;IAC3D,IAAI;IACJ,IAAI,MAAM,WAAW,GAAG;IACxB,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC;IAC3D,IAAI;IACJ;IACA,eAAe,CAAC,eAAe,GAAG,uBAAuB;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"plugin.js","sources":["esm/definitions.js","esm/index.js","esm/web.js"],"sourcesContent":["/**\n * @since 0.1.0\n */\nexport var ErrorCode;\n(function (ErrorCode) {\n /**\n * No app was found on the device that can open the URL.\n *\n * @since 0.1.0\n */\n ErrorCode[\"BrowserNotFound\"] = \"BROWSER_NOT_FOUND\";\n /**\n * No browser is currently open.\n *\n * @since 0.1.0\n */\n ErrorCode[\"NoBrowserOpen\"] = \"NO_BROWSER_OPEN\";\n})(ErrorCode || (ErrorCode = {}));\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 clearCache() {\n throw this.unimplemented('Not implemented on web.');\n }\n async clearSessionData() {\n throw this.unimplemented('Not implemented on web.');\n }\n async close() {\n throw this.unimplemented('Not implemented on web.');\n }\n async executeScript() {\n throw this.unimplemented('Not implemented on web.');\n }\n async getCookies() {\n throw this.unimplemented('Not implemented on web.');\n }\n async openInExternalBrowser(options) {\n if (!options.url) {\n throw new Error(InAppBrowserWeb.errorUrlMissing);\n }\n window.open(options.url, '_blank');\n }\n async openInSystemBrowser() {\n throw this.unimplemented('Not implemented on web.');\n }\n async openInWebView() {\n throw this.unimplemented('Not implemented on web.');\n }\n async postMessage() {\n throw this.unimplemented('Not implemented on web.');\n }\n async show() {\n throw this.unimplemented('Not implemented on web.');\n }\n}\nInAppBrowserWeb.errorUrlMissing = 'url must be provided.';\n//# sourceMappingURL=web.js.map"],"names":["ErrorCode","registerPlugin","WebPlugin"],"mappings":";;;IAAA;IACA;IACA;AACWA;IACX,CAAC,UAAU,SAAS,EAAE;IACtB;IACA;IACA;IACA;IACA;IACA,IAAI,SAAS,CAAC,iBAAiB,CAAC,GAAG,mBAAmB;IACtD;IACA;IACA;IACA;IACA;IACA,IAAI,SAAS,CAAC,eAAe,CAAC,GAAG,iBAAiB;IAClD,CAAC,EAAEA,iBAAS,KAAKA,iBAAS,GAAG,EAAE,CAAC,CAAC;;AChB5B,UAAC,YAAY,GAAGC,mBAAc,CAAC,cAAc,EAAE;IACpD,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,eAAe,EAAE,CAAC;IACjE,CAAC;;ICFM,MAAM,eAAe,SAASC,cAAS,CAAC;IAC/C,IAAI,MAAM,UAAU,GAAG;IACvB,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC;IAC3D,IAAI;IACJ,IAAI,MAAM,gBAAgB,GAAG;IAC7B,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC;IAC3D,IAAI;IACJ,IAAI,MAAM,KAAK,GAAG;IAClB,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC;IAC3D,IAAI;IACJ,IAAI,MAAM,aAAa,GAAG;IAC1B,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC;IAC3D,IAAI;IACJ,IAAI,MAAM,UAAU,GAAG;IACvB,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC;IAC3D,IAAI;IACJ,IAAI,MAAM,qBAAqB,CAAC,OAAO,EAAE;IACzC,QAAQ,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE;IAC1B,YAAY,MAAM,IAAI,KAAK,CAAC,eAAe,CAAC,eAAe,CAAC;IAC5D,QAAQ;IACR,QAAQ,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,QAAQ,CAAC;IAC1C,IAAI;IACJ,IAAI,MAAM,mBAAmB,GAAG;IAChC,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC;IAC3D,IAAI;IACJ,IAAI,MAAM,aAAa,GAAG;IAC1B,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC;IAC3D,IAAI;IACJ,IAAI,MAAM,WAAW,GAAG;IACxB,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC;IAC3D,IAAI;IACJ,IAAI,MAAM,IAAI,GAAG;IACjB,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC;IAC3D,IAAI;IACJ;IACA,eAAe,CAAC,eAAe,GAAG,uBAAuB;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import Foundation
|
|
2
|
+
import Capacitor
|
|
3
|
+
|
|
4
|
+
@objc public class BrowserUrlChangedEvent: NSObject, Result {
|
|
5
|
+
let url: String
|
|
6
|
+
|
|
7
|
+
init(url: String) {
|
|
8
|
+
self.url = url
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
@objc public func toJSObject() -> AnyObject {
|
|
12
|
+
var result = JSObject()
|
|
13
|
+
result["url"] = url
|
|
14
|
+
return result as AnyObject
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -10,6 +10,7 @@ import Capacitor
|
|
|
10
10
|
let toolbar: WebViewToolbarOptions
|
|
11
11
|
let url: URL
|
|
12
12
|
let userAgent: String?
|
|
13
|
+
let visible: Bool
|
|
13
14
|
|
|
14
15
|
init(_ call: CAPPluginCall) throws {
|
|
15
16
|
let iosOptions = call.getObject("ios")
|
|
@@ -21,6 +22,7 @@ import Capacitor
|
|
|
21
22
|
self.toolbar = try WebViewToolbarOptions(call.getObject("toolbar"))
|
|
22
23
|
self.url = try OpenInWebViewOptions.getUrlFromCall(call)
|
|
23
24
|
self.userAgent = call.getString("userAgent")
|
|
25
|
+
self.visible = call.getBool("visible", true)
|
|
24
26
|
}
|
|
25
27
|
|
|
26
28
|
private static func getHeadersFromCall(_ call: CAPPluginCall) -> [String: String] {
|