Skip to content

Conversation

@tarakbluru
Copy link

@tarakbluru tarakbluru commented Nov 21, 2025

Updated contentScript.js to pass full URL to background script


Summary by cubic

Fixes API endpoint routing for LX/SX buttons on TradingView by moving API calls to a background service worker and sending the full URL from the content script. Both /api/v1/placeorder and /api/v1/placesmartorder now work and bypass CORS.

  • Bug Fixes
    • Added background service worker to place orders and avoid CORS issues.
    • contentScript sends the full URL and handles async responses with clearer errors and notifications.
    • Removed hardcoded endpoint; background uses dynamic URL to support both endpoints.
    • Updated manifest to register the service worker and add http/https host permissions.

Written for commit a27c6f5. Summary will update automatically on new commits.

Updated contentScript.js to pass full URL to background script instead of just hostUrl.
Updated background.js to use dynamic URL instead of hardcoded /placeorder endpoint.
Both /api/v1/placeorder and /api/v1/placesmartorder now route correctly.
Copy link

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 3 files

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant