chrome-devtools-mcp-for-extension 0.18.5 → 0.18.7

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.
@@ -277,21 +277,74 @@ export const askGeminiWeb = defineTool({
277
277
  const status = await page.evaluate(() => {
278
278
  // Check for generating indicators
279
279
  const buttons = Array.from(document.querySelectorAll('button'));
280
- const stopButton = buttons.find(b => b.textContent?.includes('回答を停止') ||
281
- b.textContent?.includes('Stop') ||
282
- b.getAttribute('aria-label')?.includes('Stop'));
280
+ const stopButton = buttons.find(b => {
281
+ // Text-based detection
282
+ const text = b.textContent || '';
283
+ const ariaLabel = b.getAttribute('aria-label') || '';
284
+ if (text.includes('回答を停止') || text.includes('Stop') ||
285
+ ariaLabel.includes('Stop') || ariaLabel.includes('停止') ||
286
+ ariaLabel.includes('中止') || ariaLabel.includes('Cancel')) {
287
+ return true;
288
+ }
289
+ // Icon-based detection (blue square stop button)
290
+ // Check for mat-icon with stop icon
291
+ const matIcon = b.querySelector('mat-icon');
292
+ if (matIcon && (matIcon.textContent?.includes('stop') ||
293
+ matIcon.getAttribute('data-mat-icon-name')?.includes('stop'))) {
294
+ return true;
295
+ }
296
+ // Check for SVG stop icon (square shape) - common in Gemini UI
297
+ const svg = b.querySelector('svg');
298
+ if (svg) {
299
+ // Stop icon typically has a rect element (square)
300
+ const rect = svg.querySelector('rect');
301
+ if (rect) {
302
+ return true;
303
+ }
304
+ }
305
+ // Check for button with blue background (Google's stop button style)
306
+ const style = window.getComputedStyle(b);
307
+ const bgColor = style.backgroundColor;
308
+ if (bgColor.includes('rgb(66, 133, 244)') || // Google blue
309
+ bgColor.includes('rgb(26, 115, 232)') || // Another Google blue
310
+ bgColor.includes('rgb(138, 180, 248)')) { // Light blue
311
+ // Only if button is visible and small (stop button is typically icon-only)
312
+ const rect = b.getBoundingClientRect();
313
+ if (rect.width > 0 && rect.width < 100) {
314
+ return true;
315
+ }
316
+ }
317
+ return false;
318
+ });
283
319
  // Check for "プロンプトを送信" button - this indicates response is complete
284
- const sendButton = buttons.find(b => b.textContent?.includes('プロンプトを送信') ||
285
- b.getAttribute('aria-label')?.includes('プロンプトを送信') ||
286
- b.getAttribute('aria-label')?.includes('Send message'));
287
- // Check for status text
320
+ // Must be enabled (not disabled) to indicate completion
321
+ const sendButton = buttons.find(b => {
322
+ const hasLabel = b.textContent?.includes('プロンプトを送信') ||
323
+ b.getAttribute('aria-label')?.includes('プロンプトを送信') ||
324
+ b.getAttribute('aria-label')?.includes('Send message');
325
+ return hasLabel && !b.disabled;
326
+ });
327
+ // Check for status text and thinking indicators
288
328
  const bodyText = document.body.innerText;
289
329
  const isTyping = bodyText.includes('Gemini が入力中です') ||
290
330
  bodyText.includes('Gemini is typing');
291
- const isComplete = bodyText.includes('Gemini が回答しました') ||
331
+ // Check for thinking/analyzing indicators (Gemini shows these during processing)
332
+ const isThinking = bodyText.includes('Analyzing') ||
333
+ bodyText.includes('分析中') ||
334
+ bodyText.includes('Crafting') ||
335
+ bodyText.includes('作成中') ||
336
+ bodyText.includes('Thinking') ||
337
+ bodyText.includes('思考中') ||
338
+ bodyText.includes('Researching') ||
339
+ bodyText.includes('調査中');
340
+ // Check for loading spinners or progress indicators
341
+ const hasSpinner = document.querySelector('[role="progressbar"]') !== null ||
342
+ document.querySelector('.loading') !== null ||
343
+ document.querySelector('[aria-busy="true"]') !== null;
344
+ const isComplete = (bodyText.includes('Gemini が回答しました') ||
292
345
  bodyText.includes('Gemini has responded') ||
293
- !!sendButton; // "プロンプトを送信" button indicates completion
294
- const isGenerating = !!stopButton || isTyping;
346
+ !!sendButton) && !isThinking && !hasSpinner;
347
+ const isGenerating = !!stopButton || isTyping || isThinking || hasSpinner;
295
348
  // Get the response content from model-response elements
296
349
  const modelResponses = Array.from(document.querySelectorAll('model-response'));
297
350
  let responseContent = '';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "chrome-devtools-mcp-for-extension",
3
- "version": "0.18.5",
3
+ "version": "0.18.7",
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",