Skip to main content
Glama
MIT License
27,120
19,746
  • Linux
  • Apple
background.ts•1.32 kB
export default defineBackground(() => { const injectContentToTab = async (tab: chrome.tabs.Tab): Promise<void> => { // Skip if URL is undefined if (!tab.url) { return; } // Skip if tab is discarded if (tab.discarded) { return; } // Skip if tab ID is undefined if (tab.id === undefined) { return; } // Skip if not a GitHub URL if (!tab.url.startsWith('https://github.com/')) { return; } try { const manifest = chrome.runtime.getManifest(); // Inject CSS if (manifest.content_scripts?.[0]?.css) { await chrome.scripting.insertCSS({ target: { tabId: tab.id }, files: manifest.content_scripts[0].css, }); } // Inject JavaScript if (manifest.content_scripts?.[0]?.js) { await chrome.scripting.executeScript({ target: { tabId: tab.id }, files: manifest.content_scripts[0].js, }); } } catch (error) { console.error('Error injecting content script:', error); } }; // Update extension content for tabs chrome.tabs.query({}, async (tabs: chrome.tabs.Tab[]) => { for (const tab of tabs) { try { await injectContentToTab(tab); } catch (e) { console.error(e); } } }); });

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/yamadashy/repomix'

If you have feedback or need assistance with the MCP directory API, please join our Discord server