chrome-devtools-mcp-for-extension 0.8.9 → 0.8.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.
|
@@ -478,7 +478,29 @@ export const openExtensionPopup = defineTool({
|
|
|
478
478
|
response.appendResponseLine('💡 You can now use take_snapshot, click, evaluate_script, etc. on the popup');
|
|
479
479
|
return;
|
|
480
480
|
}
|
|
481
|
-
//
|
|
481
|
+
// Check for iframe-embedded popup in current page
|
|
482
|
+
const iframePopups = await page.evaluate(() => {
|
|
483
|
+
return Array.from(document.querySelectorAll('iframe'))
|
|
484
|
+
.filter((iframe) => iframe.src.startsWith('chrome-extension://'))
|
|
485
|
+
.map((iframe) => ({
|
|
486
|
+
src: iframe.src,
|
|
487
|
+
id: iframe.id,
|
|
488
|
+
className: iframe.className,
|
|
489
|
+
}));
|
|
490
|
+
});
|
|
491
|
+
if (iframePopups.length > 0) {
|
|
492
|
+
response.appendResponseLine('✅ Extension popup found (embedded as iframe)');
|
|
493
|
+
response.appendResponseLine(`📄 Popup URL: ${iframePopups[0].src}`);
|
|
494
|
+
response.appendResponseLine('');
|
|
495
|
+
response.appendResponseLine('💡 This popup is embedded in the current page as an iframe.');
|
|
496
|
+
response.appendResponseLine(' You can interact with it using regular page tools:');
|
|
497
|
+
response.appendResponseLine(' - take_snapshot (includes iframe content)');
|
|
498
|
+
response.appendResponseLine(' - click on elements');
|
|
499
|
+
response.appendResponseLine(' - fill forms');
|
|
500
|
+
response.appendResponseLine(' - evaluate_script');
|
|
501
|
+
return;
|
|
502
|
+
}
|
|
503
|
+
// If not on popup or iframe, try to find any open popup window
|
|
482
504
|
const pages = await browser.pages();
|
|
483
505
|
for (let i = 0; i < pages.length; i++) {
|
|
484
506
|
const p = pages[i];
|
|
@@ -549,6 +571,32 @@ export const openExtensionPopup = defineTool({
|
|
|
549
571
|
}
|
|
550
572
|
}
|
|
551
573
|
if (!popupPage) {
|
|
574
|
+
// Check for iframe-embedded popup with this extension ID
|
|
575
|
+
response.appendResponseLine('🔧 Checking for iframe-embedded popup...');
|
|
576
|
+
// Go back to the original page to check for iframes
|
|
577
|
+
await page.goBack();
|
|
578
|
+
const iframePopups = await page.evaluate((extId) => {
|
|
579
|
+
return Array.from(document.querySelectorAll('iframe'))
|
|
580
|
+
.filter((iframe) => iframe.src.includes(extId))
|
|
581
|
+
.map((iframe) => ({
|
|
582
|
+
src: iframe.src,
|
|
583
|
+
id: iframe.id,
|
|
584
|
+
className: iframe.className,
|
|
585
|
+
}));
|
|
586
|
+
}, extensionInfo.id);
|
|
587
|
+
if (iframePopups.length > 0) {
|
|
588
|
+
response.appendResponseLine('');
|
|
589
|
+
response.appendResponseLine(`✅ Extension popup found (embedded as iframe): ${extensionInfo.name}`);
|
|
590
|
+
response.appendResponseLine(`📄 Popup URL: ${iframePopups[0].src}`);
|
|
591
|
+
response.appendResponseLine('');
|
|
592
|
+
response.appendResponseLine('💡 This popup is embedded in the current page as an iframe.');
|
|
593
|
+
response.appendResponseLine(' You can interact with it using regular page tools:');
|
|
594
|
+
response.appendResponseLine(' - take_snapshot (includes iframe content)');
|
|
595
|
+
response.appendResponseLine(' - click on elements');
|
|
596
|
+
response.appendResponseLine(' - fill forms');
|
|
597
|
+
response.appendResponseLine(' - evaluate_script');
|
|
598
|
+
return;
|
|
599
|
+
}
|
|
552
600
|
response.appendResponseLine('❌ Popup window not found.');
|
|
553
601
|
response.appendResponseLine('💡 Please manually click the extension icon to open the popup first.');
|
|
554
602
|
return;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "chrome-devtools-mcp-for-extension",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.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": "./build/src/index.js",
|