chrome-devtools-mcp-for-extension 0.18.8 β 0.18.10
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/browser.js +0 -35
- package/build/src/tools/gemini-web.js +11 -19
- package/package.json +1 -1
package/build/src/browser.js
CHANGED
|
@@ -656,41 +656,6 @@ export async function launch(options) {
|
|
|
656
656
|
});
|
|
657
657
|
console.error('Applied navigator.webdriver bypass to existing page');
|
|
658
658
|
}
|
|
659
|
-
// Verify extensions were loaded by checking chrome://extensions/
|
|
660
|
-
if (extensionPaths.length > 0) {
|
|
661
|
-
console.error('π Verifying extension loading...');
|
|
662
|
-
try {
|
|
663
|
-
const pages = await browser.pages();
|
|
664
|
-
const page = pages[0] || await browser.newPage();
|
|
665
|
-
// Add a small delay to ensure Chrome is fully started
|
|
666
|
-
await new Promise(resolve => setTimeout(resolve, 2000));
|
|
667
|
-
await page.goto('chrome://extensions/', { waitUntil: 'networkidle0' });
|
|
668
|
-
const loadedExtensions = await page.evaluate(() => {
|
|
669
|
-
const extensionCards = document.querySelectorAll('extensions-item');
|
|
670
|
-
const results = [];
|
|
671
|
-
Array.from(extensionCards).forEach(card => {
|
|
672
|
-
const shadowRoot = card.shadowRoot;
|
|
673
|
-
if (shadowRoot) {
|
|
674
|
-
const name = shadowRoot.querySelector('#name')?.textContent?.trim() || 'Unknown';
|
|
675
|
-
const enabled = !shadowRoot.querySelector('#enable-toggle')?.hasAttribute('disabled');
|
|
676
|
-
const id = card.getAttribute('id') || 'unknown';
|
|
677
|
-
results.push({ name, id, enabled });
|
|
678
|
-
}
|
|
679
|
-
});
|
|
680
|
-
return results;
|
|
681
|
-
});
|
|
682
|
-
console.error(`β
Extensions verification complete. Found ${loadedExtensions.length} extensions:`);
|
|
683
|
-
loadedExtensions.forEach((ext, index) => {
|
|
684
|
-
console.error(` ${index + 1}. ${ext.name} (${ext.enabled ? 'enabled' : 'disabled'}) - ID: ${ext.id}`);
|
|
685
|
-
});
|
|
686
|
-
if (loadedExtensions.length === 0) {
|
|
687
|
-
console.error('β οΈ No extensions found in chrome://extensions/ - this may indicate loading failure');
|
|
688
|
-
}
|
|
689
|
-
}
|
|
690
|
-
catch (verificationError) {
|
|
691
|
-
console.error(`β οΈ Extension verification failed: ${verificationError}`);
|
|
692
|
-
}
|
|
693
|
-
}
|
|
694
659
|
return browser;
|
|
695
660
|
}
|
|
696
661
|
catch (error) {
|
|
@@ -275,27 +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: mat-icon with fonticon="stop" or data-mat-icon-name="stop"
|
|
290
|
-
const matIcon = b.querySelector('mat-icon');
|
|
291
|
-
if (matIcon) {
|
|
292
|
-
const fonticon = matIcon.getAttribute('fonticon');
|
|
293
|
-
const iconName = matIcon.getAttribute('data-mat-icon-name');
|
|
294
|
-
if (fonticon === 'stop' || iconName === 'stop') {
|
|
295
|
-
return true;
|
|
296
|
-
}
|
|
297
|
-
}
|
|
298
|
-
return false;
|
|
289
|
+
return text.includes('εηγεζ’') || text.includes('Stop') ||
|
|
290
|
+
ariaLabel.includes('Stop') || ariaLabel.includes('εζ’');
|
|
299
291
|
});
|
|
300
292
|
// Check for "γγγ³γγγιδΏ‘" button - this indicates response is complete
|
|
301
293
|
// Must be enabled (not disabled) to indicate completion
|
|
@@ -324,8 +316,8 @@ export const askGeminiWeb = defineTool({
|
|
|
324
316
|
document.querySelector('[aria-busy="true"]') !== null;
|
|
325
317
|
const isComplete = (bodyText.includes('Gemini γεηγγΎγγ') ||
|
|
326
318
|
bodyText.includes('Gemini has responded') ||
|
|
327
|
-
!!sendButton) && !isThinking && !hasSpinner;
|
|
328
|
-
const isGenerating = !!stopButton || isTyping || isThinking || hasSpinner;
|
|
319
|
+
!!sendButton) && !isThinking && !hasSpinner && !hasStopIcon;
|
|
320
|
+
const isGenerating = hasStopIcon || !!stopButton || isTyping || isThinking || hasSpinner;
|
|
329
321
|
// Get the response content from model-response elements
|
|
330
322
|
const modelResponses = Array.from(document.querySelectorAll('model-response'));
|
|
331
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.10",
|
|
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",
|