Skip to content

fix: revert customtabs for plugins#2183

Merged
deadlyjack merged 1 commit into
mainfrom
revert-customtabs
Jun 10, 2026
Merged

fix: revert customtabs for plugins#2183
deadlyjack merged 1 commit into
mainfrom
revert-customtabs

Conversation

@deadlyjack

Copy link
Copy Markdown
Member

No description provided.

@greptile-apps

greptile-apps Bot commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR restores the JavaScript bridge for the custom-tabs Cordova plugin by re-adding the js-module declaration in plugin.xml and introducing the corresponding www/customtabs.js file. Without these, the native CustomTabs plugin had no JavaScript surface, making it unusable from plugin consumers.

  • plugin.xml: Adds a <js-module> entry pointing to www/customtabs.js with a clobbers rule that exposes the module as the global CustomTabs object — the standard Cordova pattern for declaring a plugin's JS interface.
  • www/customtabs.js: Provides a single open(url, options, success, error) function that delegates to the native side via cordova/exec, passing url and options (defaulting to {}) as arguments.

Confidence Score: 4/5

Safe to merge — the change is a minimal, targeted restoration of the missing JS bridge; the native plugin side is unchanged.

The two-file change re-establishes a standard Cordova js-module declaration and a thin exec wrapper. Logic is straightforward and consistent with the existing native plugin contract. The only nit is a missing trailing newline in customtabs.js.

No files require special attention; both files are small and self-contained.

Important Files Changed

Filename Overview
src/plugins/custom-tabs/plugin.xml Re-adds the missing js-module declaration that registers www/customtabs.js as the JavaScript interface for the CustomTabs Cordova plugin, restoring the JS↔native bridge.
src/plugins/custom-tabs/www/customtabs.js New JS bridge file exporting a single open(url, options, success, error) callback-based function via cordova/exec. Minor: missing trailing newline.

Sequence Diagram

sequenceDiagram
    participant App as Plugin Consumer (JS)
    participant CT as CustomTabs (global)
    participant Cordova as cordova/exec
    participant Native as CustomTabsPlugin (Java)

    App->>CT: CustomTabs.open(url, options, success, error)
    CT->>Cordova: exec(success, error, 'CustomTabs', 'open', [url, options])
    Cordova->>Native: CustomTabsPlugin.open(url, options)
    Native-->>Cordova: result / error
    Cordova-->>App: success(result) or error(msg)
Loading

Reviews (1): Last reviewed commit: "fix: revert customtabs for plugins" | Re-trigger Greptile

Comment thread src/plugins/custom-tabs/www/customtabs.js
@deadlyjack deadlyjack merged commit 501100f into main Jun 10, 2026
8 checks passed
@github-project-automation github-project-automation Bot moved this from Backlog to Done in The Code Board - Acode Jun 10, 2026
@deadlyjack deadlyjack deleted the revert-customtabs branch June 10, 2026 13:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant