mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-05-08 23:32:40 +02:00
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:
parent
e89824db0f
commit
9790edfeaa
2 changed files with 217 additions and 0 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue