A browser extension to automatically extract X-Cloudide-Session from trae.ai for usage tracking.
- Automatically detects and extracts X-Cloudide-Session from trae.ai API requests
- Auto-copies session to clipboard when extension icon is clicked
- Provides quick access to Trae usage page
- Session stays valid longer than JWT tokens
- Toast notification for successful copy operations
- Smart button that changes based on session status
- Go to the Releases page
- Download the latest
TraeUsageWebExtension.crxfile - Open your browser's extension management page:
- Chrome:
chrome://extensions/ - Edge:
edge://extensions/
- Chrome:
- Enable "Developer mode" in the top right
- Drag and drop the
.crxfile onto the extensions page
- Download the latest
TraeUsageWebExtension.zip - Extract the files to a folder
- Open your browser's extension management page:
- Chrome:
chrome://extensions/ - Edge:
edge://extensions/
- Chrome:
- Enable "Developer mode" in the top right
- Click "Load unpacked" and select the extracted folder
- The extension icon should appear in your toolbar
- Visit trae.ai and browse any page
- The extension will automatically detect X-Cloudide-Session from API requests
- Click the extension icon to auto-copy the session to clipboard
- A toast notification will confirm successful copying
- The button will change to "Back to Trae" (green) after copying
- Click "Back to Trae" to minimize browser and return to Trae application
This project uses GitHub Actions to automatically build and release CRX files:
- Create a new tag:
git tag v1.0.0 && git push origin v1.0.0 - GitHub Actions will automatically:
- Build the browser extension
- Generate a CRX file
- Create a GitHub release
- Upload both CRX and ZIP files
# Install crx3 globally
npm install -g crx3
# Generate a private key (first time only)
openssl genrsa -out key.pem 2048
# Build CRX file
crx3 --keyPath=key.pem --crxPath=TraeUsageWebExtension.crx .- Uses browser's webRequest API to monitor network requests
- Extracts session from cookies when
/GetUserTokenAPI is called - Implements debouncing to handle multiple rapid requests
- Stores session data in browser's local storage
- Toast notifications with smooth animations
- Smart button state management
manifest.json- Extension configurationbackground.js- Background script for request monitoringcontent.js- Content script (minimal)popup.html- Extension popup interfacepopup.js- Popup functionalitypackage.json- NPM package configuration.github/workflows/build-crx.yml- CI/CD pipelineicon*.png- Extension icons