chrome-devtools-mcp-for-extension 0.18.7 → 0.18.9
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.
- package/build/src/tools/gemini-web.js +11 -38
- package/package.json +1 -1
|
@@ -275,46 +275,19 @@ export const askGeminiWeb = defineTool({
|
|
|
275
275
|
while (true) {
|
|
276
276
|
await new Promise((resolve) => setTimeout(resolve, 1500));
|
|
277
277
|
const status = await page.evaluate(() => {
|
|
278
|
-
// Check for generating
|
|
278
|
+
// Check for stop icon (Gemini's thinking/generating indicator)
|
|
279
|
+
// The stop icon is in a div.stop-icon with mat-icon[fonticon="stop"]
|
|
280
|
+
const stopIcon = document.querySelector('.stop-icon mat-icon[fonticon="stop"]') ||
|
|
281
|
+
document.querySelector('mat-icon[data-mat-icon-name="stop"]') ||
|
|
282
|
+
document.querySelector('.blue-circle.stop-icon');
|
|
283
|
+
const hasStopIcon = !!stopIcon;
|
|
284
|
+
// Also check for stop button (fallback)
|
|
279
285
|
const buttons = Array.from(document.querySelectorAll('button'));
|
|
280
286
|
const stopButton = buttons.find(b => {
|
|
281
|
-
// Text-based detection
|
|
282
287
|
const text = b.textContent || '';
|
|
283
288
|
const ariaLabel = b.getAttribute('aria-label') || '';
|
|
284
|
-
|
|
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;
|
|
289
|
+
return text.includes('回答を停止') || text.includes('Stop') ||
|
|
290
|
+
ariaLabel.includes('Stop') || ariaLabel.includes('停止');
|
|
318
291
|
});
|
|
319
292
|
// Check for "プロンプトを送信" button - this indicates response is complete
|
|
320
293
|
// Must be enabled (not disabled) to indicate completion
|
|
@@ -343,8 +316,8 @@ export const askGeminiWeb = defineTool({
|
|
|
343
316
|
document.querySelector('[aria-busy="true"]') !== null;
|
|
344
317
|
const isComplete = (bodyText.includes('Gemini が回答しました') ||
|
|
345
318
|
bodyText.includes('Gemini has responded') ||
|
|
346
|
-
!!sendButton) && !isThinking && !hasSpinner;
|
|
347
|
-
const isGenerating = !!stopButton || isTyping || isThinking || hasSpinner;
|
|
319
|
+
!!sendButton) && !isThinking && !hasSpinner && !hasStopIcon;
|
|
320
|
+
const isGenerating = hasStopIcon || !!stopButton || isTyping || isThinking || hasSpinner;
|
|
348
321
|
// Get the response content from model-response elements
|
|
349
322
|
const modelResponses = Array.from(document.querySelectorAll('model-response'));
|
|
350
323
|
let responseContent = '';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "chrome-devtools-mcp-for-extension",
|
|
3
|
-
"version": "0.18.
|
|
3
|
+
"version": "0.18.9",
|
|
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",
|