@capgo/capacitor-inappbrowser 8.18.0 → 8.18.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/android/src/main/assets/proxy-bridge.js +6 -6
- package/android/src/main/java/ee/forgr/capacitor_inappbrowser/CapgoInAppBrowserPlugin.java +4 -1
- package/android/src/main/java/ee/forgr/capacitor_inappbrowser/WebViewDialog.java +12 -15
- package/dist/esm/index.js +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/plugin.cjs.js +1 -1
- package/dist/plugin.cjs.js.map +1 -1
- package/dist/plugin.js +1 -1
- package/dist/plugin.js.map +1 -1
- package/ios/Sources/InAppBrowserPlugin/InAppBrowserPlugin.swift +1 -1
- package/ios/Sources/InAppBrowserPlugin/Resources/proxy-bridge.js +6 -6
- package/package.json +9 -10
|
@@ -81,7 +81,7 @@
|
|
|
81
81
|
function resolveProxyBridgeUrl(rawUrl, baseUrl) {
|
|
82
82
|
try {
|
|
83
83
|
return new URL(rawUrl, baseUrl).href;
|
|
84
|
-
} catch (
|
|
84
|
+
} catch (e) {
|
|
85
85
|
return null;
|
|
86
86
|
}
|
|
87
87
|
}
|
|
@@ -130,7 +130,7 @@
|
|
|
130
130
|
form.requestSubmit();
|
|
131
131
|
}
|
|
132
132
|
return;
|
|
133
|
-
} catch (
|
|
133
|
+
} catch (e) {
|
|
134
134
|
delete form.__capgoSkipNextProxySubmit;
|
|
135
135
|
}
|
|
136
136
|
}
|
|
@@ -168,7 +168,7 @@
|
|
|
168
168
|
if (proxyRegexSource) {
|
|
169
169
|
try {
|
|
170
170
|
proxyRequestPattern = new RegExp(proxyRegexSource);
|
|
171
|
-
} catch (
|
|
171
|
+
} catch (e) {
|
|
172
172
|
proxyRequestPattern = null;
|
|
173
173
|
}
|
|
174
174
|
}
|
|
@@ -209,7 +209,7 @@
|
|
|
209
209
|
if (url && !url.match(/^[a-zA-Z][a-zA-Z0-9+\-.]*:\/\//)) {
|
|
210
210
|
try {
|
|
211
211
|
return new URL(url, getDocumentBaseUrl()).href;
|
|
212
|
-
} catch (
|
|
212
|
+
} catch (e) {
|
|
213
213
|
return url;
|
|
214
214
|
}
|
|
215
215
|
}
|
|
@@ -289,7 +289,7 @@
|
|
|
289
289
|
if (submitter instanceof HTMLElement) {
|
|
290
290
|
try {
|
|
291
291
|
return new FormData(form, submitter);
|
|
292
|
-
} catch (
|
|
292
|
+
} catch (e) {
|
|
293
293
|
}
|
|
294
294
|
}
|
|
295
295
|
return new FormData(form);
|
|
@@ -450,7 +450,7 @@
|
|
|
450
450
|
let proxyUrl;
|
|
451
451
|
try {
|
|
452
452
|
proxyUrl = yield storeInterceptedRequest(url, method, headers, body, credentialsMode);
|
|
453
|
-
} catch (
|
|
453
|
+
} catch (e) {
|
|
454
454
|
return originalFetch.call(window, input, init);
|
|
455
455
|
}
|
|
456
456
|
const proxyResponse = yield originalFetch.call(globalThis, proxyUrl, {
|
|
@@ -1394,7 +1394,10 @@ public class CapgoInAppBrowserPlugin extends Plugin implements WebViewDialog.Per
|
|
|
1394
1394
|
availableResources.append(drawables[i].getName()).append(", ");
|
|
1395
1395
|
}
|
|
1396
1396
|
if (drawables.length > 10) {
|
|
1397
|
-
availableResources
|
|
1397
|
+
availableResources
|
|
1398
|
+
.append("... (")
|
|
1399
|
+
.append(drawables.length - 10)
|
|
1400
|
+
.append(" more)");
|
|
1398
1401
|
}
|
|
1399
1402
|
return availableResources;
|
|
1400
1403
|
}
|
|
@@ -2373,7 +2373,7 @@ public class WebViewDialog extends ComponentDialog implements ProxyResponseRouti
|
|
|
2373
2373
|
"Has camera permission: " +
|
|
2374
2374
|
(activity != null &&
|
|
2375
2375
|
activity.checkSelfPermission(android.Manifest.permission.CAMERA) ==
|
|
2376
|
-
|
|
2376
|
+
android.content.pm.PackageManager.PERMISSION_GRANTED)
|
|
2377
2377
|
);
|
|
2378
2378
|
|
|
2379
2379
|
// Check if the file chooser is already open
|
|
@@ -6824,22 +6824,19 @@ public class WebViewDialog extends ComponentDialog implements ProxyResponseRouti
|
|
|
6824
6824
|
if (executorService.isShutdown()) {
|
|
6825
6825
|
return;
|
|
6826
6826
|
}
|
|
6827
|
-
Thread shutdownThread = new Thread(
|
|
6828
|
-
|
|
6829
|
-
|
|
6830
|
-
|
|
6831
|
-
if (!executorService.awaitTermination(500, TimeUnit.MILLISECONDS)) {
|
|
6832
|
-
executorService.shutdownNow();
|
|
6833
|
-
}
|
|
6834
|
-
} catch (InterruptedException e) {
|
|
6835
|
-
Thread.currentThread().interrupt();
|
|
6827
|
+
Thread shutdownThread = new Thread(() -> {
|
|
6828
|
+
try {
|
|
6829
|
+
executorService.shutdown();
|
|
6830
|
+
if (!executorService.awaitTermination(500, TimeUnit.MILLISECONDS)) {
|
|
6836
6831
|
executorService.shutdownNow();
|
|
6837
|
-
} catch (Exception e) {
|
|
6838
|
-
Log.e("InAppBrowser", "Error shutting down executor: " + e.getMessage());
|
|
6839
6832
|
}
|
|
6840
|
-
}
|
|
6841
|
-
|
|
6842
|
-
|
|
6833
|
+
} catch (InterruptedException e) {
|
|
6834
|
+
Thread.currentThread().interrupt();
|
|
6835
|
+
executorService.shutdownNow();
|
|
6836
|
+
} catch (Exception e) {
|
|
6837
|
+
Log.e("InAppBrowser", "Error shutting down executor: " + e.getMessage());
|
|
6838
|
+
}
|
|
6839
|
+
}, "InAppBrowser-ExecutorShutdown");
|
|
6843
6840
|
shutdownThread.setDaemon(true);
|
|
6844
6841
|
shutdownThread.start();
|
|
6845
6842
|
}
|
package/dist/esm/index.js
CHANGED
package/dist/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAG5D,OAAO,EACL,qBAAqB,EACrB,qBAAqB,EACrB,uBAAuB,EACvB,6BAA6B,GAE9B,MAAM,yBAAyB,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import type { PluginListenerHandle } from '@capacitor/core';\n\nimport {\n containsPathTraversal,\n isRelativeBundledPath,\n parseBundledLocalConfig,\n resolveLegacyNativeWebViewUrl,\n type BundledAssetPlatform,\n} from './bundled-asset-support';\nimport type {\n InAppBrowserPlugin,\n OpenWebViewOptions,\n ProxyDecision,\n ProxyHandler,\n ProxyRequestOverride,\n ProxyResponse,\n} from './definitions';\n\nconst CAPGO_PLUGIN_NAME = 'CapgoInAppBrowser';\nconst PREVIOUS_PLUGIN_NAME = 'InAppBrowser';\n\nfunction resolvePluginName(): string {\n if (!Capacitor.isNativePlatform()) {\n return CAPGO_PLUGIN_NAME;\n }\n\n if (Capacitor.isPluginAvailable(CAPGO_PLUGIN_NAME)) {\n return CAPGO_PLUGIN_NAME;\n }\n\n if (Capacitor.isPluginAvailable(PREVIOUS_PLUGIN_NAME)) {\n return PREVIOUS_PLUGIN_NAME;\n }\n\n console.warn(\n `[InAppBrowser] Neither '${CAPGO_PLUGIN_NAME}' nor '${PREVIOUS_PLUGIN_NAME}' native plugin detected. ` +\n 'Ensure @capgo/capacitor-inappbrowser native code is installed.',\n );\n return CAPGO_PLUGIN_NAME;\n}\n\nconst inAppBrowserImplementations = {\n web: () => import('./web').then((m) => new m.InAppBrowserWeb()),\n};\n\nfunction assertValidBundledAssetPath(url: string): void {\n if (isRelativeBundledPath(url) && containsPathTraversal(url)) {\n throw new Error('Invalid bundled asset path');\n }\n}\n\nconst activePluginName = resolvePluginName();\n\nfunction bundledAssetPlatform(): BundledAssetPlatform {\n return Capacitor.getPlatform() === 'ios' ? 'ios' : 'android';\n}\n\nfunction getConfiguredLocalConfig() {\n if (!Capacitor.isNativePlatform()) {\n return null;\n }\n\n const getServerUrl = (Capacitor as { getServerUrl?: () => string }).getServerUrl;\n if (typeof getServerUrl !== 'function') {\n return null;\n }\n\n return parseBundledLocalConfig(getServerUrl());\n}\n\nfunction prepareUrlOptions<T extends { url: string }>(options: T): T {\n assertValidBundledAssetPath(options.url);\n\n if (!Capacitor.isNativePlatform() || activePluginName !== PREVIOUS_PLUGIN_NAME) {\n return options;\n }\n\n return {\n ...options,\n url: resolveLegacyNativeWebViewUrl(options.url, bundledAssetPlatform(), getConfiguredLocalConfig()),\n };\n}\n\nconst baseInAppBrowser = registerPlugin<InAppBrowserPlugin>(activePluginName, inAppBrowserImplementations);\n\nconst InAppBrowser = new Proxy(baseInAppBrowser, {\n get(target, prop, receiver) {\n if (prop === 'openWebView') {\n return (options: OpenWebViewOptions) => target.openWebView(prepareUrlOptions(options));\n }\n if (prop === 'setUrl') {\n return (options: Parameters<InAppBrowserPlugin['setUrl']>[0]) => target.setUrl(prepareUrlOptions(options));\n }\n\n const value = Reflect.get(target, prop, receiver);\n if (typeof value === 'function') {\n return value.bind(target);\n }\n return value;\n },\n}) as InAppBrowserPlugin;\n\nfunction arrayBufferToBase64(buffer: ArrayBuffer): string {\n const bytes = new Uint8Array(buffer);\n let binary = '';\n for (let i = 0; i < bytes.byteLength; i++) {\n binary += String.fromCharCode(bytes[i]);\n }\n return btoa(binary);\n}\n\nfunction headersToRecord(headers: Headers): Record<string, string> {\n const result: Record<string, string> = {};\n headers.forEach((value, key) => {\n result[key] = value;\n });\n return result;\n}\n\nfunction errorMessage(error: unknown): string {\n if (error instanceof Error) {\n return error.message;\n }\n if (typeof error === 'string') {\n return error;\n }\n if (error && typeof error === 'object' && 'message' in error && typeof error.message === 'string') {\n return error.message;\n }\n return String(error);\n}\n\nfunction isStaleProxyResponseError(error: unknown): boolean {\n const message = errorMessage(error);\n return message.includes('No proxy handler found') || message.includes('Target WebView not found for proxy request');\n}\n\nfunction isProxyResponse(value: unknown): value is ProxyResponse {\n return (\n value !== null &&\n typeof value === 'object' &&\n 'status' in value &&\n 'headers' in value &&\n !(value instanceof Response)\n );\n}\n\nfunction isProxyRequestOverride(value: unknown): value is ProxyRequestOverride {\n return value !== null && typeof value === 'object' && 'url' in value && !(value instanceof Response);\n}\n\nfunction isProxyDecision(value: unknown): value is ProxyDecision {\n return (\n value !== null && typeof value === 'object' && ('request' in value || 'response' in value || 'cancel' in value)\n );\n}\n\nasync function sendProxyDecision(\n requestId: string,\n webviewId: string | undefined,\n decision: ProxyDecision | null,\n phase: 'outbound' | 'inbound',\n): Promise<void> {\n try {\n await InAppBrowser.handleProxyRequest({\n requestId,\n webviewId,\n decision,\n phase,\n } as Parameters<typeof InAppBrowser.handleProxyRequest>[0]);\n } catch (error) {\n if (isStaleProxyResponseError(error)) {\n return;\n }\n throw error;\n }\n}\n\nasync function resolveProxyHandlerDecision(\n callback: ProxyHandler,\n event: Parameters<ProxyHandler>[0],\n): Promise<ProxyDecision | null> {\n try {\n const result = await callback(event);\n if (result === null) {\n return null;\n }\n if (isProxyDecision(result)) {\n return result;\n }\n if (isProxyRequestOverride(result)) {\n return { request: result };\n }\n if (isProxyResponse(result)) {\n return { response: result };\n }\n const cloned = result.clone();\n const buffer = await cloned.arrayBuffer();\n return {\n response: {\n body: arrayBufferToBase64(buffer),\n status: result.status,\n headers: headersToRecord(result.headers),\n },\n };\n } catch (_error) {\n return null;\n }\n}\n\nconst addProxyHandler = (callback: ProxyHandler): Promise<PluginListenerHandle> => {\n return InAppBrowser.addListener('proxyRequest', (event) => {\n void (async () => {\n const decision = await resolveProxyHandlerDecision(callback, event);\n await sendProxyDecision(event.requestId, event.webviewId, decision, event.phase);\n })();\n });\n};\n\nexport * from './definitions';\nexport { InAppBrowser, addProxyHandler };\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAG5D,OAAO,EACL,qBAAqB,EACrB,qBAAqB,EACrB,uBAAuB,EACvB,6BAA6B,GAE9B,MAAM,yBAAyB,CAAC;AAUjC,MAAM,iBAAiB,GAAG,mBAAmB,CAAC;AAC9C,MAAM,oBAAoB,GAAG,cAAc,CAAC;AAE5C,SAAS,iBAAiB;IACxB,IA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CAAC,EAAE,CAAC;YACnC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC;QAC7B,CAAC;QACD,IAAI,eAAe,CAAC,MAAM,CAAC,EAAE,CAAC;YAC5B,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC;QAC9B,CAAC;QACD,MAAM,MAAM,GAAG,MAAM,CAAC,KAAK,EAAE,CAAC;QAC9B,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,WAAW,EAAE,CAAC;QAC1C,OAAO;YACL,QAAQ,EAAE;gBACR,IAAI,EAAE,mBAAmB,CAAC,MAAM,CAAC;gBACjC,MAAM,EAAE,MAAM,CAAC,MAAM;gBACrB,OAAO,EAAE,eAAe,CAAC,MAAM,CAAC,OAAO,CAAC;aACzC;SACF,CAAC;IACJ,CAAC;IAAC,WAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC;AAED,MAAM,eAAe,GAAG,CAAC,QAAsB,EAAiC,EAAE;IAChF,OAAO,YAAY,CAAC,WAAW,CAAC,cAAc,EAAE,CAAC,KAAK,EAAE,EAAE;QACxD,KAAK,CAAC,KAAK,IAAI,EAAE;YACf,MAAM,QAAQ,GAAG,MAAM,2BAA2B,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;YACpE,MAAM,iBAAiB,CAAC,KAAK,CAAC,SAAS,EAAE,KAAK,CAAC,SAAS,EAAE,QAAQ,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC;QACnF,CAAC,CAAC,EAAE,CAAC;IACP,CAAC,CAAC,CAAC;AACL,CAAC,CAAC;AAEF,cAAc,eAAe,CAAC;AAC9B,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,CAAC","sourcesContent":["import { Capacitor, registerPlugin } from '@capacitor/core';\nimport type { PluginListenerHandle } from '@capacitor/core';\n\nimport {\n containsPathTraversal,\n isRelativeBundledPath,\n parseBundledLocalConfig,\n resolveLegacyNativeWebViewUrl,\n type BundledAssetPlatform,\n} from './bundled-asset-support';\nimport type {\n InAppBrowserPlugin,\n OpenWebViewOptions,\n ProxyDecision,\n ProxyHandler,\n ProxyRequestOverride,\n ProxyResponse,\n} from './definitions';\n\nconst CAPGO_PLUGIN_NAME = 'CapgoInAppBrowser';\nconst PREVIOUS_PLUGIN_NAME = 'InAppBrowser';\n\nfunction resolvePluginName(): string {\n if (!Capacitor.isNativePlatform()) {\n return CAPGO_PLUGIN_NAME;\n }\n\n if (Capacitor.isPluginAvailable(CAPGO_PLUGIN_NAME)) {\n return CAPGO_PLUGIN_NAME;\n }\n\n if (Capacitor.isPluginAvailable(PREVIOUS_PLUGIN_NAME)) {\n return PREVIOUS_PLUGIN_NAME;\n }\n\n console.warn(\n `[InAppBrowser] Neither '${CAPGO_PLUGIN_NAME}' nor '${PREVIOUS_PLUGIN_NAME}' native plugin detected. ` +\n 'Ensure @capgo/capacitor-inappbrowser native code is installed.',\n );\n return CAPGO_PLUGIN_NAME;\n}\n\nconst inAppBrowserImplementations = {\n web: () => import('./web').then((m) => new m.InAppBrowserWeb()),\n};\n\nfunction assertValidBundledAssetPath(url: string): void {\n if (isRelativeBundledPath(url) && containsPathTraversal(url)) {\n throw new Error('Invalid bundled asset path');\n }\n}\n\nconst activePluginName = resolvePluginName();\n\nfunction bundledAssetPlatform(): BundledAssetPlatform {\n return Capacitor.getPlatform() === 'ios' ? 'ios' : 'android';\n}\n\nfunction getConfiguredLocalConfig() {\n if (!Capacitor.isNativePlatform()) {\n return null;\n }\n\n const getServerUrl = (Capacitor as { getServerUrl?: () => string }).getServerUrl;\n if (typeof getServerUrl !== 'function') {\n return null;\n }\n\n return parseBundledLocalConfig(getServerUrl());\n}\n\nfunction prepareUrlOptions<T extends { url: string }>(options: T): T {\n assertValidBundledAssetPath(options.url);\n\n if (!Capacitor.isNativePlatform() || activePluginName !== PREVIOUS_PLUGIN_NAME) {\n return options;\n }\n\n return {\n ...options,\n url: resolveLegacyNativeWebViewUrl(options.url, bundledAssetPlatform(), getConfiguredLocalConfig()),\n };\n}\n\nconst baseInAppBrowser = registerPlugin<InAppBrowserPlugin>(activePluginName, inAppBrowserImplementations);\n\nconst InAppBrowser = new Proxy(baseInAppBrowser, {\n get(target, prop, receiver) {\n if (prop === 'openWebView') {\n return (options: OpenWebViewOptions) => target.openWebView(prepareUrlOptions(options));\n }\n if (prop === 'setUrl') {\n return (options: Parameters<InAppBrowserPlugin['setUrl']>[0]) => target.setUrl(prepareUrlOptions(options));\n }\n\n const value = Reflect.get(target, prop, receiver);\n if (typeof value === 'function') {\n return value.bind(target);\n }\n return value;\n },\n}) as InAppBrowserPlugin;\n\nfunction arrayBufferToBase64(buffer: ArrayBuffer): string {\n const bytes = new Uint8Array(buffer);\n let binary = '';\n for (let i = 0; i < bytes.byteLength; i++) {\n binary += String.fromCharCode(bytes[i]);\n }\n return btoa(binary);\n}\n\nfunction headersToRecord(headers: Headers): Record<string, string> {\n const result: Record<string, string> = {};\n headers.forEach((value, key) => {\n result[key] = value;\n });\n return result;\n}\n\nfunction errorMessage(error: unknown): string {\n if (error instanceof Error) {\n return error.message;\n }\n if (typeof error === 'string') {\n return error;\n }\n if (error && typeof error === 'object' && 'message' in error && typeof error.message === 'string') {\n return error.message;\n }\n return String(error);\n}\n\nfunction isStaleProxyResponseError(error: unknown): boolean {\n const message = errorMessage(error);\n return message.includes('No proxy handler found') || message.includes('Target WebView not found for proxy request');\n}\n\nfunction isProxyResponse(value: unknown): value is ProxyResponse {\n return (\n value !== null &&\n typeof value === 'object' &&\n 'status' in value &&\n 'headers' in value &&\n !(value instanceof Response)\n );\n}\n\nfunction isProxyRequestOverride(value: unknown): value is ProxyRequestOverride {\n return value !== null && typeof value === 'object' && 'url' in value && !(value instanceof Response);\n}\n\nfunction isProxyDecision(value: unknown): value is ProxyDecision {\n return (\n value !== null && typeof value === 'object' && ('request' in value || 'response' in value || 'cancel' in value)\n );\n}\n\nasync function sendProxyDecision(\n requestId: string,\n webviewId: string | undefined,\n decision: ProxyDecision | null,\n phase: 'outbound' | 'inbound',\n): Promise<void> {\n try {\n await InAppBrowser.handleProxyRequest({\n requestId,\n webviewId,\n decision,\n phase,\n } as Parameters<typeof InAppBrowser.handleProxyRequest>[0]);\n } catch (error) {\n if (isStaleProxyResponseError(error)) {\n return;\n }\n throw error;\n }\n}\n\nasync function resolveProxyHandlerDecision(\n callback: ProxyHandler,\n event: Parameters<ProxyHandler>[0],\n): Promise<ProxyDecision | null> {\n try {\n const result = await callback(event);\n if (result === null) {\n return null;\n }\n if (isProxyDecision(result)) {\n return result;\n }\n if (isProxyRequestOverride(result)) {\n return { request: result };\n }\n if (isProxyResponse(result)) {\n return { response: result };\n }\n const cloned = result.clone();\n const buffer = await cloned.arrayBuffer();\n return {\n response: {\n body: arrayBufferToBase64(buffer),\n status: result.status,\n headers: headersToRecord(result.headers),\n },\n };\n } catch {\n return null;\n }\n}\n\nconst addProxyHandler = (callback: ProxyHandler): Promise<PluginListenerHandle> => {\n return InAppBrowser.addListener('proxyRequest', (event) => {\n void (async () => {\n const decision = await resolveProxyHandlerDecision(callback, event);\n await sendProxyDecision(event.requestId, event.webviewId, decision, event.phase);\n })();\n });\n};\n\nexport * from './definitions';\nexport { InAppBrowser, addProxyHandler };\n"]}
|
package/dist/plugin.cjs.js
CHANGED
package/dist/plugin.cjs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.cjs.js","sources":["esm/bundled-asset-support.js","esm/definitions.js","esm/index.js","esm/web.js"],"sourcesContent":["/** Default Capacitor local URL settings used when no runtime config is available. */\nexport const BUNDLED_ASSET_DEFAULTS = {\n ios: { scheme: 'capacitor', host: 'localhost' },\n android: { scheme: 'https', host: 'localhost' },\n};\nconst ABSOLUTE_URL_PATTERN = /^[a-zA-Z][a-zA-Z\\d+\\-.]*:/;\nconst RESERVED_WEB_SCHEMES = ['http', 'https'];\n/** Returns true when the input looks like an absolute URL (including protocol-relative URLs). */\nexport function isAbsoluteUrl(url) {\n return ABSOLUTE_URL_PATTERN.test(url) || url.startsWith('//');\n}\n/** Returns true when any path segment is `..`. */\nexport function containsPathTraversal(path) {\n return path.split('/').includes('..');\n}\n/**\n * Normalizes a relative bundled asset path to a leading-slash form.\n * Returns null when the path contains traversal segments.\n */\nexport function normalizeBundledPath(path) {\n const trimmed = path.trim();\n if (!trimmed || trimmed === '/') {\n return '/';\n }\n if (containsPathTraversal(trimmed)) {\n return null;\n }\n return trimmed.startsWith('/') ? trimmed : `/${trimmed}`;\n}\n/** Parses a Capacitor local URL into scheme and host components. */\nexport function parseBundledLocalConfig(localUrl) {\n if (!localUrl) {\n return null;\n }\n try {\n const parsed = new URL(localUrl.endsWith('/') ? localUrl : `${localUrl}/`);\n if (!parsed.protocol || !parsed.hostname) {\n return null;\n }\n return {\n scheme: parsed.protocol.replace(/:$/, '').toLowerCase(),\n host: parsed.hostname.toLowerCase(),\n };\n }\n catch (_a) {\n return null;\n }\n}\n/** Returns the scheme WebView navigation should use for bundled assets on a platform. */\nexport function handlerSchemeForPlatform(platform, localConfig) {\n if (platform === 'ios' && RESERVED_WEB_SCHEMES.includes(localConfig.scheme)) {\n return BUNDLED_ASSET_DEFAULTS.ios.scheme;\n }\n if (platform === 'android') {\n if (localConfig.scheme === 'http' || localConfig.scheme === 'https') {\n return localConfig.scheme;\n }\n return BUNDLED_ASSET_DEFAULTS.android.scheme;\n }\n return localConfig.scheme;\n}\n/**\n * Returns true when the URL targets the configured Capacitor local host/scheme\n * (including the platform handler scheme rewrite).\n */\nexport function isBundledLocalUrl(url, platform, localConfig) {\n if (!isAbsoluteUrl(url)) {\n return false;\n }\n try {\n const parsed = new URL(url);\n const scheme = parsed.protocol.replace(/:$/, '').toLowerCase();\n const host = parsed.hostname.toLowerCase();\n const config = localConfig !== null && localConfig !== void 0 ? localConfig : BUNDLED_ASSET_DEFAULTS[platform];\n if (host !== config.host) {\n return false;\n }\n if (parsed.port !== '') {\n return false;\n }\n if (scheme === config.scheme || scheme === handlerSchemeForPlatform(platform, config)) {\n return true;\n }\n return RESERVED_WEB_SCHEMES.includes(scheme) && RESERVED_WEB_SCHEMES.includes(config.scheme);\n }\n catch (_a) {\n return false;\n }\n}\n/** Returns true when the input is a non-empty relative bundled asset path. */\nexport function isRelativeBundledPath(url) {\n const trimmed = url.trim();\n if (!trimmed) {\n return false;\n }\n return !isAbsoluteUrl(trimmed);\n}\nfunction rewriteBundledLocalUrl(url, localConfig, navigationScheme) {\n try {\n const parsed = new URL(url);\n const host = parsed.hostname.toLowerCase();\n const scheme = parsed.protocol.replace(/:$/, '').toLowerCase();\n if (host !== localConfig.host || scheme === navigationScheme) {\n return null;\n }\n const pathname = parsed.pathname || '/';\n const search = parsed.search;\n const hash = parsed.hash;\n const userinfo = parsed.username.length > 0 ? `${parsed.username}${parsed.password.length > 0 ? `:${parsed.password}` : ''}@` : '';\n return `${navigationScheme}://${userinfo}${host}${pathname}${search}${hash}`;\n }\n catch (_a) {\n return null;\n }\n}\n/**\n * Resolves a bundled asset URL for the given platform.\n * Relative paths become platform-local URLs; bundled local URLs may be rewritten to the handler scheme.\n */\nexport function resolveBundledAssetUrl(url, platform, localConfig) {\n const trimmed = url.trim();\n const config = localConfig !== null && localConfig !== void 0 ? localConfig : BUNDLED_ASSET_DEFAULTS[platform];\n const navigationScheme = handlerSchemeForPlatform(platform, config);\n if (isRelativeBundledPath(trimmed)) {\n const path = normalizeBundledPath(trimmed);\n if (path === null) {\n return null;\n }\n return {\n url: `${navigationScheme}://${config.host}${path}`,\n };\n }\n if (isBundledLocalUrl(trimmed, platform, config)) {\n const rewritten = rewriteBundledLocalUrl(trimmed, config, navigationScheme);\n return {\n url: rewritten !== null && rewritten !== void 0 ? rewritten : trimmed,\n };\n }\n return {\n url: trimmed,\n };\n}\n/**\n * Resolves relative bundled paths for legacy native plugins that do not perform native resolution.\n * Throws when the path is invalid.\n */\nexport function resolveLegacyNativeWebViewUrl(url, platform, localConfig) {\n if (!isRelativeBundledPath(url)) {\n return url;\n }\n const resolution = resolveBundledAssetUrl(url, platform, localConfig);\n if (resolution === null) {\n throw new Error('Invalid bundled asset path');\n }\n return resolution.url;\n}\n//# sourceMappingURL=bundled-asset-support.js.map","export var BackgroundColor;\n(function (BackgroundColor) {\n BackgroundColor[\"WHITE\"] = \"white\";\n BackgroundColor[\"BLACK\"] = \"black\";\n})(BackgroundColor || (BackgroundColor = {}));\nexport var ToolBarType;\n(function (ToolBarType) {\n /**\n * Shows a simple toolbar with just a close button and share button\n * @since 0.1.0\n */\n ToolBarType[\"ACTIVITY\"] = \"activity\";\n /**\n * Shows a simple toolbar with just a close button\n * @since 7.6.8\n */\n ToolBarType[\"COMPACT\"] = \"compact\";\n /**\n * Shows a full navigation toolbar with back/forward buttons\n * @since 0.1.0\n */\n ToolBarType[\"NAVIGATION\"] = \"navigation\";\n /**\n * Shows no toolbar\n * @since 0.1.0\n */\n ToolBarType[\"BLANK\"] = \"blank\";\n})(ToolBarType || (ToolBarType = {}));\nexport var InvisibilityMode;\n(function (InvisibilityMode) {\n /**\n * WebView is aware it is hidden (dimensions may be zero).\n */\n InvisibilityMode[\"AWARE\"] = \"AWARE\";\n /**\n * WebView is hidden but reports fullscreen dimensions (uses alpha=0 to remain invisible).\n */\n InvisibilityMode[\"FAKE_VISIBLE\"] = \"FAKE_VISIBLE\";\n})(InvisibilityMode || (InvisibilityMode = {}));\nexport var CloseAction;\n(function (CloseAction) {\n /**\n * The toolbar close button closes and destroys the webview.\n */\n CloseAction[\"CLOSE\"] = \"close\";\n /**\n * The toolbar close button hides the webview so it can be shown again.\n */\n CloseAction[\"HIDE\"] = \"hide\";\n})(CloseAction || (CloseAction = {}));\nexport var CloseButtonPosition;\n(function (CloseButtonPosition) {\n /**\n * Leading edge of the toolbar (left in left-to-right layouts).\n */\n CloseButtonPosition[\"START\"] = \"start\";\n /**\n * Trailing edge of the toolbar (right in left-to-right layouts).\n */\n CloseButtonPosition[\"END\"] = \"end\";\n})(CloseButtonPosition || (CloseButtonPosition = {}));\n//# sourceMappingURL=definitions.js.map","import { Capacitor, registerPlugin } from '@capacitor/core';\nimport { containsPathTraversal, isRelativeBundledPath, parseBundledLocalConfig, resolveLegacyNativeWebViewUrl, } from './bundled-asset-support';\nconst CAPGO_PLUGIN_NAME = 'CapgoInAppBrowser';\nconst PREVIOUS_PLUGIN_NAME = 'InAppBrowser';\nfunction resolvePluginName() {\n if (!Capacitor.isNativePlatform()) {\n return CAPGO_PLUGIN_NAME;\n }\n if (Capacitor.isPluginAvailable(CAPGO_PLUGIN_NAME)) {\n return CAPGO_PLUGIN_NAME;\n }\n if (Capacitor.isPluginAvailable(PREVIOUS_PLUGIN_NAME)) {\n return PREVIOUS_PLUGIN_NAME;\n }\n console.warn(`[InAppBrowser] Neither '${CAPGO_PLUGIN_NAME}' nor '${PREVIOUS_PLUGIN_NAME}' native plugin detected. ` +\n 'Ensure @capgo/capacitor-inappbrowser native code is installed.');\n return CAPGO_PLUGIN_NAME;\n}\nconst inAppBrowserImplementations = {\n web: () => import('./web').then((m) => new m.InAppBrowserWeb()),\n};\nfunction assertValidBundledAssetPath(url) {\n if (isRelativeBundledPath(url) && containsPathTraversal(url)) {\n throw new Error('Invalid bundled asset path');\n }\n}\nconst activePluginName = resolvePluginName();\nfunction bundledAssetPlatform() {\n return Capacitor.getPlatform() === 'ios' ? 'ios' : 'android';\n}\nfunction getConfiguredLocalConfig() {\n if (!Capacitor.isNativePlatform()) {\n return null;\n }\n const getServerUrl = Capacitor.getServerUrl;\n if (typeof getServerUrl !== 'function') {\n return null;\n }\n return parseBundledLocalConfig(getServerUrl());\n}\nfunction prepareUrlOptions(options) {\n assertValidBundledAssetPath(options.url);\n if (!Capacitor.isNativePlatform() || activePluginName !== PREVIOUS_PLUGIN_NAME) {\n return options;\n }\n return Object.assign(Object.assign({}, options), { url: resolveLegacyNativeWebViewUrl(options.url, bundledAssetPlatform(), getConfiguredLocalConfig()) });\n}\nconst baseInAppBrowser = registerPlugin(activePluginName, inAppBrowserImplementations);\nconst InAppBrowser = new Proxy(baseInAppBrowser, {\n get(target, prop, receiver) {\n if (prop === 'openWebView') {\n return (options) => target.openWebView(prepareUrlOptions(options));\n }\n if (prop === 'setUrl') {\n return (options) => target.setUrl(prepareUrlOptions(options));\n }\n const value = Reflect.get(target, prop, receiver);\n if (typeof value === 'function') {\n return value.bind(target);\n }\n return value;\n },\n});\nfunction arrayBufferToBase64(buffer) {\n const bytes = new Uint8Array(buffer);\n let binary = '';\n for (let i = 0; i < bytes.byteLength; i++) {\n binary += String.fromCharCode(bytes[i]);\n }\n return btoa(binary);\n}\nfunction headersToRecord(headers) {\n const result = {};\n headers.forEach((value, key) => {\n result[key] = value;\n });\n return result;\n}\nfunction errorMessage(error) {\n if (error instanceof Error) {\n return error.message;\n }\n if (typeof error === 'string') {\n return error;\n }\n if (error && typeof error === 'object' && 'message' in error && typeof error.message === 'string') {\n return error.message;\n }\n return String(error);\n}\nfunction isStaleProxyResponseError(error) {\n const message = errorMessage(error);\n return message.includes('No proxy handler found') || message.includes('Target WebView not found for proxy request');\n}\nfunction isProxyResponse(value) {\n return (value !== null &&\n typeof value === 'object' &&\n 'status' in value &&\n 'headers' in value &&\n !(value instanceof Response));\n}\nfunction isProxyRequestOverride(value) {\n return value !== null && typeof value === 'object' && 'url' in value && !(value instanceof Response);\n}\nfunction isProxyDecision(value) {\n return (value !== null && typeof value === 'object' && ('request' in value || 'response' in value || 'cancel' in value));\n}\nasync function sendProxyDecision(requestId, webviewId, decision, phase) {\n try {\n await InAppBrowser.handleProxyRequest({\n requestId,\n webviewId,\n decision,\n phase,\n });\n }\n catch (error) {\n if (isStaleProxyResponseError(error)) {\n return;\n }\n throw error;\n }\n}\nasync function resolveProxyHandlerDecision(callback, event) {\n try {\n const result = await callback(event);\n if (result === null) {\n return null;\n }\n if (isProxyDecision(result)) {\n return result;\n }\n if (isProxyRequestOverride(result)) {\n return { request: result };\n }\n if (isProxyResponse(result)) {\n return { response: result };\n }\n const cloned = result.clone();\n const buffer = await cloned.arrayBuffer();\n return {\n response: {\n body: arrayBufferToBase64(buffer),\n status: result.status,\n headers: headersToRecord(result.headers),\n },\n };\n }\n catch (_error) {\n return null;\n }\n}\nconst addProxyHandler = (callback) => {\n return InAppBrowser.addListener('proxyRequest', (event) => {\n void (async () => {\n const decision = await resolveProxyHandlerDecision(callback, event);\n await sendProxyDecision(event.requestId, event.webviewId, decision, event.phase);\n })();\n });\n};\nexport * from './definitions';\nexport { InAppBrowser, addProxyHandler };\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 clearAllBrowsingData() {\n console.log('clearAllBrowsingData');\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(options) {\n console.log('close', options);\n return;\n }\n async hide(options) {\n console.log('hide', options);\n return;\n }\n async show(options) {\n console.log('show', options);\n return;\n }\n async sendToBack(options) {\n console.log('sendToBack not supported on web', options);\n return;\n }\n async bringToFront(options) {\n console.log('bringToFront not supported on web', options);\n return;\n }\n async dispatchInputEvent(options) {\n console.log('dispatchInputEvent not supported on web', options);\n return;\n }\n async setUrl(options) {\n console.log('setUrl', options.url);\n return;\n }\n async reload(options) {\n console.log('reload', options);\n return;\n }\n async postMessage(options) {\n console.log('postMessage', options);\n return options;\n }\n async takeScreenshot(options) {\n console.log('takeScreenshot not supported on web', options);\n throw this.unimplemented('Screenshots are not supported on web.');\n }\n async goBack() {\n console.log('goBack');\n return;\n }\n async getPluginVersion() {\n return { version: 'web' };\n }\n async updateDimensions(options) {\n console.log('updateDimensions', options);\n // Web platform doesn't support dimension control\n return;\n }\n async handleProxyRequest(options) {\n console.log('handleProxyRequest not supported on web', options);\n return;\n }\n async setEnabledSafeTopMargin(options) {\n console.log('setEnabledSafeTopMargin not supported on web', options);\n return;\n }\n async setEnabledSafeBottomMargin(options) {\n console.log('setEnabledSafeBottomMargin not supported on web', options);\n return;\n }\n async openSecureWindow(options) {\n const w = 600;\n const h = 550;\n const settings = [\n ['width', w],\n ['height', h],\n ['left', screen.width / 2 - w / 2],\n ['top', screen.height / 2 - h / 2],\n ]\n .map((x) => x.join('='))\n .join(',');\n const popup = window.open(options.authEndpoint, 'Authorization', settings);\n if (!popup) {\n throw new Error('Failed to open secure window');\n }\n if (typeof popup.focus === 'function') {\n popup.focus();\n }\n return new Promise((resolve, reject) => {\n const bc = new BroadcastChannel(options.broadcastChannelName || 'oauth-channel');\n bc.addEventListener('message', (event) => {\n if (event.data.startsWith(options.redirectUri)) {\n bc.close();\n resolve({ redirectedUri: event.data });\n }\n else {\n bc.close();\n reject(new Error('Redirect URI does not match, expected ' + options.redirectUri + ' but got ' + event.data));\n }\n });\n setTimeout(() => {\n bc.close();\n reject(new Error('The sign-in flow timed out'));\n }, 5 * 60000);\n });\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["BackgroundColor","ToolBarType","InvisibilityMode","CloseAction","CloseButtonPosition","Capacitor","registerPlugin","WebPlugin"],"mappings":";;;;AAAA;AACO,MAAM,sBAAsB,GAAG;AACtC,IAAI,GAAG,EAAE,EAAE,MAAM,EAAE,WAAW,EAAE,IAAI,EAAE,WAAW,EAAE;AACnD,IAAI,OAAO,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE;AACnD,CAAC;AACD,MAAM,oBAAoB,GAAG,2BAA2B;AACxD,MAAM,oBAAoB,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC;AAC9C;AACO,SAAS,aAAa,CAAC,GAAG,EAAE;AACnC,IAAI,OAAO,oBAAoB,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,GAAG,CAA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IAAI,eAAe,CAAC;AAC5F,YAAY,EAAE,CAAC,gBAAgB,CAAC,SAAS,EAAE,CAAC,KAAK,KAAK;AACtD,gBAAgB,IAAI,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,WAAW,CAAC,EAAE;AAChE,oBAAoB,EAAE,CAAC,KAAK,EAAE;AAC9B,oBAAoB,OAAO,CAAC,EAAE,aAAa,EAAE,KAAK,CAAC,IAAI,EAAE,CAAC;AAC1D,gBAAgB;AAChB,qBAAqB;AACrB,oBAAoB,EAAE,CAAC,KAAK,EAAE;AAC9B,oBAAoB,MAAM,CAAC,IAAI,KAAK,CAAC,wCAAwC,GAAG,OAAO,CAAC,WAAW,GAAG,WAAW,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC;AAChI,gBAAgB;AAChB,YAAY,CAAC,CAAC;AACd,YAAY,UAAU,CAAC,MAAM;AAC7B,gBAAgB,EAAE,CAAC,KAAK,EAAE;AAC1B,gBAAgB,MAAM,CAAC,IAAI,KAAK,CAAC,4BAA4B,CAAC,CAAC;AAC/D,YAAY,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC;AACzB,QAAQ,CAAC,CAAC;AACV,IAAI;AACJ;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"plugin.cjs.js","sources":["esm/bundled-asset-support.js","esm/definitions.js","esm/index.js","esm/web.js"],"sourcesContent":["/** Default Capacitor local URL settings used when no runtime config is available. */\nexport const BUNDLED_ASSET_DEFAULTS = {\n ios: { scheme: 'capacitor', host: 'localhost' },\n android: { scheme: 'https', host: 'localhost' },\n};\nconst ABSOLUTE_URL_PATTERN = /^[a-zA-Z][a-zA-Z\\d+\\-.]*:/;\nconst RESERVED_WEB_SCHEMES = ['http', 'https'];\n/** Returns true when the input looks like an absolute URL (including protocol-relative URLs). */\nexport function isAbsoluteUrl(url) {\n return ABSOLUTE_URL_PATTERN.test(url) || url.startsWith('//');\n}\n/** Returns true when any path segment is `..`. */\nexport function containsPathTraversal(path) {\n return path.split('/').includes('..');\n}\n/**\n * Normalizes a relative bundled asset path to a leading-slash form.\n * Returns null when the path contains traversal segments.\n */\nexport function normalizeBundledPath(path) {\n const trimmed = path.trim();\n if (!trimmed || trimmed === '/') {\n return '/';\n }\n if (containsPathTraversal(trimmed)) {\n return null;\n }\n return trimmed.startsWith('/') ? trimmed : `/${trimmed}`;\n}\n/** Parses a Capacitor local URL into scheme and host components. */\nexport function parseBundledLocalConfig(localUrl) {\n if (!localUrl) {\n return null;\n }\n try {\n const parsed = new URL(localUrl.endsWith('/') ? localUrl : `${localUrl}/`);\n if (!parsed.protocol || !parsed.hostname) {\n return null;\n }\n return {\n scheme: parsed.protocol.replace(/:$/, '').toLowerCase(),\n host: parsed.hostname.toLowerCase(),\n };\n }\n catch (_a) {\n return null;\n }\n}\n/** Returns the scheme WebView navigation should use for bundled assets on a platform. */\nexport function handlerSchemeForPlatform(platform, localConfig) {\n if (platform === 'ios' && RESERVED_WEB_SCHEMES.includes(localConfig.scheme)) {\n return BUNDLED_ASSET_DEFAULTS.ios.scheme;\n }\n if (platform === 'android') {\n if (localConfig.scheme === 'http' || localConfig.scheme === 'https') {\n return localConfig.scheme;\n }\n return BUNDLED_ASSET_DEFAULTS.android.scheme;\n }\n return localConfig.scheme;\n}\n/**\n * Returns true when the URL targets the configured Capacitor local host/scheme\n * (including the platform handler scheme rewrite).\n */\nexport function isBundledLocalUrl(url, platform, localConfig) {\n if (!isAbsoluteUrl(url)) {\n return false;\n }\n try {\n const parsed = new URL(url);\n const scheme = parsed.protocol.replace(/:$/, '').toLowerCase();\n const host = parsed.hostname.toLowerCase();\n const config = localConfig !== null && localConfig !== void 0 ? localConfig : BUNDLED_ASSET_DEFAULTS[platform];\n if (host !== config.host) {\n return false;\n }\n if (parsed.port !== '') {\n return false;\n }\n if (scheme === config.scheme || scheme === handlerSchemeForPlatform(platform, config)) {\n return true;\n }\n return RESERVED_WEB_SCHEMES.includes(scheme) && RESERVED_WEB_SCHEMES.includes(config.scheme);\n }\n catch (_a) {\n return false;\n }\n}\n/** Returns true when the input is a non-empty relative bundled asset path. */\nexport function isRelativeBundledPath(url) {\n const trimmed = url.trim();\n if (!trimmed) {\n return false;\n }\n return !isAbsoluteUrl(trimmed);\n}\nfunction rewriteBundledLocalUrl(url, localConfig, navigationScheme) {\n try {\n const parsed = new URL(url);\n const host = parsed.hostname.toLowerCase();\n const scheme = parsed.protocol.replace(/:$/, '').toLowerCase();\n if (host !== localConfig.host || scheme === navigationScheme) {\n return null;\n }\n const pathname = parsed.pathname || '/';\n const search = parsed.search;\n const hash = parsed.hash;\n const userinfo = parsed.username.length > 0 ? `${parsed.username}${parsed.password.length > 0 ? `:${parsed.password}` : ''}@` : '';\n return `${navigationScheme}://${userinfo}${host}${pathname}${search}${hash}`;\n }\n catch (_a) {\n return null;\n }\n}\n/**\n * Resolves a bundled asset URL for the given platform.\n * Relative paths become platform-local URLs; bundled local URLs may be rewritten to the handler scheme.\n */\nexport function resolveBundledAssetUrl(url, platform, localConfig) {\n const trimmed = url.trim();\n const config = localConfig !== null && localConfig !== void 0 ? localConfig : BUNDLED_ASSET_DEFAULTS[platform];\n const navigationScheme = handlerSchemeForPlatform(platform, config);\n if (isRelativeBundledPath(trimmed)) {\n const path = normalizeBundledPath(trimmed);\n if (path === null) {\n return null;\n }\n return {\n url: `${navigationScheme}://${config.host}${path}`,\n };\n }\n if (isBundledLocalUrl(trimmed, platform, config)) {\n const rewritten = rewriteBundledLocalUrl(trimmed, config, navigationScheme);\n return {\n url: rewritten !== null && rewritten !== void 0 ? rewritten : trimmed,\n };\n }\n return {\n url: trimmed,\n };\n}\n/**\n * Resolves relative bundled paths for legacy native plugins that do not perform native resolution.\n * Throws when the path is invalid.\n */\nexport function resolveLegacyNativeWebViewUrl(url, platform, localConfig) {\n if (!isRelativeBundledPath(url)) {\n return url;\n }\n const resolution = resolveBundledAssetUrl(url, platform, localConfig);\n if (resolution === null) {\n throw new Error('Invalid bundled asset path');\n }\n return resolution.url;\n}\n//# sourceMappingURL=bundled-asset-support.js.map","export var BackgroundColor;\n(function (BackgroundColor) {\n BackgroundColor[\"WHITE\"] = \"white\";\n BackgroundColor[\"BLACK\"] = \"black\";\n})(BackgroundColor || (BackgroundColor = {}));\nexport var ToolBarType;\n(function (ToolBarType) {\n /**\n * Shows a simple toolbar with just a close button and share button\n * @since 0.1.0\n */\n ToolBarType[\"ACTIVITY\"] = \"activity\";\n /**\n * Shows a simple toolbar with just a close button\n * @since 7.6.8\n */\n ToolBarType[\"COMPACT\"] = \"compact\";\n /**\n * Shows a full navigation toolbar with back/forward buttons\n * @since 0.1.0\n */\n ToolBarType[\"NAVIGATION\"] = \"navigation\";\n /**\n * Shows no toolbar\n * @since 0.1.0\n */\n ToolBarType[\"BLANK\"] = \"blank\";\n})(ToolBarType || (ToolBarType = {}));\nexport var InvisibilityMode;\n(function (InvisibilityMode) {\n /**\n * WebView is aware it is hidden (dimensions may be zero).\n */\n InvisibilityMode[\"AWARE\"] = \"AWARE\";\n /**\n * WebView is hidden but reports fullscreen dimensions (uses alpha=0 to remain invisible).\n */\n InvisibilityMode[\"FAKE_VISIBLE\"] = \"FAKE_VISIBLE\";\n})(InvisibilityMode || (InvisibilityMode = {}));\nexport var CloseAction;\n(function (CloseAction) {\n /**\n * The toolbar close button closes and destroys the webview.\n */\n CloseAction[\"CLOSE\"] = \"close\";\n /**\n * The toolbar close button hides the webview so it can be shown again.\n */\n CloseAction[\"HIDE\"] = \"hide\";\n})(CloseAction || (CloseAction = {}));\nexport var CloseButtonPosition;\n(function (CloseButtonPosition) {\n /**\n * Leading edge of the toolbar (left in left-to-right layouts).\n */\n CloseButtonPosition[\"START\"] = \"start\";\n /**\n * Trailing edge of the toolbar (right in left-to-right layouts).\n */\n CloseButtonPosition[\"END\"] = \"end\";\n})(CloseButtonPosition || (CloseButtonPosition = {}));\n//# sourceMappingURL=definitions.js.map","import { Capacitor, registerPlugin } from '@capacitor/core';\nimport { containsPathTraversal, isRelativeBundledPath, parseBundledLocalConfig, resolveLegacyNativeWebViewUrl, } from './bundled-asset-support';\nconst CAPGO_PLUGIN_NAME = 'CapgoInAppBrowser';\nconst PREVIOUS_PLUGIN_NAME = 'InAppBrowser';\nfunction resolvePluginName() {\n if (!Capacitor.isNativePlatform()) {\n return CAPGO_PLUGIN_NAME;\n }\n if (Capacitor.isPluginAvailable(CAPGO_PLUGIN_NAME)) {\n return CAPGO_PLUGIN_NAME;\n }\n if (Capacitor.isPluginAvailable(PREVIOUS_PLUGIN_NAME)) {\n return PREVIOUS_PLUGIN_NAME;\n }\n console.warn(`[InAppBrowser] Neither '${CAPGO_PLUGIN_NAME}' nor '${PREVIOUS_PLUGIN_NAME}' native plugin detected. ` +\n 'Ensure @capgo/capacitor-inappbrowser native code is installed.');\n return CAPGO_PLUGIN_NAME;\n}\nconst inAppBrowserImplementations = {\n web: () => import('./web').then((m) => new m.InAppBrowserWeb()),\n};\nfunction assertValidBundledAssetPath(url) {\n if (isRelativeBundledPath(url) && containsPathTraversal(url)) {\n throw new Error('Invalid bundled asset path');\n }\n}\nconst activePluginName = resolvePluginName();\nfunction bundledAssetPlatform() {\n return Capacitor.getPlatform() === 'ios' ? 'ios' : 'android';\n}\nfunction getConfiguredLocalConfig() {\n if (!Capacitor.isNativePlatform()) {\n return null;\n }\n const getServerUrl = Capacitor.getServerUrl;\n if (typeof getServerUrl !== 'function') {\n return null;\n }\n return parseBundledLocalConfig(getServerUrl());\n}\nfunction prepareUrlOptions(options) {\n assertValidBundledAssetPath(options.url);\n if (!Capacitor.isNativePlatform() || activePluginName !== PREVIOUS_PLUGIN_NAME) {\n return options;\n }\n return Object.assign(Object.assign({}, options), { url: resolveLegacyNativeWebViewUrl(options.url, bundledAssetPlatform(), getConfiguredLocalConfig()) });\n}\nconst baseInAppBrowser = registerPlugin(activePluginName, inAppBrowserImplementations);\nconst InAppBrowser = new Proxy(baseInAppBrowser, {\n get(target, prop, receiver) {\n if (prop === 'openWebView') {\n return (options) => target.openWebView(prepareUrlOptions(options));\n }\n if (prop === 'setUrl') {\n return (options) => target.setUrl(prepareUrlOptions(options));\n }\n const value = Reflect.get(target, prop, receiver);\n if (typeof value === 'function') {\n return value.bind(target);\n }\n return value;\n },\n});\nfunction arrayBufferToBase64(buffer) {\n const bytes = new Uint8Array(buffer);\n let binary = '';\n for (let i = 0; i < bytes.byteLength; i++) {\n binary += String.fromCharCode(bytes[i]);\n }\n return btoa(binary);\n}\nfunction headersToRecord(headers) {\n const result = {};\n headers.forEach((value, key) => {\n result[key] = value;\n });\n return result;\n}\nfunction errorMessage(error) {\n if (error instanceof Error) {\n return error.message;\n }\n if (typeof error === 'string') {\n return error;\n }\n if (error && typeof error === 'object' && 'message' in error && typeof error.message === 'string') {\n return error.message;\n }\n return String(error);\n}\nfunction isStaleProxyResponseError(error) {\n const message = errorMessage(error);\n return message.includes('No proxy handler found') || message.includes('Target WebView not found for proxy request');\n}\nfunction isProxyResponse(value) {\n return (value !== null &&\n typeof value === 'object' &&\n 'status' in value &&\n 'headers' in value &&\n !(value instanceof Response));\n}\nfunction isProxyRequestOverride(value) {\n return value !== null && typeof value === 'object' && 'url' in value && !(value instanceof Response);\n}\nfunction isProxyDecision(value) {\n return (value !== null && typeof value === 'object' && ('request' in value || 'response' in value || 'cancel' in value));\n}\nasync function sendProxyDecision(requestId, webviewId, decision, phase) {\n try {\n await InAppBrowser.handleProxyRequest({\n requestId,\n webviewId,\n decision,\n phase,\n });\n }\n catch (error) {\n if (isStaleProxyResponseError(error)) {\n return;\n }\n throw error;\n }\n}\nasync function resolveProxyHandlerDecision(callback, event) {\n try {\n const result = await callback(event);\n if (result === null) {\n return null;\n }\n if (isProxyDecision(result)) {\n return result;\n }\n if (isProxyRequestOverride(result)) {\n return { request: result };\n }\n if (isProxyResponse(result)) {\n return { response: result };\n }\n const cloned = result.clone();\n const buffer = await cloned.arrayBuffer();\n return {\n response: {\n body: arrayBufferToBase64(buffer),\n status: result.status,\n headers: headersToRecord(result.headers),\n },\n };\n }\n catch (_a) {\n return null;\n }\n}\nconst addProxyHandler = (callback) => {\n return InAppBrowser.addListener('proxyRequest', (event) => {\n void (async () => {\n const decision = await resolveProxyHandlerDecision(callback, event);\n await sendProxyDecision(event.requestId, event.webviewId, decision, event.phase);\n })();\n });\n};\nexport * from './definitions';\nexport { InAppBrowser, addProxyHandler };\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 clearAllBrowsingData() {\n console.log('clearAllBrowsingData');\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(options) {\n console.log('close', options);\n return;\n }\n async hide(options) {\n console.log('hide', options);\n return;\n }\n async show(options) {\n console.log('show', options);\n return;\n }\n async sendToBack(options) {\n console.log('sendToBack not supported on web', options);\n return;\n }\n async bringToFront(options) {\n console.log('bringToFront not supported on web', options);\n return;\n }\n async dispatchInputEvent(options) {\n console.log('dispatchInputEvent not supported on web', options);\n return;\n }\n async setUrl(options) {\n console.log('setUrl', options.url);\n return;\n }\n async reload(options) {\n console.log('reload', options);\n return;\n }\n async postMessage(options) {\n console.log('postMessage', options);\n return options;\n }\n async takeScreenshot(options) {\n console.log('takeScreenshot not supported on web', options);\n throw this.unimplemented('Screenshots are not supported on web.');\n }\n async goBack() {\n console.log('goBack');\n return;\n }\n async getPluginVersion() {\n return { version: 'web' };\n }\n async updateDimensions(options) {\n console.log('updateDimensions', options);\n // Web platform doesn't support dimension control\n return;\n }\n async handleProxyRequest(options) {\n console.log('handleProxyRequest not supported on web', options);\n return;\n }\n async setEnabledSafeTopMargin(options) {\n console.log('setEnabledSafeTopMargin not supported on web', options);\n return;\n }\n async setEnabledSafeBottomMargin(options) {\n console.log('setEnabledSafeBottomMargin not supported on web', options);\n return;\n }\n async openSecureWindow(options) {\n const w = 600;\n const h = 550;\n const settings = [\n ['width', w],\n ['height', h],\n ['left', screen.width / 2 - w / 2],\n ['top', screen.height / 2 - h / 2],\n ]\n .map((x) => x.join('='))\n .join(',');\n const popup = window.open(options.authEndpoint, 'Authorization', settings);\n if (!popup) {\n throw new Error('Failed to open secure window');\n }\n if (typeof popup.focus === 'function') {\n popup.focus();\n }\n return new Promise((resolve, reject) => {\n const bc = new BroadcastChannel(options.broadcastChannelName || 'oauth-channel');\n bc.addEventListener('message', (event) => {\n if (event.data.startsWith(options.redirectUri)) {\n bc.close();\n resolve({ redirectedUri: event.data });\n }\n else {\n bc.close();\n reject(new Error('Redirect URI does not match, expected ' + options.redirectUri + ' but got ' + event.data));\n }\n });\n setTimeout(() => {\n bc.close();\n reject(new Error('The sign-in flow timed out'));\n }, 5 * 60000);\n });\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["BackgroundColor","ToolBarType","InvisibilityMode","CloseAction","CloseButtonPosition","Capacitor","registerPlugin","WebPlugin"],"mappings":";;;;AAAA;AACO,MAAM,sBAAsB,GAAG;AACtC,IAAI,GAAG,EAAE,EAAE,MAAM,EAAE,WAAW,EAAE,IAAI,EAAE,WAAW,EAAE;AACnD,IAAI,OAAO,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE;AACnD,CAAC;AACD,MAAM,oBAAoB,GAAG,2BAA2B;AACxD,MAAM,oBAAoB,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC;AAC9C;AACO,SAAS,aAAa,CAAC,GAAG,EAAE;AACnC,IAAI,OAAO,oBAAoB,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,GAAG,CAAC,UAAU,CAAC,IAAI,CAAC;AACjE;AACA;AACO,SAAS,qBAAqB,CAAC,IAA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E,CAAC,KAAK,KAAK;AACtD,gBAAgB,IAAI,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,WAAW,CAAC,EAAE;AAChE,oBAAoB,EAAE,CAAC,KAAK,EAAE;AAC9B,oBAAoB,OAAO,CAAC,EAAE,aAAa,EAAE,KAAK,CAAC,IAAI,EAAE,CAAC;AAC1D,gBAAgB;AAChB,qBAAqB;AACrB,oBAAoB,EAAE,CAAC,KAAK,EAAE;AAC9B,oBAAoB,MAAM,CAAC,IAAI,KAAK,CAAC,wCAAwC,GAAG,OAAO,CAAC,WAAW,GAAG,WAAW,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC;AAChI,gBAAgB;AAChB,YAAY,CAAC,CAAC;AACd,YAAY,UAAU,CAAC,MAAM;AAC7B,gBAAgB,EAAE,CAAC,KAAK,EAAE;AAC1B,gBAAgB,MAAM,CAAC,IAAI,KAAK,CAAC,4BAA4B,CAAC,CAAC;AAC/D,YAAY,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC;AACzB,QAAQ,CAAC,CAAC;AACV,IAAI;AACJ;;;;;;;;;;"}
|
package/dist/plugin.js
CHANGED
package/dist/plugin.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.js","sources":["esm/bundled-asset-support.js","esm/definitions.js","esm/index.js","esm/web.js"],"sourcesContent":["/** Default Capacitor local URL settings used when no runtime config is available. */\nexport const BUNDLED_ASSET_DEFAULTS = {\n ios: { scheme: 'capacitor', host: 'localhost' },\n android: { scheme: 'https', host: 'localhost' },\n};\nconst ABSOLUTE_URL_PATTERN = /^[a-zA-Z][a-zA-Z\\d+\\-.]*:/;\nconst RESERVED_WEB_SCHEMES = ['http', 'https'];\n/** Returns true when the input looks like an absolute URL (including protocol-relative URLs). */\nexport function isAbsoluteUrl(url) {\n return ABSOLUTE_URL_PATTERN.test(url) || url.startsWith('//');\n}\n/** Returns true when any path segment is `..`. */\nexport function containsPathTraversal(path) {\n return path.split('/').includes('..');\n}\n/**\n * Normalizes a relative bundled asset path to a leading-slash form.\n * Returns null when the path contains traversal segments.\n */\nexport function normalizeBundledPath(path) {\n const trimmed = path.trim();\n if (!trimmed || trimmed === '/') {\n return '/';\n }\n if (containsPathTraversal(trimmed)) {\n return null;\n }\n return trimmed.startsWith('/') ? trimmed : `/${trimmed}`;\n}\n/** Parses a Capacitor local URL into scheme and host components. */\nexport function parseBundledLocalConfig(localUrl) {\n if (!localUrl) {\n return null;\n }\n try {\n const parsed = new URL(localUrl.endsWith('/') ? localUrl : `${localUrl}/`);\n if (!parsed.protocol || !parsed.hostname) {\n return null;\n }\n return {\n scheme: parsed.protocol.replace(/:$/, '').toLowerCase(),\n host: parsed.hostname.toLowerCase(),\n };\n }\n catch (_a) {\n return null;\n }\n}\n/** Returns the scheme WebView navigation should use for bundled assets on a platform. */\nexport function handlerSchemeForPlatform(platform, localConfig) {\n if (platform === 'ios' && RESERVED_WEB_SCHEMES.includes(localConfig.scheme)) {\n return BUNDLED_ASSET_DEFAULTS.ios.scheme;\n }\n if (platform === 'android') {\n if (localConfig.scheme === 'http' || localConfig.scheme === 'https') {\n return localConfig.scheme;\n }\n return BUNDLED_ASSET_DEFAULTS.android.scheme;\n }\n return localConfig.scheme;\n}\n/**\n * Returns true when the URL targets the configured Capacitor local host/scheme\n * (including the platform handler scheme rewrite).\n */\nexport function isBundledLocalUrl(url, platform, localConfig) {\n if (!isAbsoluteUrl(url)) {\n return false;\n }\n try {\n const parsed = new URL(url);\n const scheme = parsed.protocol.replace(/:$/, '').toLowerCase();\n const host = parsed.hostname.toLowerCase();\n const config = localConfig !== null && localConfig !== void 0 ? localConfig : BUNDLED_ASSET_DEFAULTS[platform];\n if (host !== config.host) {\n return false;\n }\n if (parsed.port !== '') {\n return false;\n }\n if (scheme === config.scheme || scheme === handlerSchemeForPlatform(platform, config)) {\n return true;\n }\n return RESERVED_WEB_SCHEMES.includes(scheme) && RESERVED_WEB_SCHEMES.includes(config.scheme);\n }\n catch (_a) {\n return false;\n }\n}\n/** Returns true when the input is a non-empty relative bundled asset path. */\nexport function isRelativeBundledPath(url) {\n const trimmed = url.trim();\n if (!trimmed) {\n return false;\n }\n return !isAbsoluteUrl(trimmed);\n}\nfunction rewriteBundledLocalUrl(url, localConfig, navigationScheme) {\n try {\n const parsed = new URL(url);\n const host = parsed.hostname.toLowerCase();\n const scheme = parsed.protocol.replace(/:$/, '').toLowerCase();\n if (host !== localConfig.host || scheme === navigationScheme) {\n return null;\n }\n const pathname = parsed.pathname || '/';\n const search = parsed.search;\n const hash = parsed.hash;\n const userinfo = parsed.username.length > 0 ? `${parsed.username}${parsed.password.length > 0 ? `:${parsed.password}` : ''}@` : '';\n return `${navigationScheme}://${userinfo}${host}${pathname}${search}${hash}`;\n }\n catch (_a) {\n return null;\n }\n}\n/**\n * Resolves a bundled asset URL for the given platform.\n * Relative paths become platform-local URLs; bundled local URLs may be rewritten to the handler scheme.\n */\nexport function resolveBundledAssetUrl(url, platform, localConfig) {\n const trimmed = url.trim();\n const config = localConfig !== null && localConfig !== void 0 ? localConfig : BUNDLED_ASSET_DEFAULTS[platform];\n const navigationScheme = handlerSchemeForPlatform(platform, config);\n if (isRelativeBundledPath(trimmed)) {\n const path = normalizeBundledPath(trimmed);\n if (path === null) {\n return null;\n }\n return {\n url: `${navigationScheme}://${config.host}${path}`,\n };\n }\n if (isBundledLocalUrl(trimmed, platform, config)) {\n const rewritten = rewriteBundledLocalUrl(trimmed, config, navigationScheme);\n return {\n url: rewritten !== null && rewritten !== void 0 ? rewritten : trimmed,\n };\n }\n return {\n url: trimmed,\n };\n}\n/**\n * Resolves relative bundled paths for legacy native plugins that do not perform native resolution.\n * Throws when the path is invalid.\n */\nexport function resolveLegacyNativeWebViewUrl(url, platform, localConfig) {\n if (!isRelativeBundledPath(url)) {\n return url;\n }\n const resolution = resolveBundledAssetUrl(url, platform, localConfig);\n if (resolution === null) {\n throw new Error('Invalid bundled asset path');\n }\n return resolution.url;\n}\n//# sourceMappingURL=bundled-asset-support.js.map","export var BackgroundColor;\n(function (BackgroundColor) {\n BackgroundColor[\"WHITE\"] = \"white\";\n BackgroundColor[\"BLACK\"] = \"black\";\n})(BackgroundColor || (BackgroundColor = {}));\nexport var ToolBarType;\n(function (ToolBarType) {\n /**\n * Shows a simple toolbar with just a close button and share button\n * @since 0.1.0\n */\n ToolBarType[\"ACTIVITY\"] = \"activity\";\n /**\n * Shows a simple toolbar with just a close button\n * @since 7.6.8\n */\n ToolBarType[\"COMPACT\"] = \"compact\";\n /**\n * Shows a full navigation toolbar with back/forward buttons\n * @since 0.1.0\n */\n ToolBarType[\"NAVIGATION\"] = \"navigation\";\n /**\n * Shows no toolbar\n * @since 0.1.0\n */\n ToolBarType[\"BLANK\"] = \"blank\";\n})(ToolBarType || (ToolBarType = {}));\nexport var InvisibilityMode;\n(function (InvisibilityMode) {\n /**\n * WebView is aware it is hidden (dimensions may be zero).\n */\n InvisibilityMode[\"AWARE\"] = \"AWARE\";\n /**\n * WebView is hidden but reports fullscreen dimensions (uses alpha=0 to remain invisible).\n */\n InvisibilityMode[\"FAKE_VISIBLE\"] = \"FAKE_VISIBLE\";\n})(InvisibilityMode || (InvisibilityMode = {}));\nexport var CloseAction;\n(function (CloseAction) {\n /**\n * The toolbar close button closes and destroys the webview.\n */\n CloseAction[\"CLOSE\"] = \"close\";\n /**\n * The toolbar close button hides the webview so it can be shown again.\n */\n CloseAction[\"HIDE\"] = \"hide\";\n})(CloseAction || (CloseAction = {}));\nexport var CloseButtonPosition;\n(function (CloseButtonPosition) {\n /**\n * Leading edge of the toolbar (left in left-to-right layouts).\n */\n CloseButtonPosition[\"START\"] = \"start\";\n /**\n * Trailing edge of the toolbar (right in left-to-right layouts).\n */\n CloseButtonPosition[\"END\"] = \"end\";\n})(CloseButtonPosition || (CloseButtonPosition = {}));\n//# sourceMappingURL=definitions.js.map","import { Capacitor, registerPlugin } from '@capacitor/core';\nimport { containsPathTraversal, isRelativeBundledPath, parseBundledLocalConfig, resolveLegacyNativeWebViewUrl, } from './bundled-asset-support';\nconst CAPGO_PLUGIN_NAME = 'CapgoInAppBrowser';\nconst PREVIOUS_PLUGIN_NAME = 'InAppBrowser';\nfunction resolvePluginName() {\n if (!Capacitor.isNativePlatform()) {\n return CAPGO_PLUGIN_NAME;\n }\n if (Capacitor.isPluginAvailable(CAPGO_PLUGIN_NAME)) {\n return CAPGO_PLUGIN_NAME;\n }\n if (Capacitor.isPluginAvailable(PREVIOUS_PLUGIN_NAME)) {\n return PREVIOUS_PLUGIN_NAME;\n }\n console.warn(`[InAppBrowser] Neither '${CAPGO_PLUGIN_NAME}' nor '${PREVIOUS_PLUGIN_NAME}' native plugin detected. ` +\n 'Ensure @capgo/capacitor-inappbrowser native code is installed.');\n return CAPGO_PLUGIN_NAME;\n}\nconst inAppBrowserImplementations = {\n web: () => import('./web').then((m) => new m.InAppBrowserWeb()),\n};\nfunction assertValidBundledAssetPath(url) {\n if (isRelativeBundledPath(url) && containsPathTraversal(url)) {\n throw new Error('Invalid bundled asset path');\n }\n}\nconst activePluginName = resolvePluginName();\nfunction bundledAssetPlatform() {\n return Capacitor.getPlatform() === 'ios' ? 'ios' : 'android';\n}\nfunction getConfiguredLocalConfig() {\n if (!Capacitor.isNativePlatform()) {\n return null;\n }\n const getServerUrl = Capacitor.getServerUrl;\n if (typeof getServerUrl !== 'function') {\n return null;\n }\n return parseBundledLocalConfig(getServerUrl());\n}\nfunction prepareUrlOptions(options) {\n assertValidBundledAssetPath(options.url);\n if (!Capacitor.isNativePlatform() || activePluginName !== PREVIOUS_PLUGIN_NAME) {\n return options;\n }\n return Object.assign(Object.assign({}, options), { url: resolveLegacyNativeWebViewUrl(options.url, bundledAssetPlatform(), getConfiguredLocalConfig()) });\n}\nconst baseInAppBrowser = registerPlugin(activePluginName, inAppBrowserImplementations);\nconst InAppBrowser = new Proxy(baseInAppBrowser, {\n get(target, prop, receiver) {\n if (prop === 'openWebView') {\n return (options) => target.openWebView(prepareUrlOptions(options));\n }\n if (prop === 'setUrl') {\n return (options) => target.setUrl(prepareUrlOptions(options));\n }\n const value = Reflect.get(target, prop, receiver);\n if (typeof value === 'function') {\n return value.bind(target);\n }\n return value;\n },\n});\nfunction arrayBufferToBase64(buffer) {\n const bytes = new Uint8Array(buffer);\n let binary = '';\n for (let i = 0; i < bytes.byteLength; i++) {\n binary += String.fromCharCode(bytes[i]);\n }\n return btoa(binary);\n}\nfunction headersToRecord(headers) {\n const result = {};\n headers.forEach((value, key) => {\n result[key] = value;\n });\n return result;\n}\nfunction errorMessage(error) {\n if (error instanceof Error) {\n return error.message;\n }\n if (typeof error === 'string') {\n return error;\n }\n if (error && typeof error === 'object' && 'message' in error && typeof error.message === 'string') {\n return error.message;\n }\n return String(error);\n}\nfunction isStaleProxyResponseError(error) {\n const message = errorMessage(error);\n return message.includes('No proxy handler found') || message.includes('Target WebView not found for proxy request');\n}\nfunction isProxyResponse(value) {\n return (value !== null &&\n typeof value === 'object' &&\n 'status' in value &&\n 'headers' in value &&\n !(value instanceof Response));\n}\nfunction isProxyRequestOverride(value) {\n return value !== null && typeof value === 'object' && 'url' in value && !(value instanceof Response);\n}\nfunction isProxyDecision(value) {\n return (value !== null && typeof value === 'object' && ('request' in value || 'response' in value || 'cancel' in value));\n}\nasync function sendProxyDecision(requestId, webviewId, decision, phase) {\n try {\n await InAppBrowser.handleProxyRequest({\n requestId,\n webviewId,\n decision,\n phase,\n });\n }\n catch (error) {\n if (isStaleProxyResponseError(error)) {\n return;\n }\n throw error;\n }\n}\nasync function resolveProxyHandlerDecision(callback, event) {\n try {\n const result = await callback(event);\n if (result === null) {\n return null;\n }\n if (isProxyDecision(result)) {\n return result;\n }\n if (isProxyRequestOverride(result)) {\n return { request: result };\n }\n if (isProxyResponse(result)) {\n return { response: result };\n }\n const cloned = result.clone();\n const buffer = await cloned.arrayBuffer();\n return {\n response: {\n body: arrayBufferToBase64(buffer),\n status: result.status,\n headers: headersToRecord(result.headers),\n },\n };\n }\n catch (_error) {\n return null;\n }\n}\nconst addProxyHandler = (callback) => {\n return InAppBrowser.addListener('proxyRequest', (event) => {\n void (async () => {\n const decision = await resolveProxyHandlerDecision(callback, event);\n await sendProxyDecision(event.requestId, event.webviewId, decision, event.phase);\n })();\n });\n};\nexport * from './definitions';\nexport { InAppBrowser, addProxyHandler };\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 clearAllBrowsingData() {\n console.log('clearAllBrowsingData');\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(options) {\n console.log('close', options);\n return;\n }\n async hide(options) {\n console.log('hide', options);\n return;\n }\n async show(options) {\n console.log('show', options);\n return;\n }\n async sendToBack(options) {\n console.log('sendToBack not supported on web', options);\n return;\n }\n async bringToFront(options) {\n console.log('bringToFront not supported on web', options);\n return;\n }\n async dispatchInputEvent(options) {\n console.log('dispatchInputEvent not supported on web', options);\n return;\n }\n async setUrl(options) {\n console.log('setUrl', options.url);\n return;\n }\n async reload(options) {\n console.log('reload', options);\n return;\n }\n async postMessage(options) {\n console.log('postMessage', options);\n return options;\n }\n async takeScreenshot(options) {\n console.log('takeScreenshot not supported on web', options);\n throw this.unimplemented('Screenshots are not supported on web.');\n }\n async goBack() {\n console.log('goBack');\n return;\n }\n async getPluginVersion() {\n return { version: 'web' };\n }\n async updateDimensions(options) {\n console.log('updateDimensions', options);\n // Web platform doesn't support dimension control\n return;\n }\n async handleProxyRequest(options) {\n console.log('handleProxyRequest not supported on web', options);\n return;\n }\n async setEnabledSafeTopMargin(options) {\n console.log('setEnabledSafeTopMargin not supported on web', options);\n return;\n }\n async setEnabledSafeBottomMargin(options) {\n console.log('setEnabledSafeBottomMargin not supported on web', options);\n return;\n }\n async openSecureWindow(options) {\n const w = 600;\n const h = 550;\n const settings = [\n ['width', w],\n ['height', h],\n ['left', screen.width / 2 - w / 2],\n ['top', screen.height / 2 - h / 2],\n ]\n .map((x) => x.join('='))\n .join(',');\n const popup = window.open(options.authEndpoint, 'Authorization', settings);\n if (!popup) {\n throw new Error('Failed to open secure window');\n }\n if (typeof popup.focus === 'function') {\n popup.focus();\n }\n return new Promise((resolve, reject) => {\n const bc = new BroadcastChannel(options.broadcastChannelName || 'oauth-channel');\n bc.addEventListener('message', (event) => {\n if (event.data.startsWith(options.redirectUri)) {\n bc.close();\n resolve({ redirectedUri: event.data });\n }\n else {\n bc.close();\n reject(new Error('Redirect URI does not match, expected ' + options.redirectUri + ' but got ' + event.data));\n }\n });\n setTimeout(() => {\n bc.close();\n reject(new Error('The sign-in flow timed out'));\n }, 5 * 60000);\n });\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["BackgroundColor","ToolBarType","InvisibilityMode","CloseAction","CloseButtonPosition","Capacitor","registerPlugin","WebPlugin"],"mappings":";;;IAAA;IACO,MAAM,sBAAsB,GAAG;IACtC,IAAI,GAAG,EAAE,EAAE,MAAM,EAAE,WAAW,EAAE,IAAI,EAAE,WAAW,EAAE;IACnD,IAAI,OAAO,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE;IACnD,CAAC;IACD,MAAM,oBAAoB,GAAG,2BAA2B;IACxD,MAAM,oBAAoB,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC;IAC9C;IACO,SAAS,aAAa,CAAC,GAAG,EAAE;IACnC,IAAI,OAAO,oBAAoB,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,GAAG,CAAC,UAAU,CAAC,IAAI,CAAC;IACjE;IACA;IACO,SAAS,qBAAqB,CAAC,IAAI,EAAE;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,KAAK,KAAK;IACtD,gBAAgB,IAAI,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,WAAW,CAAC,EAAE;IAChE,oBAAoB,EAAE,CAAC,KAAK,EAAE;IAC9B,oBAAoB,OAAO,CAAC,EAAE,aAAa,EAAE,KAAK,CAAC,IAAI,EAAE,CAAC;IAC1D,gBAAgB;IAChB,qBAAqB;IACrB,oBAAoB,EAAE,CAAC,KAAK,EAAE;IAC9B,oBAAoB,MAAM,CAAC,IAAI,KAAK,CAAC,wCAAwC,GAAG,OAAO,CAAC,WAAW,GAAG,WAAW,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC;IAChI,gBAAgB;IAChB,YAAY,CAAC,CAAC;IACd,YAAY,UAAU,CAAC,MAAM;IAC7B,gBAAgB,EAAE,CAAC,KAAK,EAAE;IAC1B,gBAAgB,MAAM,CAAC,IAAI,KAAK,CAAC,4BAA4B,CAAC,CAAC;IAC/D,YAAY,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC;IACzB,QAAQ,CAAC,CAAC;IACV,IAAI;IACJ;;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"plugin.js","sources":["esm/bundled-asset-support.js","esm/definitions.js","esm/index.js","esm/web.js"],"sourcesContent":["/** Default Capacitor local URL settings used when no runtime config is available. */\nexport const BUNDLED_ASSET_DEFAULTS = {\n ios: { scheme: 'capacitor', host: 'localhost' },\n android: { scheme: 'https', host: 'localhost' },\n};\nconst ABSOLUTE_URL_PATTERN = /^[a-zA-Z][a-zA-Z\\d+\\-.]*:/;\nconst RESERVED_WEB_SCHEMES = ['http', 'https'];\n/** Returns true when the input looks like an absolute URL (including protocol-relative URLs). */\nexport function isAbsoluteUrl(url) {\n return ABSOLUTE_URL_PATTERN.test(url) || url.startsWith('//');\n}\n/** Returns true when any path segment is `..`. */\nexport function containsPathTraversal(path) {\n return path.split('/').includes('..');\n}\n/**\n * Normalizes a relative bundled asset path to a leading-slash form.\n * Returns null when the path contains traversal segments.\n */\nexport function normalizeBundledPath(path) {\n const trimmed = path.trim();\n if (!trimmed || trimmed === '/') {\n return '/';\n }\n if (containsPathTraversal(trimmed)) {\n return null;\n }\n return trimmed.startsWith('/') ? trimmed : `/${trimmed}`;\n}\n/** Parses a Capacitor local URL into scheme and host components. */\nexport function parseBundledLocalConfig(localUrl) {\n if (!localUrl) {\n return null;\n }\n try {\n const parsed = new URL(localUrl.endsWith('/') ? localUrl : `${localUrl}/`);\n if (!parsed.protocol || !parsed.hostname) {\n return null;\n }\n return {\n scheme: parsed.protocol.replace(/:$/, '').toLowerCase(),\n host: parsed.hostname.toLowerCase(),\n };\n }\n catch (_a) {\n return null;\n }\n}\n/** Returns the scheme WebView navigation should use for bundled assets on a platform. */\nexport function handlerSchemeForPlatform(platform, localConfig) {\n if (platform === 'ios' && RESERVED_WEB_SCHEMES.includes(localConfig.scheme)) {\n return BUNDLED_ASSET_DEFAULTS.ios.scheme;\n }\n if (platform === 'android') {\n if (localConfig.scheme === 'http' || localConfig.scheme === 'https') {\n return localConfig.scheme;\n }\n return BUNDLED_ASSET_DEFAULTS.android.scheme;\n }\n return localConfig.scheme;\n}\n/**\n * Returns true when the URL targets the configured Capacitor local host/scheme\n * (including the platform handler scheme rewrite).\n */\nexport function isBundledLocalUrl(url, platform, localConfig) {\n if (!isAbsoluteUrl(url)) {\n return false;\n }\n try {\n const parsed = new URL(url);\n const scheme = parsed.protocol.replace(/:$/, '').toLowerCase();\n const host = parsed.hostname.toLowerCase();\n const config = localConfig !== null && localConfig !== void 0 ? localConfig : BUNDLED_ASSET_DEFAULTS[platform];\n if (host !== config.host) {\n return false;\n }\n if (parsed.port !== '') {\n return false;\n }\n if (scheme === config.scheme || scheme === handlerSchemeForPlatform(platform, config)) {\n return true;\n }\n return RESERVED_WEB_SCHEMES.includes(scheme) && RESERVED_WEB_SCHEMES.includes(config.scheme);\n }\n catch (_a) {\n return false;\n }\n}\n/** Returns true when the input is a non-empty relative bundled asset path. */\nexport function isRelativeBundledPath(url) {\n const trimmed = url.trim();\n if (!trimmed) {\n return false;\n }\n return !isAbsoluteUrl(trimmed);\n}\nfunction rewriteBundledLocalUrl(url, localConfig, navigationScheme) {\n try {\n const parsed = new URL(url);\n const host = parsed.hostname.toLowerCase();\n const scheme = parsed.protocol.replace(/:$/, '').toLowerCase();\n if (host !== localConfig.host || scheme === navigationScheme) {\n return null;\n }\n const pathname = parsed.pathname || '/';\n const search = parsed.search;\n const hash = parsed.hash;\n const userinfo = parsed.username.length > 0 ? `${parsed.username}${parsed.password.length > 0 ? `:${parsed.password}` : ''}@` : '';\n return `${navigationScheme}://${userinfo}${host}${pathname}${search}${hash}`;\n }\n catch (_a) {\n return null;\n }\n}\n/**\n * Resolves a bundled asset URL for the given platform.\n * Relative paths become platform-local URLs; bundled local URLs may be rewritten to the handler scheme.\n */\nexport function resolveBundledAssetUrl(url, platform, localConfig) {\n const trimmed = url.trim();\n const config = localConfig !== null && localConfig !== void 0 ? localConfig : BUNDLED_ASSET_DEFAULTS[platform];\n const navigationScheme = handlerSchemeForPlatform(platform, config);\n if (isRelativeBundledPath(trimmed)) {\n const path = normalizeBundledPath(trimmed);\n if (path === null) {\n return null;\n }\n return {\n url: `${navigationScheme}://${config.host}${path}`,\n };\n }\n if (isBundledLocalUrl(trimmed, platform, config)) {\n const rewritten = rewriteBundledLocalUrl(trimmed, config, navigationScheme);\n return {\n url: rewritten !== null && rewritten !== void 0 ? rewritten : trimmed,\n };\n }\n return {\n url: trimmed,\n };\n}\n/**\n * Resolves relative bundled paths for legacy native plugins that do not perform native resolution.\n * Throws when the path is invalid.\n */\nexport function resolveLegacyNativeWebViewUrl(url, platform, localConfig) {\n if (!isRelativeBundledPath(url)) {\n return url;\n }\n const resolution = resolveBundledAssetUrl(url, platform, localConfig);\n if (resolution === null) {\n throw new Error('Invalid bundled asset path');\n }\n return resolution.url;\n}\n//# sourceMappingURL=bundled-asset-support.js.map","export var BackgroundColor;\n(function (BackgroundColor) {\n BackgroundColor[\"WHITE\"] = \"white\";\n BackgroundColor[\"BLACK\"] = \"black\";\n})(BackgroundColor || (BackgroundColor = {}));\nexport var ToolBarType;\n(function (ToolBarType) {\n /**\n * Shows a simple toolbar with just a close button and share button\n * @since 0.1.0\n */\n ToolBarType[\"ACTIVITY\"] = \"activity\";\n /**\n * Shows a simple toolbar with just a close button\n * @since 7.6.8\n */\n ToolBarType[\"COMPACT\"] = \"compact\";\n /**\n * Shows a full navigation toolbar with back/forward buttons\n * @since 0.1.0\n */\n ToolBarType[\"NAVIGATION\"] = \"navigation\";\n /**\n * Shows no toolbar\n * @since 0.1.0\n */\n ToolBarType[\"BLANK\"] = \"blank\";\n})(ToolBarType || (ToolBarType = {}));\nexport var InvisibilityMode;\n(function (InvisibilityMode) {\n /**\n * WebView is aware it is hidden (dimensions may be zero).\n */\n InvisibilityMode[\"AWARE\"] = \"AWARE\";\n /**\n * WebView is hidden but reports fullscreen dimensions (uses alpha=0 to remain invisible).\n */\n InvisibilityMode[\"FAKE_VISIBLE\"] = \"FAKE_VISIBLE\";\n})(InvisibilityMode || (InvisibilityMode = {}));\nexport var CloseAction;\n(function (CloseAction) {\n /**\n * The toolbar close button closes and destroys the webview.\n */\n CloseAction[\"CLOSE\"] = \"close\";\n /**\n * The toolbar close button hides the webview so it can be shown again.\n */\n CloseAction[\"HIDE\"] = \"hide\";\n})(CloseAction || (CloseAction = {}));\nexport var CloseButtonPosition;\n(function (CloseButtonPosition) {\n /**\n * Leading edge of the toolbar (left in left-to-right layouts).\n */\n CloseButtonPosition[\"START\"] = \"start\";\n /**\n * Trailing edge of the toolbar (right in left-to-right layouts).\n */\n CloseButtonPosition[\"END\"] = \"end\";\n})(CloseButtonPosition || (CloseButtonPosition = {}));\n//# sourceMappingURL=definitions.js.map","import { Capacitor, registerPlugin } from '@capacitor/core';\nimport { containsPathTraversal, isRelativeBundledPath, parseBundledLocalConfig, resolveLegacyNativeWebViewUrl, } from './bundled-asset-support';\nconst CAPGO_PLUGIN_NAME = 'CapgoInAppBrowser';\nconst PREVIOUS_PLUGIN_NAME = 'InAppBrowser';\nfunction resolvePluginName() {\n if (!Capacitor.isNativePlatform()) {\n return CAPGO_PLUGIN_NAME;\n }\n if (Capacitor.isPluginAvailable(CAPGO_PLUGIN_NAME)) {\n return CAPGO_PLUGIN_NAME;\n }\n if (Capacitor.isPluginAvailable(PREVIOUS_PLUGIN_NAME)) {\n return PREVIOUS_PLUGIN_NAME;\n }\n console.warn(`[InAppBrowser] Neither '${CAPGO_PLUGIN_NAME}' nor '${PREVIOUS_PLUGIN_NAME}' native plugin detected. ` +\n 'Ensure @capgo/capacitor-inappbrowser native code is installed.');\n return CAPGO_PLUGIN_NAME;\n}\nconst inAppBrowserImplementations = {\n web: () => import('./web').then((m) => new m.InAppBrowserWeb()),\n};\nfunction assertValidBundledAssetPath(url) {\n if (isRelativeBundledPath(url) && containsPathTraversal(url)) {\n throw new Error('Invalid bundled asset path');\n }\n}\nconst activePluginName = resolvePluginName();\nfunction bundledAssetPlatform() {\n return Capacitor.getPlatform() === 'ios' ? 'ios' : 'android';\n}\nfunction getConfiguredLocalConfig() {\n if (!Capacitor.isNativePlatform()) {\n return null;\n }\n const getServerUrl = Capacitor.getServerUrl;\n if (typeof getServerUrl !== 'function') {\n return null;\n }\n return parseBundledLocalConfig(getServerUrl());\n}\nfunction prepareUrlOptions(options) {\n assertValidBundledAssetPath(options.url);\n if (!Capacitor.isNativePlatform() || activePluginName !== PREVIOUS_PLUGIN_NAME) {\n return options;\n }\n return Object.assign(Object.assign({}, options), { url: resolveLegacyNativeWebViewUrl(options.url, bundledAssetPlatform(), getConfiguredLocalConfig()) });\n}\nconst baseInAppBrowser = registerPlugin(activePluginName, inAppBrowserImplementations);\nconst InAppBrowser = new Proxy(baseInAppBrowser, {\n get(target, prop, receiver) {\n if (prop === 'openWebView') {\n return (options) => target.openWebView(prepareUrlOptions(options));\n }\n if (prop === 'setUrl') {\n return (options) => target.setUrl(prepareUrlOptions(options));\n }\n const value = Reflect.get(target, prop, receiver);\n if (typeof value === 'function') {\n return value.bind(target);\n }\n return value;\n },\n});\nfunction arrayBufferToBase64(buffer) {\n const bytes = new Uint8Array(buffer);\n let binary = '';\n for (let i = 0; i < bytes.byteLength; i++) {\n binary += String.fromCharCode(bytes[i]);\n }\n return btoa(binary);\n}\nfunction headersToRecord(headers) {\n const result = {};\n headers.forEach((value, key) => {\n result[key] = value;\n });\n return result;\n}\nfunction errorMessage(error) {\n if (error instanceof Error) {\n return error.message;\n }\n if (typeof error === 'string') {\n return error;\n }\n if (error && typeof error === 'object' && 'message' in error && typeof error.message === 'string') {\n return error.message;\n }\n return String(error);\n}\nfunction isStaleProxyResponseError(error) {\n const message = errorMessage(error);\n return message.includes('No proxy handler found') || message.includes('Target WebView not found for proxy request');\n}\nfunction isProxyResponse(value) {\n return (value !== null &&\n typeof value === 'object' &&\n 'status' in value &&\n 'headers' in value &&\n !(value instanceof Response));\n}\nfunction isProxyRequestOverride(value) {\n return value !== null && typeof value === 'object' && 'url' in value && !(value instanceof Response);\n}\nfunction isProxyDecision(value) {\n return (value !== null && typeof value === 'object' && ('request' in value || 'response' in value || 'cancel' in value));\n}\nasync function sendProxyDecision(requestId, webviewId, decision, phase) {\n try {\n await InAppBrowser.handleProxyRequest({\n requestId,\n webviewId,\n decision,\n phase,\n });\n }\n catch (error) {\n if (isStaleProxyResponseError(error)) {\n return;\n }\n throw error;\n }\n}\nasync function resolveProxyHandlerDecision(callback, event) {\n try {\n const result = await callback(event);\n if (result === null) {\n return null;\n }\n if (isProxyDecision(result)) {\n return result;\n }\n if (isProxyRequestOverride(result)) {\n return { request: result };\n }\n if (isProxyResponse(result)) {\n return { response: result };\n }\n const cloned = result.clone();\n const buffer = await cloned.arrayBuffer();\n return {\n response: {\n body: arrayBufferToBase64(buffer),\n status: result.status,\n headers: headersToRecord(result.headers),\n },\n };\n }\n catch (_a) {\n return null;\n }\n}\nconst addProxyHandler = (callback) => {\n return InAppBrowser.addListener('proxyRequest', (event) => {\n void (async () => {\n const decision = await resolveProxyHandlerDecision(callback, event);\n await sendProxyDecision(event.requestId, event.webviewId, decision, event.phase);\n })();\n });\n};\nexport * from './definitions';\nexport { InAppBrowser, addProxyHandler };\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 clearAllBrowsingData() {\n console.log('clearAllBrowsingData');\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(options) {\n console.log('close', options);\n return;\n }\n async hide(options) {\n console.log('hide', options);\n return;\n }\n async show(options) {\n console.log('show', options);\n return;\n }\n async sendToBack(options) {\n console.log('sendToBack not supported on web', options);\n return;\n }\n async bringToFront(options) {\n console.log('bringToFront not supported on web', options);\n return;\n }\n async dispatchInputEvent(options) {\n console.log('dispatchInputEvent not supported on web', options);\n return;\n }\n async setUrl(options) {\n console.log('setUrl', options.url);\n return;\n }\n async reload(options) {\n console.log('reload', options);\n return;\n }\n async postMessage(options) {\n console.log('postMessage', options);\n return options;\n }\n async takeScreenshot(options) {\n console.log('takeScreenshot not supported on web', options);\n throw this.unimplemented('Screenshots are not supported on web.');\n }\n async goBack() {\n console.log('goBack');\n return;\n }\n async getPluginVersion() {\n return { version: 'web' };\n }\n async updateDimensions(options) {\n console.log('updateDimensions', options);\n // Web platform doesn't support dimension control\n return;\n }\n async handleProxyRequest(options) {\n console.log('handleProxyRequest not supported on web', options);\n return;\n }\n async setEnabledSafeTopMargin(options) {\n console.log('setEnabledSafeTopMargin not supported on web', options);\n return;\n }\n async setEnabledSafeBottomMargin(options) {\n console.log('setEnabledSafeBottomMargin not supported on web', options);\n return;\n }\n async openSecureWindow(options) {\n const w = 600;\n const h = 550;\n const settings = [\n ['width', w],\n ['height', h],\n ['left', screen.width / 2 - w / 2],\n ['top', screen.height / 2 - h / 2],\n ]\n .map((x) => x.join('='))\n .join(',');\n const popup = window.open(options.authEndpoint, 'Authorization', settings);\n if (!popup) {\n throw new Error('Failed to open secure window');\n }\n if (typeof popup.focus === 'function') {\n popup.focus();\n }\n return new Promise((resolve, reject) => {\n const bc = new BroadcastChannel(options.broadcastChannelName || 'oauth-channel');\n bc.addEventListener('message', (event) => {\n if (event.data.startsWith(options.redirectUri)) {\n bc.close();\n resolve({ redirectedUri: event.data });\n }\n else {\n bc.close();\n reject(new Error('Redirect URI does not match, expected ' + options.redirectUri + ' but got ' + event.data));\n }\n });\n setTimeout(() => {\n bc.close();\n reject(new Error('The sign-in flow timed out'));\n }, 5 * 60000);\n });\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["BackgroundColor","ToolBarType","InvisibilityMode","CloseAction","CloseButtonPosition","Capacitor","registerPlugin","WebPlugin"],"mappings":";;;IAAA;IACO,MAAM,sBAAsB,GAAG;IACtC,IAAI,GAAG,EAAE,EAAE,MAAM,EAAE,WAAW,EAAE,IAAI,EAAE,WAAW,EAAE;IACnD,IAAI,OAAO,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE;IACnD,CAAC;IACD,MAAM,oBAAoB,GAAG,2BAA2B;IACxD,MAAM,oBAAoB,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC;IAC9C;IACO,SAAS,aAAa,CAAC,GAAG,EAAE;IACnC,IAAI,OAAO,oBAAoB,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,GAAG,CAAC,UAAU,CAAC,IAAI,CAAC;IACjE;IACA;IACO,SAAS,qBAAqB,CAAC,IAAI,EAAE;IAC5C,IAAI,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,QAA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AC,OAAO,CAAC,WAAW,CAAC,EAAE;IAChE,oBAAoB,EAAE,CAAC,KAAK,EAAE;IAC9B,oBAAoB,OAAO,CAAC,EAAE,aAAa,EAAE,KAAK,CAAC,IAAI,EAAE,CAAC;IAC1D,gBAAgB;IAChB,qBAAqB;IACrB,oBAAoB,EAAE,CAAC,KAAK,EAAE;IAC9B,oBAAoB,MAAM,CAAC,IAAI,KAAK,CAAC,wCAAwC,GAAG,OAAO,CAAC,WAAW,GAAG,WAAW,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC;IAChI,gBAAgB;IAChB,YAAY,CAAC,CAAC;IACd,YAAY,UAAU,CAAC,MAAM;IAC7B,gBAAgB,EAAE,CAAC,KAAK,EAAE;IAC1B,gBAAgB,MAAM,CAAC,IAAI,KAAK,CAAC,4BAA4B,CAAC,CAAC;IAC/D,YAAY,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC;IACzB,QAAQ,CAAC,CAAC;IACV,IAAI;IACJ;;;;;;;;;;;;;;;;"}
|
|
@@ -446,7 +446,7 @@ public class CapgoInAppBrowserPlugin: CAPPlugin, CAPBridgedPlugin {
|
|
|
446
446
|
case aware = "AWARE"
|
|
447
447
|
case fakeVisible = "FAKE_VISIBLE"
|
|
448
448
|
}
|
|
449
|
-
private let pluginVersion: String = "8.18.
|
|
449
|
+
private let pluginVersion: String = "8.18.1"
|
|
450
450
|
public let identifier = "CapgoInAppBrowserPlugin"
|
|
451
451
|
public let jsName = "CapgoInAppBrowser"
|
|
452
452
|
public let pluginMethods: [CAPPluginMethod] = [
|
|
@@ -81,7 +81,7 @@
|
|
|
81
81
|
function resolveProxyBridgeUrl(rawUrl, baseUrl) {
|
|
82
82
|
try {
|
|
83
83
|
return new URL(rawUrl, baseUrl).href;
|
|
84
|
-
} catch (
|
|
84
|
+
} catch (e) {
|
|
85
85
|
return null;
|
|
86
86
|
}
|
|
87
87
|
}
|
|
@@ -130,7 +130,7 @@
|
|
|
130
130
|
form.requestSubmit();
|
|
131
131
|
}
|
|
132
132
|
return;
|
|
133
|
-
} catch (
|
|
133
|
+
} catch (e) {
|
|
134
134
|
delete form.__capgoSkipNextProxySubmit;
|
|
135
135
|
}
|
|
136
136
|
}
|
|
@@ -168,7 +168,7 @@
|
|
|
168
168
|
if (proxyRegexSource) {
|
|
169
169
|
try {
|
|
170
170
|
proxyRequestPattern = new RegExp(proxyRegexSource);
|
|
171
|
-
} catch (
|
|
171
|
+
} catch (e) {
|
|
172
172
|
proxyRequestPattern = null;
|
|
173
173
|
}
|
|
174
174
|
}
|
|
@@ -209,7 +209,7 @@
|
|
|
209
209
|
if (url && !url.match(/^[a-zA-Z][a-zA-Z0-9+\-.]*:\/\//)) {
|
|
210
210
|
try {
|
|
211
211
|
return new URL(url, getDocumentBaseUrl()).href;
|
|
212
|
-
} catch (
|
|
212
|
+
} catch (e) {
|
|
213
213
|
return url;
|
|
214
214
|
}
|
|
215
215
|
}
|
|
@@ -289,7 +289,7 @@
|
|
|
289
289
|
if (submitter instanceof HTMLElement) {
|
|
290
290
|
try {
|
|
291
291
|
return new FormData(form, submitter);
|
|
292
|
-
} catch (
|
|
292
|
+
} catch (e) {
|
|
293
293
|
}
|
|
294
294
|
}
|
|
295
295
|
return new FormData(form);
|
|
@@ -450,7 +450,7 @@
|
|
|
450
450
|
let proxyUrl;
|
|
451
451
|
try {
|
|
452
452
|
proxyUrl = yield storeInterceptedRequest(url, method, headers, body, credentialsMode);
|
|
453
|
-
} catch (
|
|
453
|
+
} catch (e) {
|
|
454
454
|
return originalFetch.call(window, input, init);
|
|
455
455
|
}
|
|
456
456
|
const proxyResponse = yield originalFetch.call(globalThis, proxyUrl, {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@capgo/capacitor-inappbrowser",
|
|
3
|
-
"version": "8.18.
|
|
3
|
+
"version": "8.18.1",
|
|
4
4
|
"description": "Capacitor plugin in app browser",
|
|
5
5
|
"main": "dist/plugin.cjs.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
@@ -65,28 +65,27 @@
|
|
|
65
65
|
"@capacitor/core": "^8.0.0",
|
|
66
66
|
"@capacitor/docgen": "^0.3.1",
|
|
67
67
|
"@capacitor/ios": "^8.0.0",
|
|
68
|
-
"@ionic/eslint-config": "^0.
|
|
68
|
+
"@ionic/eslint-config": "^0.5.0",
|
|
69
69
|
"@ionic/prettier-config": "^4.0.0",
|
|
70
70
|
"@ionic/swiftlint-config": "^2.0.0",
|
|
71
71
|
"@types/node": "^24.10.1",
|
|
72
|
+
"@typescript-eslint/eslint-plugin": "^8.70.0",
|
|
73
|
+
"@typescript-eslint/parser": "^8.70.0",
|
|
74
|
+
"@typescript/typescript6": "^6.0.2",
|
|
72
75
|
"esbuild": "^0.28.0",
|
|
73
|
-
"eslint": "^
|
|
74
|
-
"eslint-plugin-import": "^2.31.0",
|
|
76
|
+
"eslint": "^10.0.0",
|
|
75
77
|
"husky": "^9.1.7",
|
|
76
|
-
"prettier": "
|
|
77
|
-
"prettier-plugin-java": "
|
|
78
|
+
"prettier": "3.8.4",
|
|
79
|
+
"prettier-plugin-java": "2.9.7",
|
|
78
80
|
"rimraf": "^6.1.0",
|
|
79
81
|
"rollup": "^4.53.2",
|
|
80
82
|
"swiftlint": "^2.0.0",
|
|
81
|
-
"typescript": "^
|
|
83
|
+
"typescript": "^7.0.0",
|
|
82
84
|
"prettier-pretty-check": "^0.2.0"
|
|
83
85
|
},
|
|
84
86
|
"peerDependencies": {
|
|
85
87
|
"@capacitor/core": ">=8.0.0"
|
|
86
88
|
},
|
|
87
|
-
"eslintConfig": {
|
|
88
|
-
"extends": "@ionic/eslint-config/recommended"
|
|
89
|
-
},
|
|
90
89
|
"prettier": "@ionic/prettier-config",
|
|
91
90
|
"swiftlint": {
|
|
92
91
|
"excluded": [
|