chrome-devtools-mcp-for-extension 0.16.2 → 0.16.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
6
|
import { CHATGPT_CONFIG } from './config.js';
|
|
7
|
-
import {
|
|
7
|
+
import { isLoginRequired } from './login-helper.js';
|
|
8
8
|
/**
|
|
9
9
|
* UI elements to check during health verification
|
|
10
10
|
*/
|
|
@@ -78,17 +78,16 @@ export async function verifyUIHealth(browser) {
|
|
|
78
78
|
});
|
|
79
79
|
// Wait for page to be ready
|
|
80
80
|
await new Promise((resolve) => setTimeout(resolve, 2000));
|
|
81
|
-
//
|
|
81
|
+
// Check login status (but don't wait for login to avoid timeout)
|
|
82
82
|
console.error(' Checking login status...');
|
|
83
|
-
const
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
console.error('⚠️ Login timeout - skipping UI verification');
|
|
89
|
-
console.error(' Please restart and log in to ChatGPT');
|
|
83
|
+
const needsLogin = await isLoginRequired(page);
|
|
84
|
+
if (needsLogin) {
|
|
85
|
+
console.error('⚠️ ChatGPT login required');
|
|
86
|
+
console.error(' 💡 Login will be prompted when you use ChatGPT tools');
|
|
87
|
+
console.error(' Skipping UI verification - will verify after login');
|
|
90
88
|
return;
|
|
91
89
|
}
|
|
90
|
+
console.error('✅ Already logged in');
|
|
92
91
|
// Check each UI element
|
|
93
92
|
const results = [];
|
|
94
93
|
for (const element of UI_ELEMENTS) {
|
|
@@ -10,7 +10,7 @@ import { ToolCategories } from './categories.js';
|
|
|
10
10
|
import { defineTool } from './ToolDefinition.js';
|
|
11
11
|
import { loadSelectors, getSelector } from '../selectors/loader.js';
|
|
12
12
|
import { CHATGPT_CONFIG } from '../config.js';
|
|
13
|
-
import {
|
|
13
|
+
import { isLoginRequired } from '../login-helper.js';
|
|
14
14
|
/**
|
|
15
15
|
* Path to store chat session data
|
|
16
16
|
*/
|
|
@@ -189,13 +189,16 @@ export const askChatGPTWeb = defineTool({
|
|
|
189
189
|
// Step 1: Navigate to ChatGPT
|
|
190
190
|
response.appendResponseLine('ChatGPTに接続中...');
|
|
191
191
|
await page.goto(CHATGPT_CONFIG.DEFAULT_URL, { waitUntil: 'networkidle2' });
|
|
192
|
-
// Step 2:
|
|
193
|
-
const
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
response.appendResponseLine('
|
|
192
|
+
// Step 2: Check if login is required (don't wait - stop immediately)
|
|
193
|
+
const needsLogin = await isLoginRequired(page);
|
|
194
|
+
if (needsLogin) {
|
|
195
|
+
response.appendResponseLine('\n❌ ChatGPTへのログインが必要です');
|
|
196
|
+
response.appendResponseLine('');
|
|
197
|
+
response.appendResponseLine('📱 ブラウザウィンドウでChatGPTにログインしてください:');
|
|
198
|
+
response.appendResponseLine(' 1. ブラウザウィンドウの「ログイン」ボタンをクリック');
|
|
199
|
+
response.appendResponseLine(' 2. メールアドレスまたはGoogleアカウントでログイン');
|
|
200
|
+
response.appendResponseLine(' 3. ログイン完了後、このツールを再実行してください');
|
|
201
|
+
response.appendResponseLine('');
|
|
199
202
|
return;
|
|
200
203
|
}
|
|
201
204
|
response.appendResponseLine('✅ ログイン確認完了');
|
|
@@ -9,7 +9,7 @@ import z from 'zod';
|
|
|
9
9
|
import { ToolCategories } from './categories.js';
|
|
10
10
|
import { defineTool } from './ToolDefinition.js';
|
|
11
11
|
import { CHATGPT_CONFIG } from '../config.js';
|
|
12
|
-
import {
|
|
12
|
+
import { isLoginRequired } from '../login-helper.js';
|
|
13
13
|
/**
|
|
14
14
|
* Path to store chat session data
|
|
15
15
|
*/
|
|
@@ -673,13 +673,16 @@ export const deepResearchChatGPT = defineTool({
|
|
|
673
673
|
if (needsNewChat) {
|
|
674
674
|
await page.goto(CHATGPT_CONFIG.DEFAULT_URL, { waitUntil: 'networkidle2' });
|
|
675
675
|
}
|
|
676
|
-
//
|
|
677
|
-
const
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
response.appendResponseLine('
|
|
676
|
+
// Check if login is required (don't wait - stop immediately)
|
|
677
|
+
const needsLogin = await isLoginRequired(page);
|
|
678
|
+
if (needsLogin) {
|
|
679
|
+
response.appendResponseLine('\n❌ ChatGPTへのログインが必要です');
|
|
680
|
+
response.appendResponseLine('');
|
|
681
|
+
response.appendResponseLine('📱 ブラウザウィンドウでChatGPTにログインしてください:');
|
|
682
|
+
response.appendResponseLine(' 1. ブラウザウィンドウの「ログイン」ボタンをクリック');
|
|
683
|
+
response.appendResponseLine(' 2. メールアドレスまたはGoogleアカウントでログイン');
|
|
684
|
+
response.appendResponseLine(' 3. ログイン完了後、このツールを再実行してください');
|
|
685
|
+
response.appendResponseLine('');
|
|
683
686
|
return;
|
|
684
687
|
}
|
|
685
688
|
response.appendResponseLine('✅ ログイン確認完了');
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "chrome-devtools-mcp-for-extension",
|
|
3
|
-
"version": "0.16.
|
|
3
|
+
"version": "0.16.4",
|
|
4
4
|
"description": "MCP server for Chrome extension development with Web Store automation. Fork of chrome-devtools-mcp with extension-specific tools.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": "./build/src/index.js",
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
"start": "npm run build && node build/src/index.js",
|
|
16
16
|
"start-debug": "DEBUG=mcp:* DEBUG_COLORS=false npm run build && node build/src/index.js",
|
|
17
17
|
"diagnose:ui": "echo 'Use diagnose_chatgpt_ui tool via MCP client (Claude Code)'",
|
|
18
|
+
"restart-mcp": "bash scripts/restart-mcp.sh",
|
|
18
19
|
"test": "npm run build && node --require ./build/tests/setup.js --no-warnings=ExperimentalWarning --test-reporter spec --test-force-exit --test \"build/tests/**/*.test.js\"",
|
|
19
20
|
"test:only": "npm run build && node --require ./build/tests/setup.js --no-warnings=ExperimentalWarning --test-reporter spec --test-force-exit --test --test-only \"build/tests/**/*.test.js\"",
|
|
20
21
|
"test:only:no-build": "node --require ./build/tests/setup.js --no-warnings=ExperimentalWarning --test-reporter spec --test-force-exit --test --test-only \"build/tests/**/*.test.js\"",
|