Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion chrome-extension/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "chrome-extension",
"version": "0.5.1564",
"version": "0.5.1565",
"description": "chrome extension - core settings",
"type": "module",
"private": true,
Expand Down
2 changes: 1 addition & 1 deletion chrome-extension/public/pyodide/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "pyodide",
"version": "0.27.1571",
"version": "0.27.1572",
"description": "The Pyodide JavaScript package",
"keywords": [
"python",
Expand Down
86 changes: 86 additions & 0 deletions chrome-extension/src/background/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,21 @@ interface ExtensionMessage {
[key: string]: any;
}

/**
* Response for GET_ACTIVE_TAB_INFO and GET_ACTIVE_TAB_URL messages
* Contains information about the active tab including its URL and unique identifier
*/
interface ActiveTabInfo {
/** The URL of the active tab, or 'about:blank' if unavailable */
url: string;
/** The numeric ID of the active tab, or -1 if unavailable */
tabId: number;
/** Timestamp when the info was retrieved */
timestamp: number;
/** Error message if the tab info could not be retrieved */
error?: string;
}

console.log('[background] Starting Offscreen Document integration - REFACTORED BACKGROUND ARCHITECTURE');

// Функция для отправки обновлений чата плагина
Expand Down Expand Up @@ -3072,6 +3087,77 @@ async function handleMessage(message: any, sender: any): Promise<any> {
}
}

// Обработка GET_ACTIVE_TAB_INFO и GET_ACTIVE_TAB_URL сообщений (поддержка обоих для совместимости)
if (message.type === 'GET_ACTIVE_TAB_INFO' || message.type === 'GET_ACTIVE_TAB_URL') {
console.log(`[background][PORT][GET_ACTIVE_TAB_INFO] Processing ${message.type} request`);

try {
// Запрашиваем активную вкладку в текущем окне
const tabs = await chrome.tabs.query({ active: true, currentWindow: true });

// Логируем результат запроса
if (!tabs || tabs.length === 0) {
console.warn('[background][PORT][GET_ACTIVE_TAB_INFO] ⚠️ No active tab found by query');
// Возвращаем разумные значения по умолчанию
return {
url: 'about:blank',
tabId: -1,
timestamp: Date.now()
};
}

const activeTab = tabs[0];

if (!activeTab) {
console.warn('[background][PORT][GET_ACTIVE_TAB_INFO] ⚠️ Active tab is null or undefined');
return {
url: 'about:blank',
tabId: -1,
timestamp: Date.now()
};
}

if (!activeTab.id) {
console.warn('[background][PORT][GET_ACTIVE_TAB_INFO] ⚠️ Active tab has no ID');
return {
url: activeTab.url || 'about:blank',
tabId: -1,
timestamp: Date.now()
};
}

const tabInfo = {
url: activeTab.url || 'about:blank',
tabId: activeTab.id,
timestamp: Date.now()
};

console.log('[background][PORT][GET_ACTIVE_TAB_INFO] ✅ Successfully retrieved active tab info:', {
tabId: tabInfo.tabId,
urlLength: tabInfo.url.length,
hasUrl: !!activeTab.url
});

return tabInfo;

} catch (error: unknown) {
console.error('[background][PORT][GET_ACTIVE_TAB_INFO] ❌ Error retrieving active tab info:', error);
console.error('[background][PORT][GET_ACTIVE_TAB_INFO] Error details:', {
message: (error as Error).message,
stack: (error as Error).stack,
timestamp: new Date().toISOString()
});

// Возвращаем разумные значения по умолчанию при ошибке
return {
url: 'about:blank',
tabId: -1,
error: (error as Error).message,
timestamp: Date.now()
};
}
}

// Обработка HOST API сообщений
if (message.command) {
// Используем существующую функцию handleHostApiMessage, но адаптируем для возврата результата
Expand Down
2 changes: 1 addition & 1 deletion chrome-extension/src/background/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "chrome-extension-background",
"version": "1.0.1021",
"version": "1.0.1022",
"scripts": {
"build": "webpack --mode=production",
"dev": "webpack --mode=development --watch"
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "agent-plugins-platform",
"version": "1.0.1546",
"version": "1.0.1547",
"description": "Browser extension that enables Python plugin execution using Pyodide and MCP protocol",
"license": "MIT",
"private": true,
Expand Down
2 changes: 1 addition & 1 deletion packages/dev-utils/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@extension/dev-utils",
"version": "0.5.1564",
"version": "0.5.1565",
"description": "chrome extension - dev utils",
"type": "module",
"private": true,
Expand Down
2 changes: 1 addition & 1 deletion packages/env/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@extension/env",
"version": "0.5.1551",
"version": "0.5.1552",
"description": "chrome extension - environment variables",
"type": "module",
"private": true,
Expand Down
2 changes: 1 addition & 1 deletion packages/hmr/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@extension/hmr",
"version": "0.5.1564",
"version": "0.5.1565",
"description": "chrome extension - hot module reload/refresh",
"type": "module",
"private": true,
Expand Down
2 changes: 1 addition & 1 deletion packages/i18n/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@extension/i18n",
"version": "0.5.1564",
"version": "0.5.1565",
"description": "chrome extension - internationalization",
"type": "module",
"private": true,
Expand Down
2 changes: 1 addition & 1 deletion packages/module-manager/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@extension/module-manager",
"version": "0.5.1564",
"version": "0.5.1565",
"description": "chrome extension - module manager",
"type": "module",
"private": true,
Expand Down
2 changes: 1 addition & 1 deletion packages/shared/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@extension/shared",
"version": "0.5.1564",
"version": "0.5.1565",
"description": "chrome extension - shared code",
"type": "module",
"private": true,
Expand Down
2 changes: 1 addition & 1 deletion packages/storage/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@extension/storage",
"version": "0.5.1564",
"version": "0.5.1565",
"description": "chrome extension - storage",
"type": "module",
"private": true,
Expand Down
2 changes: 1 addition & 1 deletion packages/tailwindcss-config/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@extension/tailwindcss-config",
"version": "0.5.1564",
"version": "0.5.1565",
"description": "chrome extension - tailwindcss configuration",
"main": "tailwind.config.ts",
"private": true,
Expand Down
2 changes: 1 addition & 1 deletion packages/tsconfig/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@extension/tsconfig",
"version": "0.5.1564",
"version": "0.5.1565",
"description": "chrome extension - tsconfig",
"private": true,
"sideEffects": false
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@extension/ui",
"version": "0.5.1564",
"version": "0.5.1565",
"description": "chrome extension - ui components",
"type": "module",
"private": true,
Expand Down
2 changes: 1 addition & 1 deletion packages/vite-config/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@extension/vite-config",
"version": "0.5.1572",
"version": "0.5.1573",
"description": "chrome extension - vite base configuration",
"type": "module",
"private": true,
Expand Down
2 changes: 1 addition & 1 deletion packages/zipper/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@extension/zipper",
"version": "0.5.1564",
"version": "0.5.1565",
"description": "chrome extension - zipper",
"type": "module",
"private": true,
Expand Down
2 changes: 1 addition & 1 deletion pages/content-runtime/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@extension/content-runtime-script",
"version": "0.5.1564",
"version": "0.5.1565",
"description": "chrome extension - content runtime script",
"type": "module",
"private": true,
Expand Down
2 changes: 1 addition & 1 deletion pages/content-ui/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@extension/content-ui",
"version": "0.5.1564",
"version": "0.5.1565",
"description": "chrome extension - content ui",
"type": "module",
"private": true,
Expand Down
2 changes: 1 addition & 1 deletion pages/content/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@extension/content-script",
"version": "0.5.1564",
"version": "0.5.1565",
"description": "chrome extension - content script",
"type": "module",
"private": true,
Expand Down
2 changes: 1 addition & 1 deletion pages/devtools/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@extension/devtools",
"version": "0.5.1564",
"version": "0.5.1565",
"description": "chrome extension - devtools",
"type": "module",
"private": true,
Expand Down
2 changes: 1 addition & 1 deletion pages/new-tab/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@extension/new-tab",
"version": "0.5.1564",
"version": "0.5.1565",
"description": "chrome extension - new tab",
"type": "module",
"private": true,
Expand Down
2 changes: 1 addition & 1 deletion pages/options/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@extension/options",
"version": "0.5.1564",
"version": "0.5.1565",
"description": "chrome extension - options",
"type": "module",
"private": true,
Expand Down
2 changes: 1 addition & 1 deletion pages/side-panel/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@extension/sidepanel",
"version": "0.5.1564",
"version": "0.5.1565",
"description": "chrome extension - side panel",
"type": "module",
"private": true,
Expand Down
2 changes: 1 addition & 1 deletion platform-core/public/pyodide/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "pyodide",
"version": "0.27.1569",
"version": "0.27.1570",
"description": "The Pyodide JavaScript package",
"keywords": [
"python",
Expand Down
2 changes: 1 addition & 1 deletion public/pyodide/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "pyodide",
"version": "0.27.1571",
"version": "0.27.1572",
"description": "The Pyodide JavaScript package",
"keywords": [
"python",
Expand Down
Loading