chrome-devtools-mcp-for-extension 0.19.0 → 0.19.2
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.
|
@@ -269,6 +269,49 @@ export const askGeminiWeb = defineTool({
|
|
|
269
269
|
// Wait for response using actual Gemini UI indicators:
|
|
270
270
|
// - Generating: "回答を停止" button appears, "Gemini が入力中です" text
|
|
271
271
|
// - Complete: "Gemini が回答しました" text appears
|
|
272
|
+
// First, wait for Gemini to start generating (Stop button/icon to appear)
|
|
273
|
+
// This typically takes 1-3 seconds after sending
|
|
274
|
+
const maxWaitForStart = 5000; // 5 seconds max to start generating
|
|
275
|
+
const startWaitTime = Date.now();
|
|
276
|
+
let generationStarted = false;
|
|
277
|
+
while (Date.now() - startWaitTime < maxWaitForStart) {
|
|
278
|
+
await new Promise((resolve) => setTimeout(resolve, 500));
|
|
279
|
+
const hasStarted = await page.evaluate(() => {
|
|
280
|
+
// Check for stop icon (Gemini's generating indicator)
|
|
281
|
+
const stopIcon = document.querySelector('.stop-icon mat-icon[fonticon="stop"]') ||
|
|
282
|
+
document.querySelector('mat-icon[data-mat-icon-name="stop"]') ||
|
|
283
|
+
document.querySelector('.blue-circle.stop-icon');
|
|
284
|
+
// Check for stop button
|
|
285
|
+
const buttons = Array.from(document.querySelectorAll('button'));
|
|
286
|
+
const stopButton = buttons.find(b => {
|
|
287
|
+
const text = b.textContent || '';
|
|
288
|
+
const ariaLabel = b.getAttribute('aria-label') || '';
|
|
289
|
+
return text.includes('回答を停止') || text.includes('Stop') ||
|
|
290
|
+
ariaLabel.includes('Stop') || ariaLabel.includes('停止');
|
|
291
|
+
});
|
|
292
|
+
// Check for typing/thinking indicators
|
|
293
|
+
const bodyText = document.body.innerText;
|
|
294
|
+
const isTyping = bodyText.includes('Gemini が入力中です') ||
|
|
295
|
+
bodyText.includes('Gemini is typing') ||
|
|
296
|
+
bodyText.includes('Analyzing') ||
|
|
297
|
+
bodyText.includes('分析中') ||
|
|
298
|
+
bodyText.includes('Thinking') ||
|
|
299
|
+
bodyText.includes('思考中');
|
|
300
|
+
// Check for loading spinners
|
|
301
|
+
const hasSpinner = document.querySelector('[role="progressbar"]') !== null ||
|
|
302
|
+
document.querySelector('[aria-busy="true"]') !== null;
|
|
303
|
+
// Check for model-response appearing (even without stop button)
|
|
304
|
+
const hasNewResponse = document.querySelectorAll('model-response').length > 0;
|
|
305
|
+
return !!stopIcon || !!stopButton || isTyping || hasSpinner || hasNewResponse;
|
|
306
|
+
});
|
|
307
|
+
if (hasStarted) {
|
|
308
|
+
generationStarted = true;
|
|
309
|
+
break;
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
if (!generationStarted) {
|
|
313
|
+
response.appendResponseLine('⚠️ 生成開始を検出できませんでした(続行します)');
|
|
314
|
+
}
|
|
272
315
|
const startTime = Date.now();
|
|
273
316
|
let stableCount = 0;
|
|
274
317
|
let lastResponseText = '';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "chrome-devtools-mcp-for-extension",
|
|
3
|
-
"version": "0.19.
|
|
3
|
+
"version": "0.19.2",
|
|
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": "./scripts/cli.mjs",
|