@capgo/capacitor-inappbrowser 8.6.15

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.
Files changed (59) hide show
  1. package/CapgoCapacitorInappbrowser.podspec +17 -0
  2. package/LICENSE +373 -0
  3. package/Package.swift +28 -0
  4. package/README.md +1610 -0
  5. package/android/build.gradle +64 -0
  6. package/android/src/main/AndroidManifest.xml +22 -0
  7. package/android/src/main/assets/proxy-bridge.js +586 -0
  8. package/android/src/main/java/ee/forgr/capacitor_inappbrowser/ActiveWebViewSupport.java +10 -0
  9. package/android/src/main/java/ee/forgr/capacitor_inappbrowser/CustomSchemeInterceptSupport.java +51 -0
  10. package/android/src/main/java/ee/forgr/capacitor_inappbrowser/InAppBrowserPlugin.java +1820 -0
  11. package/android/src/main/java/ee/forgr/capacitor_inappbrowser/MobileAppBridgeScript.java +122 -0
  12. package/android/src/main/java/ee/forgr/capacitor_inappbrowser/NativeProxyRule.java +128 -0
  13. package/android/src/main/java/ee/forgr/capacitor_inappbrowser/Options.java +725 -0
  14. package/android/src/main/java/ee/forgr/capacitor_inappbrowser/ProxyBridge.java +93 -0
  15. package/android/src/main/java/ee/forgr/capacitor_inappbrowser/ProxyRequestSupport.java +869 -0
  16. package/android/src/main/java/ee/forgr/capacitor_inappbrowser/ProxyResponseRouting.java +35 -0
  17. package/android/src/main/java/ee/forgr/capacitor_inappbrowser/SafeAreaInsetsSupport.java +28 -0
  18. package/android/src/main/java/ee/forgr/capacitor_inappbrowser/WebViewCallbacks.java +42 -0
  19. package/android/src/main/java/ee/forgr/capacitor_inappbrowser/WebViewDialog.java +6022 -0
  20. package/android/src/main/java/ee/forgr/capacitor_inappbrowser/WebViewPermissionSupport.java +58 -0
  21. package/android/src/main/res/.gitkeep +0 -0
  22. package/android/src/main/res/drawable/arrow_back_disabled.xml +9 -0
  23. package/android/src/main/res/drawable/arrow_back_enabled.xml +9 -0
  24. package/android/src/main/res/drawable/arrow_forward_disabled.xml +9 -0
  25. package/android/src/main/res/drawable/arrow_forward_enabled.xml +9 -0
  26. package/android/src/main/res/drawable/ic_clear_24px.xml +9 -0
  27. package/android/src/main/res/drawable/ic_refresh.xml +9 -0
  28. package/android/src/main/res/drawable/ic_share.xml +10 -0
  29. package/android/src/main/res/layout/activity_browser.xml +32 -0
  30. package/android/src/main/res/layout/bridge_layout_main.xml +15 -0
  31. package/android/src/main/res/layout/content_browser.xml +17 -0
  32. package/android/src/main/res/layout/tool_bar.xml +87 -0
  33. package/android/src/main/res/values/browser_theme.xml +3 -0
  34. package/android/src/main/res/values/colors.xml +5 -0
  35. package/android/src/main/res/values/dimens.xml +3 -0
  36. package/android/src/main/res/values/strings.xml +13 -0
  37. package/android/src/main/res/values/styles.xml +4 -0
  38. package/android/src/main/res/values/themes.xml +27 -0
  39. package/android/src/main/res/xml/file_paths.xml +14 -0
  40. package/dist/docs.json +3200 -0
  41. package/dist/esm/definitions.d.ts +1507 -0
  42. package/dist/esm/definitions.js +40 -0
  43. package/dist/esm/definitions.js.map +1 -0
  44. package/dist/esm/index.d.ts +6 -0
  45. package/dist/esm/index.js +102 -0
  46. package/dist/esm/index.js.map +1 -0
  47. package/dist/esm/web.d.ts +47 -0
  48. package/dist/esm/web.js +120 -0
  49. package/dist/esm/web.js.map +1 -0
  50. package/dist/plugin.cjs.js +270 -0
  51. package/dist/plugin.cjs.js.map +1 -0
  52. package/dist/plugin.js +273 -0
  53. package/dist/plugin.js.map +1 -0
  54. package/ios/Sources/InAppBrowserPlugin/Enums.swift +65 -0
  55. package/ios/Sources/InAppBrowserPlugin/InAppBrowserPlugin.swift +1932 -0
  56. package/ios/Sources/InAppBrowserPlugin/ProxySchemeHandler.swift +1185 -0
  57. package/ios/Sources/InAppBrowserPlugin/WKWebView+SchemeHandling.swift +43 -0
  58. package/ios/Sources/InAppBrowserPlugin/WKWebViewController.swift +3032 -0
  59. package/package.json +139 -0
@@ -0,0 +1,725 @@
1
+ package ee.forgr.capacitor_inappbrowser;
2
+
3
+ import android.content.res.AssetManager;
4
+ import androidx.annotation.Nullable;
5
+ import com.getcapacitor.JSObject;
6
+ import com.getcapacitor.PluginCall;
7
+ import java.io.IOException;
8
+ import java.io.InputStream;
9
+ import java.util.ArrayList;
10
+ import java.util.List;
11
+ import java.util.Objects;
12
+ import java.util.Objects;
13
+ import java.util.regex.Pattern;
14
+
15
+ public class Options {
16
+
17
+ public enum InvisibilityMode {
18
+ AWARE,
19
+ FAKE_VISIBLE;
20
+
21
+ public static InvisibilityMode fromString(String value) {
22
+ if (value == null) {
23
+ return AWARE;
24
+ }
25
+
26
+ try {
27
+ return InvisibilityMode.valueOf(value.trim().toUpperCase());
28
+ } catch (IllegalArgumentException e) {
29
+ return AWARE;
30
+ }
31
+ }
32
+ }
33
+
34
+ public static class ButtonNearDone {
35
+
36
+ public enum AllIconTypes {
37
+ ASSET,
38
+ VECTOR
39
+ }
40
+
41
+ private final AllIconTypes iconTypeEnum;
42
+ private final String iconType;
43
+ private final String icon;
44
+ private final int height;
45
+ private final int width;
46
+
47
+ private ButtonNearDone(AllIconTypes iconTypeEnum, String iconType, String icon, int height, int width) {
48
+ this.iconTypeEnum = iconTypeEnum;
49
+ this.iconType = iconType;
50
+ this.icon = icon;
51
+ this.height = height;
52
+ this.width = width;
53
+ }
54
+
55
+ @Nullable
56
+ public static ButtonNearDone generateFromPluginCall(PluginCall call, AssetManager assetManager)
57
+ throws IllegalArgumentException, RuntimeException {
58
+ JSObject buttonNearDone = call.getObject("buttonNearDone");
59
+ if (buttonNearDone == null) {
60
+ // Return null when "buttonNearDone" isn't configured, else throw an error
61
+ return null;
62
+ }
63
+
64
+ JSObject android = buttonNearDone.getJSObject("android");
65
+ if (android == null) {
66
+ throw new IllegalArgumentException("buttonNearDone.android is null");
67
+ }
68
+
69
+ String iconType = android.getString("iconType", "asset");
70
+ AllIconTypes iconTypeEnum;
71
+
72
+ // Validate and process icon type
73
+ if ("asset".equals(iconType)) {
74
+ iconTypeEnum = AllIconTypes.ASSET;
75
+ } else if ("vector".equals(iconType)) {
76
+ iconTypeEnum = AllIconTypes.VECTOR;
77
+ } else {
78
+ throw new IllegalArgumentException("buttonNearDone.android.iconType must be 'asset' or 'vector'");
79
+ }
80
+
81
+ String icon = android.getString("icon");
82
+ if (icon == null) {
83
+ throw new IllegalArgumentException("buttonNearDone.android.icon is null");
84
+ }
85
+
86
+ // For asset type, verify the file exists
87
+ if (iconTypeEnum == AllIconTypes.ASSET) {
88
+ InputStream fileInputString = null;
89
+
90
+ try {
91
+ // Try to find in public folder first
92
+ try {
93
+ fileInputString = assetManager.open("public/" + icon);
94
+ } catch (IOException e) {
95
+ // If not in public, try in root assets
96
+ try {
97
+ fileInputString = assetManager.open(icon);
98
+ } catch (IOException e2) {
99
+ throw new IllegalArgumentException("buttonNearDone.android.icon cannot be found in the assetManager");
100
+ }
101
+ }
102
+ // File exists, do nothing
103
+ } finally {
104
+ // Close the input stream if it was opened
105
+ if (fileInputString != null) {
106
+ try {
107
+ fileInputString.close();
108
+ } catch (IOException e) {
109
+ e.printStackTrace();
110
+ }
111
+ }
112
+ }
113
+ }
114
+ // For vector type, we don't validate here since resources are checked at runtime
115
+ else if (iconTypeEnum == AllIconTypes.VECTOR) {
116
+ // Vector resources will be validated when used
117
+ System.out.println("Vector resource will be validated at runtime: " + icon);
118
+ }
119
+
120
+ Integer width = android.getInteger("width", 24);
121
+ Integer height = android.getInteger("height", 24);
122
+
123
+ final ButtonNearDone buttonNearDone1 = new ButtonNearDone(iconTypeEnum, iconType, icon, height, width);
124
+ return buttonNearDone1;
125
+ }
126
+
127
+ public AllIconTypes getIconTypeEnum() {
128
+ return iconTypeEnum;
129
+ }
130
+
131
+ public String getIconType() {
132
+ return iconType;
133
+ }
134
+
135
+ public String getIcon() {
136
+ return icon;
137
+ }
138
+
139
+ public int getHeight() {
140
+ return height;
141
+ }
142
+
143
+ public int getWidth() {
144
+ return width;
145
+ }
146
+ }
147
+
148
+ private String title;
149
+ private boolean CloseModal;
150
+ private String CloseModalTitle;
151
+ private String CloseModalDescription;
152
+ private String CloseModalCancel;
153
+ private ButtonNearDone buttonNearDone;
154
+ private String CloseModalOk;
155
+ private Pattern closeModalURLPattern;
156
+ private String url;
157
+ private JSObject headers;
158
+ private JSObject credentials;
159
+ private String toolbarType;
160
+ private JSObject shareDisclaimer;
161
+ private String shareSubject;
162
+ private boolean disableGoBackOnNativeApplication;
163
+ private boolean activeNativeNavigationForWebview;
164
+ private boolean isPresentAfterPageLoad;
165
+ private WebViewCallbacks callbacks;
166
+ private PluginCall pluginCall;
167
+ private boolean VisibleTitle;
168
+ private String ToolbarColor;
169
+ private String BackgroundColor;
170
+ private boolean ShowArrow;
171
+ private boolean ignoreUntrustedSSLError;
172
+ private String preShowScript;
173
+ private String toolbarTextColor;
174
+ private Pattern proxyRequestsPattern = null;
175
+ private boolean proxyRequests = false;
176
+ private List<NativeProxyRule> outboundProxyRules = new ArrayList<>();
177
+ private List<NativeProxyRule> inboundProxyRules = new ArrayList<>();
178
+ private boolean materialPicker = false;
179
+ private int textZoom = 100; // Default text zoom is 100%
180
+ private boolean preventDeeplink = false;
181
+ private boolean openBlankTargetInWebView = false;
182
+ private List<String> authorizedAppLinks = new ArrayList<>();
183
+ private boolean enabledSafeBottomMargin = false;
184
+ private boolean enabledSafeTopMargin = true;
185
+ private boolean useTopInset = false;
186
+ private boolean enableGooglePaySupport = false;
187
+ private boolean enableZoom = false;
188
+ private List<String> blockedHosts = new ArrayList<>();
189
+ private Integer width = null;
190
+ private Integer height = null;
191
+ private Integer x = null;
192
+ private Integer y = null;
193
+ private boolean hidden = false;
194
+ private boolean showScreenshotButton = false;
195
+ private boolean allowWebViewJsVisibilityControl = false;
196
+ private boolean allowScreenshotsFromWebPage = false;
197
+ private boolean captureConsoleLogs = false;
198
+ private boolean handleDownloads = false;
199
+ private InvisibilityMode invisibilityMode = InvisibilityMode.AWARE;
200
+ private String httpMethod = null;
201
+ private String httpBody = null;
202
+ private boolean popupWindowMode = false;
203
+ private boolean hiddenPopupWindow = false;
204
+
205
+ public Integer getWidth() {
206
+ return width;
207
+ }
208
+
209
+ public void setWidth(Integer width) {
210
+ this.width = width;
211
+ }
212
+
213
+ public Integer getHeight() {
214
+ return height;
215
+ }
216
+
217
+ public void setHeight(Integer height) {
218
+ this.height = height;
219
+ }
220
+
221
+ public Integer getX() {
222
+ return x;
223
+ }
224
+
225
+ public void setX(Integer x) {
226
+ this.x = x;
227
+ }
228
+
229
+ public Integer getY() {
230
+ return y;
231
+ }
232
+
233
+ public void setY(Integer y) {
234
+ this.y = y;
235
+ }
236
+
237
+ public int getTextZoom() {
238
+ return textZoom;
239
+ }
240
+
241
+ public void setTextZoom(int textZoom) {
242
+ this.textZoom = textZoom;
243
+ }
244
+
245
+ public boolean getMaterialPicker() {
246
+ return materialPicker;
247
+ }
248
+
249
+ public boolean getShowScreenshotButton() {
250
+ return showScreenshotButton;
251
+ }
252
+
253
+ public void setShowScreenshotButton(boolean showScreenshotButton) {
254
+ this.showScreenshotButton = showScreenshotButton;
255
+ }
256
+
257
+ public boolean getAllowScreenshotsFromWebPage() {
258
+ return allowScreenshotsFromWebPage;
259
+ }
260
+
261
+ public void setAllowScreenshotsFromWebPage(boolean allowScreenshotsFromWebPage) {
262
+ this.allowScreenshotsFromWebPage = allowScreenshotsFromWebPage;
263
+ }
264
+
265
+ public boolean getCaptureConsoleLogs() {
266
+ return captureConsoleLogs;
267
+ }
268
+
269
+ public void setCaptureConsoleLogs(boolean captureConsoleLogs) {
270
+ this.captureConsoleLogs = captureConsoleLogs;
271
+ }
272
+
273
+ public boolean getHandleDownloads() {
274
+ return handleDownloads;
275
+ }
276
+
277
+ public void setHandleDownloads(boolean handleDownloads) {
278
+ this.handleDownloads = handleDownloads;
279
+ }
280
+
281
+ public void setMaterialPicker(boolean materialPicker) {
282
+ this.materialPicker = materialPicker;
283
+ }
284
+
285
+ public boolean getEnabledSafeMargin() {
286
+ return enabledSafeBottomMargin;
287
+ }
288
+
289
+ public void setEnabledSafeMargin(boolean enabledSafeBottomMargin) {
290
+ this.enabledSafeBottomMargin = enabledSafeBottomMargin;
291
+ }
292
+
293
+ public boolean getEnabledSafeTopMargin() {
294
+ return enabledSafeTopMargin;
295
+ }
296
+
297
+ public void setEnabledSafeTopMargin(boolean enabledSafeTopMargin) {
298
+ this.enabledSafeTopMargin = enabledSafeTopMargin;
299
+ }
300
+
301
+ public boolean getUseTopInset() {
302
+ return useTopInset;
303
+ }
304
+
305
+ public void setUseTopInset(boolean useTopInset) {
306
+ this.useTopInset = useTopInset;
307
+ }
308
+
309
+ public Pattern getProxyRequestsPattern() {
310
+ return proxyRequestsPattern;
311
+ }
312
+
313
+ public void setProxyRequestsPattern(Pattern proxyRequestsPattern) {
314
+ this.proxyRequestsPattern = proxyRequestsPattern;
315
+ }
316
+
317
+ public boolean getProxyRequests() {
318
+ return proxyRequests;
319
+ }
320
+
321
+ public void setProxyRequests(boolean proxyRequests) {
322
+ this.proxyRequests = proxyRequests;
323
+ }
324
+
325
+ public List<NativeProxyRule> getOutboundProxyRules() {
326
+ return outboundProxyRules;
327
+ }
328
+
329
+ public void setOutboundProxyRules(List<NativeProxyRule> outboundProxyRules) {
330
+ this.outboundProxyRules = outboundProxyRules != null ? outboundProxyRules : new ArrayList<>();
331
+ }
332
+
333
+ public List<NativeProxyRule> getInboundProxyRules() {
334
+ return inboundProxyRules;
335
+ }
336
+
337
+ public void setInboundProxyRules(List<NativeProxyRule> inboundProxyRules) {
338
+ this.inboundProxyRules = inboundProxyRules != null ? inboundProxyRules : new ArrayList<>();
339
+ }
340
+
341
+ public boolean shouldEnableNativeProxy() {
342
+ return proxyRequests || proxyRequestsPattern != null || !outboundProxyRules.isEmpty() || !inboundProxyRules.isEmpty();
343
+ }
344
+
345
+ public PluginCall getPluginCall() {
346
+ return pluginCall;
347
+ }
348
+
349
+ public void setPluginCall(PluginCall pluginCall) {
350
+ this.pluginCall = pluginCall;
351
+ }
352
+
353
+ public String getTitle() {
354
+ return title;
355
+ }
356
+
357
+ public void setTitle(String title) {
358
+ this.title = title;
359
+ }
360
+
361
+ public boolean getCloseModal() {
362
+ return CloseModal;
363
+ }
364
+
365
+ public void setCloseModal(boolean CloseModal) {
366
+ this.CloseModal = CloseModal;
367
+ }
368
+
369
+ public String getCloseModalTitle() {
370
+ return CloseModalTitle;
371
+ }
372
+
373
+ public void setCloseModalTitle(String CloseModalTitle) {
374
+ this.CloseModalTitle = CloseModalTitle;
375
+ }
376
+
377
+ public String getCloseModalDescription() {
378
+ return CloseModalDescription;
379
+ }
380
+
381
+ public void setCloseModalDescription(String CloseModalDescription) {
382
+ this.CloseModalDescription = CloseModalDescription;
383
+ }
384
+
385
+ public void setButtonNearDone(ButtonNearDone buttonNearDone) {
386
+ this.buttonNearDone = buttonNearDone;
387
+ }
388
+
389
+ public ButtonNearDone getButtonNearDone() {
390
+ return this.buttonNearDone;
391
+ }
392
+
393
+ public String getCloseModalCancel() {
394
+ return CloseModalCancel;
395
+ }
396
+
397
+ public void setCloseModalCancel(String CloseModalCancel) {
398
+ this.CloseModalCancel = CloseModalCancel;
399
+ }
400
+
401
+ public String getCloseModalOk() {
402
+ return CloseModalOk;
403
+ }
404
+
405
+ public void setCloseModalOk(String CloseModalOk) {
406
+ this.CloseModalOk = CloseModalOk;
407
+ }
408
+
409
+ public Pattern getCloseModalURLPattern() {
410
+ return closeModalURLPattern;
411
+ }
412
+
413
+ public void setCloseModalURLPattern(Pattern closeModalURLPattern) {
414
+ this.closeModalURLPattern = closeModalURLPattern;
415
+ }
416
+
417
+ public String getUrl() {
418
+ return url;
419
+ }
420
+
421
+ public void setUrl(String url) {
422
+ this.url = url;
423
+ }
424
+
425
+ public JSObject getHeaders() {
426
+ return headers;
427
+ }
428
+
429
+ public void setHeaders(JSObject headers) {
430
+ this.headers = headers;
431
+ }
432
+
433
+ public JSObject getCredentials() {
434
+ return credentials;
435
+ }
436
+
437
+ public void setCredentials(JSObject credentials) {
438
+ this.credentials = credentials;
439
+ }
440
+
441
+ public String getToolbarType() {
442
+ return toolbarType;
443
+ }
444
+
445
+ public void setToolbarType(String toolbarType) {
446
+ this.toolbarType = toolbarType;
447
+ }
448
+
449
+ public JSObject getShareDisclaimer() {
450
+ return shareDisclaimer;
451
+ }
452
+
453
+ public boolean showReloadButton;
454
+
455
+ public boolean getShowReloadButton() {
456
+ return showReloadButton;
457
+ }
458
+
459
+ public void setShowReloadButton(boolean showReloadButton) {
460
+ this.showReloadButton = showReloadButton;
461
+ }
462
+
463
+ public void setShareDisclaimer(JSObject shareDisclaimer) {
464
+ this.shareDisclaimer = shareDisclaimer;
465
+ }
466
+
467
+ public String getShareSubject() {
468
+ return shareSubject;
469
+ }
470
+
471
+ public void setShareSubject(String shareSubject) {
472
+ this.shareSubject = shareSubject;
473
+ }
474
+
475
+ public boolean getActiveNativeNavigationForWebview() {
476
+ return activeNativeNavigationForWebview;
477
+ }
478
+
479
+ public void setActiveNativeNavigationForWebview(boolean activeNativeNavigationForWebview) {
480
+ this.activeNativeNavigationForWebview = activeNativeNavigationForWebview;
481
+ }
482
+
483
+ public boolean getDisableGoBackOnNativeApplication() {
484
+ return disableGoBackOnNativeApplication;
485
+ }
486
+
487
+ public void setDisableGoBackOnNativeApplication(boolean disableGoBackOnNativeApplication) {
488
+ this.disableGoBackOnNativeApplication = disableGoBackOnNativeApplication;
489
+ }
490
+
491
+ public boolean isPresentAfterPageLoad() {
492
+ return isPresentAfterPageLoad;
493
+ }
494
+
495
+ public void setPresentAfterPageLoad(boolean presentAfterPageLoad) {
496
+ isPresentAfterPageLoad = presentAfterPageLoad;
497
+ }
498
+
499
+ public WebViewCallbacks getCallbacks() {
500
+ return callbacks;
501
+ }
502
+
503
+ public void setCallbacks(WebViewCallbacks callbacks) {
504
+ this.callbacks = callbacks;
505
+ }
506
+
507
+ public boolean getVisibleTitle() {
508
+ return VisibleTitle;
509
+ }
510
+
511
+ public void setVisibleTitle(boolean _visibleTitle) {
512
+ this.VisibleTitle = _visibleTitle;
513
+ }
514
+
515
+ public String getToolbarColor() {
516
+ return ToolbarColor;
517
+ }
518
+
519
+ public void setToolbarColor(String toolbarColor) {
520
+ this.ToolbarColor = toolbarColor;
521
+ }
522
+
523
+ public String getBackgroundColor() {
524
+ return BackgroundColor;
525
+ }
526
+
527
+ public void setBackgroundColor(String backgroundColor) {
528
+ this.BackgroundColor = backgroundColor;
529
+ }
530
+
531
+ public String getToolbarTextColor() {
532
+ return toolbarTextColor;
533
+ }
534
+
535
+ public void setToolbarTextColor(String toolbarTextColor) {
536
+ this.toolbarTextColor = toolbarTextColor;
537
+ }
538
+
539
+ public boolean showArrow() {
540
+ return ShowArrow;
541
+ }
542
+
543
+ public void setArrow(boolean _showArrow) {
544
+ this.ShowArrow = _showArrow;
545
+ }
546
+
547
+ public boolean ignoreUntrustedSSLError() {
548
+ return ignoreUntrustedSSLError;
549
+ }
550
+
551
+ public void setIgnoreUntrustedSSLError(boolean _ignoreUntrustedSSLError) {
552
+ this.ignoreUntrustedSSLError = _ignoreUntrustedSSLError;
553
+ }
554
+
555
+ public String getPreShowScript() {
556
+ return preShowScript;
557
+ }
558
+
559
+ public void setPreShowScript(String preLoadScript) {
560
+ this.preShowScript = preLoadScript;
561
+ }
562
+
563
+ public boolean getPreventDeeplink() {
564
+ return preventDeeplink;
565
+ }
566
+
567
+ public void setPreventDeeplink(boolean preventDeeplink) {
568
+ this.preventDeeplink = preventDeeplink;
569
+ }
570
+
571
+ public boolean getOpenBlankTargetInWebView() {
572
+ return openBlankTargetInWebView;
573
+ }
574
+
575
+ public void setOpenBlankTargetInWebView(boolean openBlankTargetInWebView) {
576
+ this.openBlankTargetInWebView = openBlankTargetInWebView;
577
+ }
578
+
579
+ public List<String> getAuthorizedAppLinks() {
580
+ return authorizedAppLinks;
581
+ }
582
+
583
+ public void setAuthorizedAppLinks(List<String> authorizedAppLinks) {
584
+ this.authorizedAppLinks = authorizedAppLinks;
585
+ }
586
+
587
+ public boolean getEnableGooglePaySupport() {
588
+ return enableGooglePaySupport;
589
+ }
590
+
591
+ public void setEnableGooglePaySupport(boolean enableGooglePaySupport) {
592
+ this.enableGooglePaySupport = enableGooglePaySupport;
593
+ }
594
+
595
+ public boolean getEnableZoom() {
596
+ return enableZoom;
597
+ }
598
+
599
+ public void setEnableZoom(boolean enableZoom) {
600
+ this.enableZoom = enableZoom;
601
+ }
602
+
603
+ public List<String> getBlockedHosts() {
604
+ if (blockedHosts != null) {
605
+ return blockedHosts;
606
+ }
607
+ return new ArrayList<>();
608
+ }
609
+
610
+ public void setBlockedHosts(List<String> blockedHosts) {
611
+ this.blockedHosts = blockedHosts;
612
+ }
613
+
614
+ public boolean isHidden() {
615
+ return hidden;
616
+ }
617
+
618
+ public void setHidden(boolean hidden) {
619
+ this.hidden = hidden;
620
+ }
621
+
622
+ public boolean getAllowWebViewJsVisibilityControl() {
623
+ return allowWebViewJsVisibilityControl;
624
+ }
625
+
626
+ public void setAllowWebViewJsVisibilityControl(boolean allowWebViewJsVisibilityControl) {
627
+ this.allowWebViewJsVisibilityControl = allowWebViewJsVisibilityControl;
628
+ }
629
+
630
+ public InvisibilityMode getInvisibilityMode() {
631
+ return invisibilityMode;
632
+ }
633
+
634
+ public void setInvisibilityMode(InvisibilityMode invisibilityMode) {
635
+ this.invisibilityMode = invisibilityMode;
636
+ }
637
+
638
+ public String getHttpMethod() {
639
+ return httpMethod;
640
+ }
641
+
642
+ public void setHttpMethod(String httpMethod) {
643
+ this.httpMethod = httpMethod;
644
+ }
645
+
646
+ public String getHttpBody() {
647
+ return httpBody;
648
+ }
649
+
650
+ public void setHttpBody(String httpBody) {
651
+ this.httpBody = httpBody;
652
+ }
653
+
654
+ public boolean isPopupWindowMode() {
655
+ return popupWindowMode;
656
+ }
657
+
658
+ public void setPopupWindowMode(boolean popupWindowMode) {
659
+ this.popupWindowMode = popupWindowMode;
660
+ }
661
+
662
+ public boolean isHiddenPopupWindow() {
663
+ return hiddenPopupWindow;
664
+ }
665
+
666
+ public void setHiddenPopupWindow(boolean hiddenPopupWindow) {
667
+ this.hiddenPopupWindow = hiddenPopupWindow;
668
+ }
669
+
670
+ public Options copyForPopup() {
671
+ Options copy = new Options();
672
+ copy.setTitle(title);
673
+ copy.setCloseModal(false);
674
+ copy.setCloseModalTitle(CloseModalTitle);
675
+ copy.setCloseModalDescription(CloseModalDescription);
676
+ copy.setCloseModalCancel(CloseModalCancel);
677
+ copy.setCloseModalOk(CloseModalOk);
678
+ copy.setCloseModalURLPattern(closeModalURLPattern);
679
+ copy.setButtonNearDone(buttonNearDone);
680
+ copy.setUrl("about:blank");
681
+ copy.setHeaders(headers);
682
+ copy.setCredentials(credentials);
683
+ copy.setToolbarType(toolbarType);
684
+ copy.setShareDisclaimer(shareDisclaimer);
685
+ copy.setShareSubject(shareSubject);
686
+ copy.setDisableGoBackOnNativeApplication(disableGoBackOnNativeApplication);
687
+ copy.setActiveNativeNavigationForWebview(activeNativeNavigationForWebview);
688
+ copy.setPresentAfterPageLoad(false);
689
+ copy.setVisibleTitle(VisibleTitle);
690
+ copy.setToolbarColor(ToolbarColor);
691
+ copy.setBackgroundColor(BackgroundColor);
692
+ copy.setArrow(ShowArrow);
693
+ copy.setIgnoreUntrustedSSLError(ignoreUntrustedSSLError);
694
+ copy.setPreShowScript(preShowScript);
695
+ copy.setToolbarTextColor(toolbarTextColor);
696
+ copy.setProxyRequestsPattern(proxyRequestsPattern);
697
+ copy.setProxyRequests(proxyRequests);
698
+ copy.setOutboundProxyRules(new ArrayList<>(outboundProxyRules));
699
+ copy.setInboundProxyRules(new ArrayList<>(inboundProxyRules));
700
+ copy.setMaterialPicker(materialPicker);
701
+ copy.setTextZoom(textZoom);
702
+ copy.setPreventDeeplink(preventDeeplink);
703
+ copy.setOpenBlankTargetInWebView(openBlankTargetInWebView);
704
+ copy.setAuthorizedAppLinks(new ArrayList<>(authorizedAppLinks));
705
+ copy.setEnabledSafeMargin(enabledSafeBottomMargin);
706
+ copy.setEnabledSafeTopMargin(enabledSafeTopMargin);
707
+ copy.setUseTopInset(useTopInset);
708
+ copy.setEnableGooglePaySupport(enableGooglePaySupport);
709
+ copy.setBlockedHosts(new ArrayList<>(getBlockedHosts()));
710
+ copy.setWidth(width);
711
+ copy.setHeight(height);
712
+ copy.setX(x);
713
+ copy.setY(y);
714
+ copy.setHidden(hidden || hiddenPopupWindow);
715
+ copy.setShowScreenshotButton(showScreenshotButton);
716
+ copy.setAllowWebViewJsVisibilityControl(allowWebViewJsVisibilityControl);
717
+ copy.setAllowScreenshotsFromWebPage(allowScreenshotsFromWebPage);
718
+ copy.setCaptureConsoleLogs(captureConsoleLogs);
719
+ copy.setHandleDownloads(handleDownloads);
720
+ copy.setInvisibilityMode(invisibilityMode);
721
+ copy.setPopupWindowMode(true);
722
+ copy.setHiddenPopupWindow(hiddenPopupWindow);
723
+ return copy;
724
+ }
725
+ }