@capgo/capacitor-inappbrowser 8.22.3 โ†’ 8.22.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Open web content inside your Capacitor app with a full-featured in-app browser: custom toolbars, two-way messaging, JavaScript injection, navigation events and native layering behind your UI.
4
4
 
5
- <a href="https://capgo.app/?ref=plugin_inappbrowser"><img src="https://capgo.app/readme-banner.svg?repo=Cap-go/capacitor-inappbrowser" alt="Capgo - Instant updates for Capacitor" /></a>
5
+ <a href="https://capgo.app/?ref=plugin_inappbrowser"><img src="https://capgo.app/readme-banner.svg?repo=Cap-go/capacitor-inappbrowser" alt="Capgo - Build Capacitor apps with AI, ship updates instantly" /></a>
6
6
 
7
7
  <div align="center">
8
8
  <p><b>Capgo</b>: push fixes to your Capacitor users in minutes, build signed iOS and Android apps without a Mac, and roll back in one click.</p>
@@ -11,6 +11,8 @@ Open web content inside your Capacitor app with a full-featured in-app browser:
11
11
  <p><a href="https://capgo.app/consulting/?ref=plugin_inappbrowser">Missing a feature? We'll build the plugin for you ๐Ÿ’ช</a></p>
12
12
  </div>
13
13
 
14
+ > ๐Ÿค– **Building with an AI coding agent?** Install [Capgo skills](https://capgo.app/skills/?ref=plugin_inappbrowser) so Claude Code, Codex, Cursor, Copilot, or Gemini CLI know how to install and use `@capgo/capacitor-inappbrowser` in your Capacitor app: `npx skills add Cap-go/capgo-skills`. Then ask your agent: *"Add @capgo/capacitor-inappbrowser to my Capacitor app and wire it up."* [Agent setup guides](https://capgo.app/agents/?ref=plugin_inappbrowser) ยท [Hosted MCP](https://capgo.app/docs/ai/mcp/?ref=plugin_inappbrowser)
15
+
14
16
  <p align="center">
15
17
  <img src="https://raw.githubusercontent.com/Cap-go/capacitor-inappbrowser/main/assets/iab-layer-controls-demo.webp" alt="iOS example app showing a web page in the native browser with an Ionic overlay rendered above it" width="300" />
16
18
  </p>
@@ -179,9 +179,11 @@ private var bundledAssetStoppedKey: UInt8 = 0
179
179
  private extension WKURLSchemeTask {
180
180
  var stopped: Bool {
181
181
  get {
182
+ // appstore-2.5.2-allow: track WKURLSchemeTask stopped state across async completions
182
183
  objc_getAssociatedObject(self, &bundledAssetStoppedKey) as? Bool ?? false
183
184
  }
184
185
  set {
186
+ // appstore-2.5.2-allow: track WKURLSchemeTask stopped state across async completions
185
187
  objc_setAssociatedObject(self, &bundledAssetStoppedKey, newValue, .OBJC_ASSOCIATION_RETAIN_NONATOMIC)
186
188
  }
187
189
  }
@@ -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.22.3"
449
+ private let pluginVersion: String = "8.22.5"
450
450
  public let identifier = "CapgoInAppBrowserPlugin"
451
451
  public let jsName = "CapgoInAppBrowser"
452
452
  public let pluginMethods: [CAPPluginMethod] = [
@@ -3,6 +3,11 @@ import ObjectiveC
3
3
  import WebKit
4
4
 
5
5
  extension WKWebView {
6
+ private enum HandlesURLSchemePrivateAPI {
7
+ static let originalSelector = #selector(WKWebView.handlesURLScheme(_:))
8
+ static let swizzledSelector = #selector(WKWebView._capgo_handlesURLScheme(_:))
9
+ }
10
+
6
11
  private static var _overriddenSchemes = Set<String>()
7
12
  private static let _overriddenSchemesLock = NSLock()
8
13
  private static var _originalHandlesURLSchemeIMP: IMP?
@@ -11,18 +16,24 @@ extension WKWebView {
11
16
  private typealias HandlesURLSchemeIMP = @convention(c) (AnyClass, Selector, NSString) -> Bool
12
17
 
13
18
  private static let _swizzleOnce: Void = {
14
- let original = class_getClassMethod(WKWebView.self, #selector(WKWebView.handlesURLScheme(_:)))
15
- let swizzled = class_getClassMethod(
16
- WKWebView.self,
17
- #selector(WKWebView._capgo_handlesURLScheme(_:))
18
- )
19
+ guard WKWebView.responds(to: HandlesURLSchemePrivateAPI.originalSelector) else {
20
+ print("[InAppBrowser][Proxy] WARNING: WKWebView does not respond to handlesURLScheme; swizzle skipped")
21
+ return
22
+ }
23
+
24
+ // appstore-2.5.2-allow: resolve WKWebView class methods for proxy scheme registration
25
+ let original = class_getClassMethod(WKWebView.self, HandlesURLSchemePrivateAPI.originalSelector)
26
+ // appstore-2.5.2-allow: resolve swizzled class method for proxy scheme registration
27
+ let swizzled = class_getClassMethod(WKWebView.self, HandlesURLSchemePrivateAPI.swizzledSelector)
19
28
 
20
29
  guard let original, let swizzled else {
21
30
  print("[InAppBrowser][Proxy] WARNING: Could not get methods for swizzle")
22
31
  return
23
32
  }
24
33
 
34
+ // appstore-2.5.2-allow: preserve original handlesURLScheme IMP before exchange
25
35
  _originalHandlesURLSchemeIMP = method_getImplementation(original)
36
+ // appstore-2.5.2-allow: route handlesURLScheme through proxy override for http/https
26
37
  method_exchangeImplementations(original, swizzled)
27
38
  }()
28
39
 
@@ -39,8 +50,9 @@ extension WKWebView {
39
50
  return false
40
51
  }
41
52
 
53
+ // appstore-2.5.2-allow: call saved handlesURLScheme IMP without re-entering swizzled Swift entry
42
54
  let original: HandlesURLSchemeIMP = unsafeBitCast(imp, to: HandlesURLSchemeIMP.self)
43
- return original(WKWebView.self, #selector(WKWebView.handlesURLScheme(_:)), urlScheme as NSString)
55
+ return original(WKWebView.self, HandlesURLSchemePrivateAPI.originalSelector, urlScheme as NSString)
44
56
  }
45
57
 
46
58
  static func enableCustomSchemeHandling(for schemes: [String]) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@capgo/capacitor-inappbrowser",
3
- "version": "8.22.3",
3
+ "version": "8.22.5",
4
4
  "description": "Capacitor plugin in app browser",
5
5
  "main": "dist/plugin.cjs.js",
6
6
  "module": "dist/esm/index.js",
@@ -37,7 +37,7 @@
37
37
  "verify:web": "bun run build && bun run test:web",
38
38
  "test:web": "bun test src/proxy-bridge-support.test.ts src/bundled-asset-support.test.ts src/fullscreen-web.test.ts",
39
39
  "test:maestro:android": "./scripts/test-maestro-android.sh",
40
- "lint": "bun run eslint && bun run prettier -- --check && bun run swiftlint -- lint",
40
+ "lint": "bun run eslint && bun run prettier -- --check && bun run check:appstore-2-5-2-ios && bun run swiftlint -- lint",
41
41
  "fmt": "bun run eslint -- --fix && bun run prettier -- --write && bun run swiftlint -- --fix --format",
42
42
  "eslint": "eslint .",
43
43
  "prettier": "prettier-pretty-check \"**/*.{css,html,ts,js,java}\" --plugin=prettier-plugin-java",
@@ -55,6 +55,7 @@
55
55
  "maestro:test:android:keyboard": "export MAESTRO_DRIVER_STARTUP_TIMEOUT=300000 MAESTRO_CLI_NO_ANALYTICS=1 && sh ./scripts/prepare-android-maestro-device.sh && sh ./scripts/install-android-apk-with-retry.sh example-app/android/app/build/outputs/apk/debug/app-debug.apk && sh ./scripts/start-android-maestro-app.sh app.capgo.inappbrowser app.capgo.inappbrowser/.MainActivity && $HOME/.maestro/bin/maestro test -e APP_ID=app.capgo.inappbrowser example-app/.maestro/keyboard-regression-android.yaml",
56
56
  "check:wiring": "node scripts/check-capacitor-plugin-wiring.mjs",
57
57
  "check:cap9-deprecated": "node scripts/check-cap9-deprecated.mjs",
58
+ "check:appstore-2-5-2-ios": "node scripts/check-appstore-2-5-2-ios.mjs",
58
59
  "example:install": "cd example-app && bun install --frozen-lockfile",
59
60
  "example:build": "bun run build && cd example-app && bun install --frozen-lockfile && bun run build",
60
61
  "changelog:ai": "node scripts/generate-ai-changelog.mjs"