capacitor icon indicating copy to clipboard operation
capacitor copied to clipboard

Export Native Bridge Utility Functions

Open sahilsharda opened this issue 1 month ago • 0 comments

Issue Title: Export Native Bridge Utility Functions

Description

The native-bridge.ts file in @capacitor/core contains useful utility functions isRelativeOrProxyUrl and createProxyUrl that are currently internal. There are TODO comments in the code suggesting these should be exported.

Exporting these functions would allow plugins and other parts of the system to correctly handle Capacitor-proxied URLs, improving consistency and reducing code duplication.

Proposed Solution

  • Update CapacitorInstance interface in definitions-internal.ts to include these methods.
  • Attach isRelativeOrProxyUrl and createProxyUrl to the Capacitor global object in native-bridge.ts.
  • Remove the TODO comments.

Related Code

  • core/native-bridge.ts
  • core/src/definitions-internal.ts

sahilsharda avatar Nov 25 '25 21:11 sahilsharda