feat(floating-button): add Mevx-style floating quick action button

- Create floating-button.tsx content script with inline UI
- Button appears on crypto pages (DexScreener, Twitter, CoinGecko, etc.)
- Shows quick token analysis popup on click
- Displays token price, 24h change, and quick stats
- 'Full Analysis' button opens sidepanel for detailed view
- Update background/index.ts to handle OPEN_SIDEPANEL message
- Gradient purple button with smooth animations
- Fixed positioning (bottom-right corner)
- Clean, modern popup design with inline styles

Implements Task 3: Create Floating Quick Action Button
Similar to Mevx's approach for quick token insights
This commit is contained in:
API Test Bot 2026-02-04 10:59:54 +07:00
parent e89824db0f
commit 9790edfeaa
2 changed files with 217 additions and 0 deletions

View file

@ -7,6 +7,17 @@ chrome.sidePanel
.setPanelBehavior({ openPanelOnActionClick: true })
.catch((error) => console.error("Failed to set side panel behavior:", error));
// Listen for messages from content scripts
chrome.runtime.onMessage.addListener((message, sender, sendResponse) => {
if (message.type === "OPEN_SIDEPANEL") {
// Open sidepanel for the current tab
if (sender.tab?.id) {
chrome.sidePanel.open({ tabId: sender.tab.id })
.catch((error) => console.error("Failed to open side panel:", error));
}
}
});
chrome.tabs.onCreated.addListener(async (tab: any) => {
try {
await initWebHistory(tab.id);