-
Notifications
You must be signed in to change notification settings - Fork 1.4k
chore: check extension version on connect #907
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pavelfeldman
approved these changes
Aug 18, 2025
22ff57a
to
00f7d08
Compare
Edward-Upton
pushed a commit
to asteroidai/playwright-mcp
that referenced
this pull request
Aug 26, 2025
Edward-Upton
added a commit
to asteroidai/playwright-mcp
that referenced
this pull request
Aug 26, 2025
feat: enhance Connection type with context and improve createConnection signature - Added context property to the Connection type for better state management. - Reformatted createConnection function signature for improved readability. chore: update package version to 0.0.29-1 fix: update import path for Context and adjust package name in package-lock.json - Changed import path for Context from "./lib/context.js" to "./src/context.ts". - Updated package name in package-lock.json to "@asteroid_ai/playwright-mcp". chore: set package as non-private - Updated package.json to set "private" to false, allowing for potential publishing. chore: update package name to remove scope - Changed package name from "@asteroid_ai/playwright-mcp" to "asteroid-playwright-mcp" in package.json. chore: update import path for Context and increment package version - Changed import path for Context from "./src/context.ts" to "./lib/context.js". - Incremented package version to 0.0.29-2 in package.json. chore: update import path for Context and increment package version - Changed import path for Context from "./lib/context.js" to "./lib/context.d.ts". - Incremented package version to 0.0.29-3 in package.json. chore: update import paths and increment package version - Changed import path for Context from "./lib/context.d.ts" to "./src/context.js". - Added import for Tab from "./src/tab.js". - Incremented package version to 0.0.29-4 in package.json. - Removed "declaration" option from tsconfig.json. feat: add context and tab type definitions - Introduced new type definitions for Context and Tab in context.d.ts and tab.d.ts respectively. - Updated import paths in index.d.ts to reflect the new file structure. - Enhanced type safety and modularity for better code organization. chore: update package version to 0.0.29-6 and include additional type definitions - Incremented package version to 0.0.29-6 in package.json. - Added context.d.ts and tab.d.ts to .npmignore exceptions for better type definition management. chore: increment package version to 0.0.29-7 and refactor context.ts for improved readability - Updated package version to 0.0.29-7 in package.json. - Refactored code in context.ts for better readability, including consistent formatting and improved handling of popups. chore: increment package version to 0.0.29-8 and enhance context.ts for async handling - Updated package version to 0.0.29-8 in package.json. - Improved async handling in context.ts by awaiting page creation and popup handling for better reliability. chore: increment package version to 0.0.29-9 and simplify page creation handling in context.ts - Updated package version to 0.0.29-9 in package.json. - Simplified the page creation logic in context.ts by removing unnecessary popup handling checks. Revert "chore: increment package version to 0.0.29-9 and simplify page creation handling in context.ts" This reverts commit fff3d31. Revert "chore: increment package version to 0.0.29-7 and refactor context.ts for improved readability" This reverts commit 33033cf. chore: increment package version to 0.0.29-10 in package.json fix: enhance popup handling in context.ts - Added a private flag _isHandlingPopup to manage popup state. - Updated _onPageCreated to handle popups asynchronously and convert them to tabs when detected. - Ensured proper handling of popup state during conversion to maintain tab integrity. chore: increment package version to 0.0.29-11 in package.json chore: increment package version to 0.0.29-12 in package.json and enhance popup handling in context.ts - Updated package version to 0.0.29-12 in package.json. - Removed the private flag _isHandlingPopup and implemented a new method _handlePopup to manage popup windows more effectively. - Improved the logic for detecting and converting popups to tabs, ensuring better handling of various popup scenarios. chore: increment package version to 0.0.29-13 in package.json chore: increment package version to 0.0.29-14 in package.json and remove redundant popup navigation wait in context.ts fix: improve download error handling in context.ts - Added error handling for download.saveAs to log any issues during the save process. - Ensured that entry.finished is set to true regardless of the success or failure of the download operation. feat: introduce everyTool export and update connection logic - Added everyTool export in tools.ts to combine snapshotTools and visionTools. - Updated createConnection function in connection.ts to use everyTool by default, with conditional logic for visionTools based on config.vision. chore: increment package version to 0.0.29-16 in package.json chore: increment package version to 0.0.29-17 in package.json fix: only include one version of each tool in `everyTool` feat: enhance popup event logging in context.ts - Added console logs to track popup events, including when a popup is received, if it is a valid popup window, and when it is closed. - Improved visibility into the popup handling process for better debugging and monitoring. chore: increment package version to 0.0.29-19 in package.json chore: increment package version to 0.0.29-20 in package.json and streamline popup handling in context.ts - Updated package version to 0.0.29-20 in package.json. - Simplified the popup handling logic by directly checking the created page for popups and logging relevant events. - Introduced a set of standard target names to improve the detection of popup windows. chore: increment package version to 0.0.29-21 in package.json and enhance popup detection logic in context.ts - Updated package version to 0.0.29-21 in package.json. - Improved the popup detection logic by adding additional indicators and checks for popup-like features, enhancing the accuracy of the `_isPopupWindow` method. chore: increment package version to 0.0.29-22 in package.json and refactor popup detection logic in context.ts - Updated package version to 0.0.29-22 in package.json. - Refactored the `_isPopupWindow` method to utilize a new `popupAnalysis` function for improved popup detection. - Enhanced the analysis process with additional checks and confidence scoring for better accuracy in identifying popup windows. fix: update type for reasons array and improve window resizability check in popup analysis - Changed the type of the `reasons` array to explicitly be an array of strings for better type safety. - Updated the check for window resizability to use a more explicit boolean expression. fix: add error logging for popup window detection in context.ts - Introduced console error logging to capture and report errors encountered during the popup window detection process, improving debugging capabilities. chore: increment package version to 0.0.29-23 in package.json chore: increment package version to 0.0.29-24 in package.json and refactor popup analysis to be asynchronous - Updated package version to 0.0.29-24 in package.json. - Refactored the `popupAnalysis` function to be asynchronous, allowing for better handling of page evaluations. - Updated the call to `popupAnalysis` in `context.ts` to await the result, improving the flow of popup detection. chore: increment package version to 0.0.29-25 in package.json and move THRESHOLD constant inside popupAnalysis function - Updated package version to 0.0.29-25 in package.json. - Moved the `THRESHOLD` constant inside the `popupAnalysis` function for better encapsulation and clarity. chore: increment package version to 0.0.29-26 in package.json chore: increment package version to 0.0.29-27 in package.json and add logging for popup URL in context.ts - Updated package version to 0.0.29-27 in package.json. - Added a console log to output the URL of the popup for better debugging and tracking of popup behavior. refactor: update popup handling to create a new page instead of a new tab in context.ts - Changed the logic to create a new page directly and navigate to the popup URL, improving the handling of popups. - Updated error handling to log navigation failures for better debugging. chore: increment package version to 0.0.29-29 in package.json and enhance error handling in context.ts - Updated package version to 0.0.29-29 in package.json. - Improved error handling for popup management in context.ts, including timeout handling for URL fetching and enhanced logging for better debugging. refactor: simplify popup URL fetching in context.ts - Removed timeout handling for fetching the popup URL, streamlining the process. - Enhanced logging to output the fetched popup URL for better debugging. chore: increment package version to 0.0.29-31 in package.json and ensure popup page loads before fetching URL in context.ts - Updated package version to 0.0.29-31 in package.json. - Added a wait for the "domcontentloaded" state before fetching the popup URL in context.ts to improve reliability. chore: increment package version to 0.0.29-32 in package.json and enhance popup URL retrieval logic in context.ts - Updated package version to 0.0.29-32 in package.json. - Improved the logic for fetching the popup URL in context.ts with retry attempts and error handling to ensure reliability. refactor: enhance popup handling logic in context.ts - Updated _handlePopup method to return a boolean indicating if a popup was handled. - Improved error handling and logging for popup URL retrieval and closing popups. - Streamlined the logic to avoid unnecessary tab additions when a popup is detected. refactor: improve popup URL retrieval with retry logic in context.ts - Enhanced the _handlePopup method to implement a retry mechanism for fetching the popup URL, allowing up to three attempts. - Improved error handling and logging during the URL retrieval process. - Adjusted return values to better reflect the success of popup handling. chore: increment package version to 0.0.29-35 in package.json and extend timeout for popup URL fetching in context.ts - Updated package version to 0.0.29-35 in package.json. - Increased the timeout duration for waiting on popup URL resolution from 1500ms to 2500ms in context.ts to improve reliability. chore: increment package version to 0.0.29-36 in package.json and adjust timeout for popup URL fetching in context.ts - Updated package version to 0.0.29-36 in package.json. - Increased the timeout duration for waiting on popup URL resolution from 2500ms to 3000ms in context.ts to enhance reliability. - Ensured that the current tab is always switched to the newly created tab in context.ts. chore: increment package version to 0.0.29-37 in package.json and extend timeout for popup URL fetching in context.ts - Updated package version to 0.0.29-37 in package.json. - Increased the timeout duration for waiting on popup URL resolution from 3000ms to 4000ms in context.ts to enhance reliability. chore: increment package version to 0.0.29-38 in package.json and improve context closure handling in context.ts - Updated package version to 0.0.29-38 in package.json. - Enhanced the logic in context.ts to log a message and handle errors when closing the context if no tabs are left, improving robustness. chore: increment package version to 0.0.29-39 in package.json and refine context closure handling in context.ts - Updated package version to 0.0.29-39 in package.json. - Simplified the context closure logic in context.ts to use a promise-based approach for error handling, improving code clarity and robustness. refactor: implement retry logic for dialog handling in dialogs.ts - Added a retry mechanism to the dialog handling process, allowing up to three attempts to accept or dismiss the dialog, improving robustness against transient errors. - Ensured that the dialog state is always cleared after handling, regardless of success or failure. chore: add .prettierignore and standardize import quotes in TypeScript files - Introduced a .prettierignore file to exclude all files from formatting. - Standardized import statements across TypeScript files to use single quotes for consistency. - Updated package name in package-lock.json and README.md to reflect the new naming convention. - Enhanced linting script in package.json to automatically fix issues during linting. refactor: comment out console error and log statements in context.ts and dialogs.ts - Commented out various console log and error statements in context.ts to reduce noise during execution. - Updated dialog handling in dialogs.ts by commenting out the error logging to streamline the process. chore(extension): support reconnect, implement relay-extension protocol (microsoft#602) chore(extension): convert to typescript (microsoft#603) chore(extension): wrap CDP protocol (microsoft#604) fix(docs): Fix typo of windsurf in readme (microsoft#620) devops(docker): enhance Docker image publishing with ORAS end-of-life tagging (microsoft#641) This tags the images we publish as EOL immediately in order to get excluded from the image scanning. Like we do upstream in microsoft/playwright. docs: adding installation steps for Gemini CLI (microsoft#625) I just tried it out with Gemini CLI and it works like a charm, thanks for creating this MCP server! docs: add instructions to install in Goose (microsoft#580) docs: Update README about imageResponses option. (microsoft#646) feat(dblclick): add double click (microsoft#654) Fixes microsoft#652 chore: update to 1.54.0 (microsoft#653) Closes microsoft#535 chore: roll Playwright to 1.54.1 (microsoft#665) chore: remove extension code (microsoft#667) chore: mark v0.0.30 (microsoft#666) chore: migrate to locator._resolveSelector (microsoft#670) chore: include page errors in console messages (microsoft#671) Fixes microsoft#669 chore: make tab indexes 0-based (microsoft#674) Fixes microsoft#570 chore: resolve dialog races (microsoft#673) Fixes microsoft#595 chore: remove generate_test tool for now - it adds no value (microsoft#675) chore: introduce browser_evaluate (microsoft#678) Fixes microsoft#424 chore: turn vision into capability (microsoft#679) Fixes microsoft#420 chore: remove server experiment (microsoft#681) chore: remove image reply special case in cursor (microsoft#680) chore: sort install sections (microsoft#682) chore: mirror cli options w/ env vars (microsoft#685) Fixes microsoft#639 chore: allow right click (microsoft#687) Fixes microsoft#467 chore: include recent console logs in results (microsoft#689) chore: mark v0.0.31 (microsoft#691) chore(docs): make VSCode match other README sections (microsoft#706) fix: no-sandbox flag logic to only disable sandbox when explicitly passed (microsoft#709) feat: add fullPage mode to browser_take_screenshot (microsoft#704) chore: add mcp chrome extension (microsoft#710) chore: add GitHub Copilot agent YAML specification (microsoft#715) chore: use streamable http by default (microsoft#716) Co-authored-by: Copilot <[email protected]> chore(extension): support running in http mode (microsoft#717) Add test for browser_evaluate error handling (microsoft#719) fix: browser_take_screenshot to not require snapshot unless element is specified (microsoft#725) chore: align lint w/ playwright (microsoft#729) chore(extension): find installed chrome (microsoft#728) chore: move state to tab, do not cache snapshot (microsoft#730) chore(extension): propagate errors to the client (microsoft#736) chore(extension): handle root session id in the relay (microsoft#737) chore: introduce response type (microsoft#738) chore: follow up on tab snapshot capture (microsoft#739) chore: save session log (microsoft#740) chore(extension): terminate all connections when tab closes (microsoft#741) docs: Add LM Studio installation instructions (microsoft#688) chore: add eval script (microsoft#743) chore: do not double close connection (microsoft#744) chore: unify loops (microsoft#745) chore: one tool experiment (microsoft#746) chore(extension): use free port (microsoft#735) chore(extension): page selector for MCP (microsoft#750) chore: extract pure mcp server helpers (microsoft#751) chore: wire one tool in-process (microsoft#753) chore(extension): exit gracefully when waiting for extension connection (microsoft#754) chore: extract loop tools into a separate folder (microsoft#755) chore: retain the source code from the underlying tools (microsoft#756) chore: recommend sse by default (microsoft#758) chore: ping client and disconnect on connection termination (microsoft#764) Revert "chore: recommend sse by default" (microsoft#765) Reverts microsoft#758 Sounds like the stock streamable implementation is to spec, so we can keep it. chore(extension): reject second http connection (microsoft#766) chore: do not snapshot on fill (microsoft#767) chore: mark v0.0.32 (microsoft#768) chore(extension): use react for connect dialog (microsoft#777) chore(extension): use separate package.json (microsoft#778) chore(extension): do not show chrome: tabs (microsoft#780) chore: parse response in tests (microsoft#796) chore: record user actions in the session log (microsoft#798) chore: make tab snapshot structured to mimic it in recorder (microsoft#799) chore: use pngs by default for screenshots (microsoft#797) 1. Use PNG by default. 1. Increase JPG quality from `50` -> `90`. chore: serialize session entries for tool calls and user actions (microsoft#803) chore(extension): bind relay lifetime to browser context (microsoft#804) chore: refactor initialize (microsoft#812) chore: slice profile dirs by root in vscode (microsoft#814) chore: allow to switch between browser connection methods (microsoft#815) chore(extension): terminate connection on debugger detach (microsoft#816) chore: follow up with win test fix (microsoft#818) chore(extension): build into dist directory (microsoft#825) fix: cursor does not respond to listRoots (microsoft#826) chore(extension): create relay per context (microsoft#828) chore(extension): terminate connection if nothing has been selected (microsoft#827) chore(extension): do not send if socket is already closed (microsoft#834) * Remove debugger listeners if closed() is called as `ws.onclosed` is dispatched asynchronously * Tabs can be closed while update badge command is in flight * Inflight CDP commands fail if the tab closes, do not try to send their response to a closed socket chore(extension): proper watchdog for inactive page selector (microsoft#835) chore(extension): show error when connection is rejected due to inact… (microsoft#836) …ivity chore(extension): add test (microsoft#842) * On Linux headed mode under xvfb-run fails to properly launch the process. It works fine without xvfb-run, we don't have environment for that on CI, so run on macOS instead. * Node v18.20.8 stalls on `const uuid = crypto.randomUUID();`, so use v20 for the extension tests. devops: switch to node 20 on CI (microsoft#844) Node 18 maintanence period ended in April 2025. Running on 18 already caused a problem in microsoft#842 chore(extension): explicitly detach from debugger when connection closes (microsoft#847) chore(extension): connect button for each page, style tweaks (microsoft#848) <img width="643" height="709" alt="image" src="https://github.com/user-attachments/assets/850f2455-b853-4c0f-8047-a7f2ced16b7b" /> fix(docs): Invalid MCP Install Link (microsoft#846) chore: do not return fullPage screenshots to the LLM (microsoft#849) chore: roll Playwright to recent (microsoft#850) chore: mark 0.0.33 (microsoft#851) chore(extension): status page (microsoft#856) fix: emit code for waitfor (microsoft#862) Fixes microsoft#859 chore: bump test workers to 2 on CI (microsoft#863) chore: mcp backend switcher (microsoft#854) chore: introduce check-deps (microsoft#864) fix(proxy): properly forward root requests and client metadata (microsoft#865) fix: backtick quote escaping (microsoft#871) chore: tool definition without zod (microsoft#873) chore: roll Playwright to latest (microsoft#875) chore: run test server per context (microsoft#874) Fixes microsoft#869 chore: extract utils folder (microsoft#876) chore: separate proxy client from external (microsoft#877) chore: steer towards mcp types a bit (microsoft#880) fix: wait for initialization to complete before listing tools (microsoft#886) chore: move tool schema to mcp as it is used by all servers (microsoft#887) chore: close all clients in fixture (microsoft#878) docs: add opencode installation instructions (microsoft#895) chore(extension): add readme file, recommend --extension option (microsoft#894) chore(extension): connection timeout when extension not installed (microsoft#896) chore: try macos15 runners (microsoft#892) devops: extension publishing job (microsoft#888) chore: handle list roots in the server, with timeout (microsoft#898) chore(extension): connected badge while loading (microsoft#899) devops: set-version.js script (microsoft#902) chore: fix copyright (microsoft#903) devops: update extension manifest version (microsoft#904) chore: mark 0.0.34 (microsoft#901) chore: do not wrap mcp in proxy by default, drive-by deps fix (microsoft#909) chore: check extension version on connect (microsoft#907) chore: check version in page, link to instructions (microsoft#918) chore(vscode): add vscode mcp factory (microsoft#868) docs: add instructions for installation in openai codex (microsoft#927) chore: show download link on the status mismatch page (microsoft#928) <img width="610" height="108" alt="image" src="https://github.com/user-attachments/assets/bc1f7534-f282-44f0-bb58-e385b2bf82af" /> chore(extension): do not show tab selector for browser_navigate (microsoft#923) chore: mdb stub (microsoft#912) chore: merge tabs tool into one (microsoft#933) chore: remove navigate_forward due to low usage counts (microsoft#934) chore: introduce form filling tool (microsoft#935) chore(extension): do not complain about old extension version (microsoft#937) chore: mark v0.0.35 (microsoft#938) chore: version extension-relay protocol (microsoft#939) chore(extension): support custom executablePath (microsoft#947) Fixes microsoft#941 chore: introduce verification tools (microsoft#951) chore: update README and extension background script - Removed deprecated arguments from README: `--extension` and `--save-session`. - Added new tab management functions to README: `browser_tab_close`, `browser_tab_list`, `browser_tab_new`, and `browser_tab_select`. - Updated background script to handle connection timeout more efficiently by using `void` with `chrome.tabs.sendMessage`. chore: update version and enhance README - Updated package and lock file versions to 0.0.35-0. - Added new arguments to README: `--extension` for connecting to a running browser instance and `--save-session` for saving the Playwright MCP session. - Revised screenshot parameters in README to clarify image format options. - Consolidated tab management functions in README under `browser_tabs`. feat: enhance connection handling in BrowserServerBackend - Added a new method `getContext` to retrieve the context from `BrowserServerBackend`, ensuring it is initialized. - Updated `createConnection` to return both the server and the context, improving the connection interface. chore: update version to 0.0.35-3 and refactor server creation - Incremented package version to 0.0.35-3 in package.json. - Refactored server creation in multiple files to use async/await for better handling of asynchronous operations, ensuring that server instances are fully initialized before use. chore: update version to 0.0.35-4 and improve tab selection error handling - Incremented package version to 0.0.35-4 in package.json. - Enhanced error handling in tab selection by checking for undefined index in tabs.ts. feat: enhance connection handling in BrowserServerBackend - Added `getContext` method to retrieve the context from `BrowserServerBackend`, ensuring it is initialized. - Updated `createConnection` to return both the server and the context, improving the connection interface. - Refactored server creation to use async/await for better handling of asynchronous operations. fix: improve error handling for tab selection in tabs.ts - Updated the tab selection logic to explicitly check for undefined index, ensuring that a valid tab index is provided before proceeding. This change enhances error reporting and prevents potential runtime issues.
Edward-Upton
added a commit
to asteroidai/playwright-mcp
that referenced
this pull request
Aug 26, 2025
feat: enhance Connection type with context and improve createConnection signature - Added context property to the Connection type for better state management. - Reformatted createConnection function signature for improved readability. chore: update package version to 0.0.29-1 fix: update import path for Context and adjust package name in package-lock.json - Changed import path for Context from "./lib/context.js" to "./src/context.ts". - Updated package name in package-lock.json to "@asteroid_ai/playwright-mcp". chore: set package as non-private - Updated package.json to set "private" to false, allowing for potential publishing. chore: update package name to remove scope - Changed package name from "@asteroid_ai/playwright-mcp" to "asteroid-playwright-mcp" in package.json. chore: update import path for Context and increment package version - Changed import path for Context from "./src/context.ts" to "./lib/context.js". - Incremented package version to 0.0.29-2 in package.json. chore: update import path for Context and increment package version - Changed import path for Context from "./lib/context.js" to "./lib/context.d.ts". - Incremented package version to 0.0.29-3 in package.json. chore: update import paths and increment package version - Changed import path for Context from "./lib/context.d.ts" to "./src/context.js". - Added import for Tab from "./src/tab.js". - Incremented package version to 0.0.29-4 in package.json. - Removed "declaration" option from tsconfig.json. feat: add context and tab type definitions - Introduced new type definitions for Context and Tab in context.d.ts and tab.d.ts respectively. - Updated import paths in index.d.ts to reflect the new file structure. - Enhanced type safety and modularity for better code organization. chore: update package version to 0.0.29-6 and include additional type definitions - Incremented package version to 0.0.29-6 in package.json. - Added context.d.ts and tab.d.ts to .npmignore exceptions for better type definition management. chore: increment package version to 0.0.29-7 and refactor context.ts for improved readability - Updated package version to 0.0.29-7 in package.json. - Refactored code in context.ts for better readability, including consistent formatting and improved handling of popups. chore: increment package version to 0.0.29-8 and enhance context.ts for async handling - Updated package version to 0.0.29-8 in package.json. - Improved async handling in context.ts by awaiting page creation and popup handling for better reliability. chore: increment package version to 0.0.29-9 and simplify page creation handling in context.ts - Updated package version to 0.0.29-9 in package.json. - Simplified the page creation logic in context.ts by removing unnecessary popup handling checks. Revert "chore: increment package version to 0.0.29-9 and simplify page creation handling in context.ts" This reverts commit fff3d31. Revert "chore: increment package version to 0.0.29-7 and refactor context.ts for improved readability" This reverts commit 33033cf. chore: increment package version to 0.0.29-10 in package.json fix: enhance popup handling in context.ts - Added a private flag _isHandlingPopup to manage popup state. - Updated _onPageCreated to handle popups asynchronously and convert them to tabs when detected. - Ensured proper handling of popup state during conversion to maintain tab integrity. chore: increment package version to 0.0.29-11 in package.json chore: increment package version to 0.0.29-12 in package.json and enhance popup handling in context.ts - Updated package version to 0.0.29-12 in package.json. - Removed the private flag _isHandlingPopup and implemented a new method _handlePopup to manage popup windows more effectively. - Improved the logic for detecting and converting popups to tabs, ensuring better handling of various popup scenarios. chore: increment package version to 0.0.29-13 in package.json chore: increment package version to 0.0.29-14 in package.json and remove redundant popup navigation wait in context.ts fix: improve download error handling in context.ts - Added error handling for download.saveAs to log any issues during the save process. - Ensured that entry.finished is set to true regardless of the success or failure of the download operation. feat: introduce everyTool export and update connection logic - Added everyTool export in tools.ts to combine snapshotTools and visionTools. - Updated createConnection function in connection.ts to use everyTool by default, with conditional logic for visionTools based on config.vision. chore: increment package version to 0.0.29-16 in package.json chore: increment package version to 0.0.29-17 in package.json fix: only include one version of each tool in `everyTool` feat: enhance popup event logging in context.ts - Added console logs to track popup events, including when a popup is received, if it is a valid popup window, and when it is closed. - Improved visibility into the popup handling process for better debugging and monitoring. chore: increment package version to 0.0.29-19 in package.json chore: increment package version to 0.0.29-20 in package.json and streamline popup handling in context.ts - Updated package version to 0.0.29-20 in package.json. - Simplified the popup handling logic by directly checking the created page for popups and logging relevant events. - Introduced a set of standard target names to improve the detection of popup windows. chore: increment package version to 0.0.29-21 in package.json and enhance popup detection logic in context.ts - Updated package version to 0.0.29-21 in package.json. - Improved the popup detection logic by adding additional indicators and checks for popup-like features, enhancing the accuracy of the `_isPopupWindow` method. chore: increment package version to 0.0.29-22 in package.json and refactor popup detection logic in context.ts - Updated package version to 0.0.29-22 in package.json. - Refactored the `_isPopupWindow` method to utilize a new `popupAnalysis` function for improved popup detection. - Enhanced the analysis process with additional checks and confidence scoring for better accuracy in identifying popup windows. fix: update type for reasons array and improve window resizability check in popup analysis - Changed the type of the `reasons` array to explicitly be an array of strings for better type safety. - Updated the check for window resizability to use a more explicit boolean expression. fix: add error logging for popup window detection in context.ts - Introduced console error logging to capture and report errors encountered during the popup window detection process, improving debugging capabilities. chore: increment package version to 0.0.29-23 in package.json chore: increment package version to 0.0.29-24 in package.json and refactor popup analysis to be asynchronous - Updated package version to 0.0.29-24 in package.json. - Refactored the `popupAnalysis` function to be asynchronous, allowing for better handling of page evaluations. - Updated the call to `popupAnalysis` in `context.ts` to await the result, improving the flow of popup detection. chore: increment package version to 0.0.29-25 in package.json and move THRESHOLD constant inside popupAnalysis function - Updated package version to 0.0.29-25 in package.json. - Moved the `THRESHOLD` constant inside the `popupAnalysis` function for better encapsulation and clarity. chore: increment package version to 0.0.29-26 in package.json chore: increment package version to 0.0.29-27 in package.json and add logging for popup URL in context.ts - Updated package version to 0.0.29-27 in package.json. - Added a console log to output the URL of the popup for better debugging and tracking of popup behavior. refactor: update popup handling to create a new page instead of a new tab in context.ts - Changed the logic to create a new page directly and navigate to the popup URL, improving the handling of popups. - Updated error handling to log navigation failures for better debugging. chore: increment package version to 0.0.29-29 in package.json and enhance error handling in context.ts - Updated package version to 0.0.29-29 in package.json. - Improved error handling for popup management in context.ts, including timeout handling for URL fetching and enhanced logging for better debugging. refactor: simplify popup URL fetching in context.ts - Removed timeout handling for fetching the popup URL, streamlining the process. - Enhanced logging to output the fetched popup URL for better debugging. chore: increment package version to 0.0.29-31 in package.json and ensure popup page loads before fetching URL in context.ts - Updated package version to 0.0.29-31 in package.json. - Added a wait for the "domcontentloaded" state before fetching the popup URL in context.ts to improve reliability. chore: increment package version to 0.0.29-32 in package.json and enhance popup URL retrieval logic in context.ts - Updated package version to 0.0.29-32 in package.json. - Improved the logic for fetching the popup URL in context.ts with retry attempts and error handling to ensure reliability. refactor: enhance popup handling logic in context.ts - Updated _handlePopup method to return a boolean indicating if a popup was handled. - Improved error handling and logging for popup URL retrieval and closing popups. - Streamlined the logic to avoid unnecessary tab additions when a popup is detected. refactor: improve popup URL retrieval with retry logic in context.ts - Enhanced the _handlePopup method to implement a retry mechanism for fetching the popup URL, allowing up to three attempts. - Improved error handling and logging during the URL retrieval process. - Adjusted return values to better reflect the success of popup handling. chore: increment package version to 0.0.29-35 in package.json and extend timeout for popup URL fetching in context.ts - Updated package version to 0.0.29-35 in package.json. - Increased the timeout duration for waiting on popup URL resolution from 1500ms to 2500ms in context.ts to improve reliability. chore: increment package version to 0.0.29-36 in package.json and adjust timeout for popup URL fetching in context.ts - Updated package version to 0.0.29-36 in package.json. - Increased the timeout duration for waiting on popup URL resolution from 2500ms to 3000ms in context.ts to enhance reliability. - Ensured that the current tab is always switched to the newly created tab in context.ts. chore: increment package version to 0.0.29-37 in package.json and extend timeout for popup URL fetching in context.ts - Updated package version to 0.0.29-37 in package.json. - Increased the timeout duration for waiting on popup URL resolution from 3000ms to 4000ms in context.ts to enhance reliability. chore: increment package version to 0.0.29-38 in package.json and improve context closure handling in context.ts - Updated package version to 0.0.29-38 in package.json. - Enhanced the logic in context.ts to log a message and handle errors when closing the context if no tabs are left, improving robustness. chore: increment package version to 0.0.29-39 in package.json and refine context closure handling in context.ts - Updated package version to 0.0.29-39 in package.json. - Simplified the context closure logic in context.ts to use a promise-based approach for error handling, improving code clarity and robustness. refactor: implement retry logic for dialog handling in dialogs.ts - Added a retry mechanism to the dialog handling process, allowing up to three attempts to accept or dismiss the dialog, improving robustness against transient errors. - Ensured that the dialog state is always cleared after handling, regardless of success or failure. chore: add .prettierignore and standardize import quotes in TypeScript files - Introduced a .prettierignore file to exclude all files from formatting. - Standardized import statements across TypeScript files to use single quotes for consistency. - Updated package name in package-lock.json and README.md to reflect the new naming convention. - Enhanced linting script in package.json to automatically fix issues during linting. refactor: comment out console error and log statements in context.ts and dialogs.ts - Commented out various console log and error statements in context.ts to reduce noise during execution. - Updated dialog handling in dialogs.ts by commenting out the error logging to streamline the process. chore(extension): support reconnect, implement relay-extension protocol (microsoft#602) chore(extension): convert to typescript (microsoft#603) chore(extension): wrap CDP protocol (microsoft#604) fix(docs): Fix typo of windsurf in readme (microsoft#620) devops(docker): enhance Docker image publishing with ORAS end-of-life tagging (microsoft#641) This tags the images we publish as EOL immediately in order to get excluded from the image scanning. Like we do upstream in microsoft/playwright. docs: adding installation steps for Gemini CLI (microsoft#625) I just tried it out with Gemini CLI and it works like a charm, thanks for creating this MCP server! docs: add instructions to install in Goose (microsoft#580) docs: Update README about imageResponses option. (microsoft#646) feat(dblclick): add double click (microsoft#654) Fixes microsoft#652 chore: update to 1.54.0 (microsoft#653) Closes microsoft#535 chore: roll Playwright to 1.54.1 (microsoft#665) chore: remove extension code (microsoft#667) chore: mark v0.0.30 (microsoft#666) chore: migrate to locator._resolveSelector (microsoft#670) chore: include page errors in console messages (microsoft#671) Fixes microsoft#669 chore: make tab indexes 0-based (microsoft#674) Fixes microsoft#570 chore: resolve dialog races (microsoft#673) Fixes microsoft#595 chore: remove generate_test tool for now - it adds no value (microsoft#675) chore: introduce browser_evaluate (microsoft#678) Fixes microsoft#424 chore: turn vision into capability (microsoft#679) Fixes microsoft#420 chore: remove server experiment (microsoft#681) chore: remove image reply special case in cursor (microsoft#680) chore: sort install sections (microsoft#682) chore: mirror cli options w/ env vars (microsoft#685) Fixes microsoft#639 chore: allow right click (microsoft#687) Fixes microsoft#467 chore: include recent console logs in results (microsoft#689) chore: mark v0.0.31 (microsoft#691) chore(docs): make VSCode match other README sections (microsoft#706) fix: no-sandbox flag logic to only disable sandbox when explicitly passed (microsoft#709) feat: add fullPage mode to browser_take_screenshot (microsoft#704) chore: add mcp chrome extension (microsoft#710) chore: add GitHub Copilot agent YAML specification (microsoft#715) chore: use streamable http by default (microsoft#716) Co-authored-by: Copilot <[email protected]> chore(extension): support running in http mode (microsoft#717) Add test for browser_evaluate error handling (microsoft#719) fix: browser_take_screenshot to not require snapshot unless element is specified (microsoft#725) chore: align lint w/ playwright (microsoft#729) chore(extension): find installed chrome (microsoft#728) chore: move state to tab, do not cache snapshot (microsoft#730) chore(extension): propagate errors to the client (microsoft#736) chore(extension): handle root session id in the relay (microsoft#737) chore: introduce response type (microsoft#738) chore: follow up on tab snapshot capture (microsoft#739) chore: save session log (microsoft#740) chore(extension): terminate all connections when tab closes (microsoft#741) docs: Add LM Studio installation instructions (microsoft#688) chore: add eval script (microsoft#743) chore: do not double close connection (microsoft#744) chore: unify loops (microsoft#745) chore: one tool experiment (microsoft#746) chore(extension): use free port (microsoft#735) chore(extension): page selector for MCP (microsoft#750) chore: extract pure mcp server helpers (microsoft#751) chore: wire one tool in-process (microsoft#753) chore(extension): exit gracefully when waiting for extension connection (microsoft#754) chore: extract loop tools into a separate folder (microsoft#755) chore: retain the source code from the underlying tools (microsoft#756) chore: recommend sse by default (microsoft#758) chore: ping client and disconnect on connection termination (microsoft#764) Revert "chore: recommend sse by default" (microsoft#765) Reverts microsoft#758 Sounds like the stock streamable implementation is to spec, so we can keep it. chore(extension): reject second http connection (microsoft#766) chore: do not snapshot on fill (microsoft#767) chore: mark v0.0.32 (microsoft#768) chore(extension): use react for connect dialog (microsoft#777) chore(extension): use separate package.json (microsoft#778) chore(extension): do not show chrome: tabs (microsoft#780) chore: parse response in tests (microsoft#796) chore: record user actions in the session log (microsoft#798) chore: make tab snapshot structured to mimic it in recorder (microsoft#799) chore: use pngs by default for screenshots (microsoft#797) 1. Use PNG by default. 1. Increase JPG quality from `50` -> `90`. chore: serialize session entries for tool calls and user actions (microsoft#803) chore(extension): bind relay lifetime to browser context (microsoft#804) chore: refactor initialize (microsoft#812) chore: slice profile dirs by root in vscode (microsoft#814) chore: allow to switch between browser connection methods (microsoft#815) chore(extension): terminate connection on debugger detach (microsoft#816) chore: follow up with win test fix (microsoft#818) chore(extension): build into dist directory (microsoft#825) fix: cursor does not respond to listRoots (microsoft#826) chore(extension): create relay per context (microsoft#828) chore(extension): terminate connection if nothing has been selected (microsoft#827) chore(extension): do not send if socket is already closed (microsoft#834) * Remove debugger listeners if closed() is called as `ws.onclosed` is dispatched asynchronously * Tabs can be closed while update badge command is in flight * Inflight CDP commands fail if the tab closes, do not try to send their response to a closed socket chore(extension): proper watchdog for inactive page selector (microsoft#835) chore(extension): show error when connection is rejected due to inact… (microsoft#836) …ivity chore(extension): add test (microsoft#842) * On Linux headed mode under xvfb-run fails to properly launch the process. It works fine without xvfb-run, we don't have environment for that on CI, so run on macOS instead. * Node v18.20.8 stalls on `const uuid = crypto.randomUUID();`, so use v20 for the extension tests. devops: switch to node 20 on CI (microsoft#844) Node 18 maintanence period ended in April 2025. Running on 18 already caused a problem in microsoft#842 chore(extension): explicitly detach from debugger when connection closes (microsoft#847) chore(extension): connect button for each page, style tweaks (microsoft#848) <img width="643" height="709" alt="image" src="https://github.com/user-attachments/assets/850f2455-b853-4c0f-8047-a7f2ced16b7b" /> fix(docs): Invalid MCP Install Link (microsoft#846) chore: do not return fullPage screenshots to the LLM (microsoft#849) chore: roll Playwright to recent (microsoft#850) chore: mark 0.0.33 (microsoft#851) chore(extension): status page (microsoft#856) fix: emit code for waitfor (microsoft#862) Fixes microsoft#859 chore: bump test workers to 2 on CI (microsoft#863) chore: mcp backend switcher (microsoft#854) chore: introduce check-deps (microsoft#864) fix(proxy): properly forward root requests and client metadata (microsoft#865) fix: backtick quote escaping (microsoft#871) chore: tool definition without zod (microsoft#873) chore: roll Playwright to latest (microsoft#875) chore: run test server per context (microsoft#874) Fixes microsoft#869 chore: extract utils folder (microsoft#876) chore: separate proxy client from external (microsoft#877) chore: steer towards mcp types a bit (microsoft#880) fix: wait for initialization to complete before listing tools (microsoft#886) chore: move tool schema to mcp as it is used by all servers (microsoft#887) chore: close all clients in fixture (microsoft#878) docs: add opencode installation instructions (microsoft#895) chore(extension): add readme file, recommend --extension option (microsoft#894) chore(extension): connection timeout when extension not installed (microsoft#896) chore: try macos15 runners (microsoft#892) devops: extension publishing job (microsoft#888) chore: handle list roots in the server, with timeout (microsoft#898) chore(extension): connected badge while loading (microsoft#899) devops: set-version.js script (microsoft#902) chore: fix copyright (microsoft#903) devops: update extension manifest version (microsoft#904) chore: mark 0.0.34 (microsoft#901) chore: do not wrap mcp in proxy by default, drive-by deps fix (microsoft#909) chore: check extension version on connect (microsoft#907) chore: check version in page, link to instructions (microsoft#918) chore(vscode): add vscode mcp factory (microsoft#868) docs: add instructions for installation in openai codex (microsoft#927) chore: show download link on the status mismatch page (microsoft#928) <img width="610" height="108" alt="image" src="https://github.com/user-attachments/assets/bc1f7534-f282-44f0-bb58-e385b2bf82af" /> chore(extension): do not show tab selector for browser_navigate (microsoft#923) chore: mdb stub (microsoft#912) chore: merge tabs tool into one (microsoft#933) chore: remove navigate_forward due to low usage counts (microsoft#934) chore: introduce form filling tool (microsoft#935) chore(extension): do not complain about old extension version (microsoft#937) chore: mark v0.0.35 (microsoft#938) chore: version extension-relay protocol (microsoft#939) chore(extension): support custom executablePath (microsoft#947) Fixes microsoft#941 chore: introduce verification tools (microsoft#951) chore: update README and extension background script - Removed deprecated arguments from README: `--extension` and `--save-session`. - Added new tab management functions to README: `browser_tab_close`, `browser_tab_list`, `browser_tab_new`, and `browser_tab_select`. - Updated background script to handle connection timeout more efficiently by using `void` with `chrome.tabs.sendMessage`. chore: update version and enhance README - Updated package and lock file versions to 0.0.35-0. - Added new arguments to README: `--extension` for connecting to a running browser instance and `--save-session` for saving the Playwright MCP session. - Revised screenshot parameters in README to clarify image format options. - Consolidated tab management functions in README under `browser_tabs`. feat: enhance connection handling in BrowserServerBackend - Added a new method `getContext` to retrieve the context from `BrowserServerBackend`, ensuring it is initialized. - Updated `createConnection` to return both the server and the context, improving the connection interface. chore: update version to 0.0.35-3 and refactor server creation - Incremented package version to 0.0.35-3 in package.json. - Refactored server creation in multiple files to use async/await for better handling of asynchronous operations, ensuring that server instances are fully initialized before use. chore: update version to 0.0.35-4 and improve tab selection error handling - Incremented package version to 0.0.35-4 in package.json. - Enhanced error handling in tab selection by checking for undefined index in tabs.ts. feat: enhance connection handling in BrowserServerBackend - Added `getContext` method to retrieve the context from `BrowserServerBackend`, ensuring it is initialized. - Updated `createConnection` to return both the server and the context, improving the connection interface. - Refactored server creation to use async/await for better handling of asynchronous operations. fix: improve error handling for tab selection in tabs.ts - Updated the tab selection logic to explicitly check for undefined index, ensuring that a valid tab index is provided before proceeding. This change enhances error reporting and prevents potential runtime issues.
Edward-Upton
added a commit
to asteroidai/playwright-mcp
that referenced
this pull request
Aug 26, 2025
feat: enhance Connection type with context and improve createConnection signature - Added context property to the Connection type for better state management. - Reformatted createConnection function signature for improved readability. chore: update package version to 0.0.29-1 fix: update import path for Context and adjust package name in package-lock.json - Changed import path for Context from "./lib/context.js" to "./src/context.ts". - Updated package name in package-lock.json to "@asteroid_ai/playwright-mcp". chore: set package as non-private - Updated package.json to set "private" to false, allowing for potential publishing. chore: update package name to remove scope - Changed package name from "@asteroid_ai/playwright-mcp" to "asteroid-playwright-mcp" in package.json. chore: update import path for Context and increment package version - Changed import path for Context from "./src/context.ts" to "./lib/context.js". - Incremented package version to 0.0.29-2 in package.json. chore: update import path for Context and increment package version - Changed import path for Context from "./lib/context.js" to "./lib/context.d.ts". - Incremented package version to 0.0.29-3 in package.json. chore: update import paths and increment package version - Changed import path for Context from "./lib/context.d.ts" to "./src/context.js". - Added import for Tab from "./src/tab.js". - Incremented package version to 0.0.29-4 in package.json. - Removed "declaration" option from tsconfig.json. feat: add context and tab type definitions - Introduced new type definitions for Context and Tab in context.d.ts and tab.d.ts respectively. - Updated import paths in index.d.ts to reflect the new file structure. - Enhanced type safety and modularity for better code organization. chore: update package version to 0.0.29-6 and include additional type definitions - Incremented package version to 0.0.29-6 in package.json. - Added context.d.ts and tab.d.ts to .npmignore exceptions for better type definition management. chore: increment package version to 0.0.29-7 and refactor context.ts for improved readability - Updated package version to 0.0.29-7 in package.json. - Refactored code in context.ts for better readability, including consistent formatting and improved handling of popups. chore: increment package version to 0.0.29-8 and enhance context.ts for async handling - Updated package version to 0.0.29-8 in package.json. - Improved async handling in context.ts by awaiting page creation and popup handling for better reliability. chore: increment package version to 0.0.29-9 and simplify page creation handling in context.ts - Updated package version to 0.0.29-9 in package.json. - Simplified the page creation logic in context.ts by removing unnecessary popup handling checks. Revert "chore: increment package version to 0.0.29-9 and simplify page creation handling in context.ts" This reverts commit fff3d31. Revert "chore: increment package version to 0.0.29-7 and refactor context.ts for improved readability" This reverts commit 33033cf. chore: increment package version to 0.0.29-10 in package.json fix: enhance popup handling in context.ts - Added a private flag _isHandlingPopup to manage popup state. - Updated _onPageCreated to handle popups asynchronously and convert them to tabs when detected. - Ensured proper handling of popup state during conversion to maintain tab integrity. chore: increment package version to 0.0.29-11 in package.json chore: increment package version to 0.0.29-12 in package.json and enhance popup handling in context.ts - Updated package version to 0.0.29-12 in package.json. - Removed the private flag _isHandlingPopup and implemented a new method _handlePopup to manage popup windows more effectively. - Improved the logic for detecting and converting popups to tabs, ensuring better handling of various popup scenarios. chore: increment package version to 0.0.29-13 in package.json chore: increment package version to 0.0.29-14 in package.json and remove redundant popup navigation wait in context.ts fix: improve download error handling in context.ts - Added error handling for download.saveAs to log any issues during the save process. - Ensured that entry.finished is set to true regardless of the success or failure of the download operation. feat: introduce everyTool export and update connection logic - Added everyTool export in tools.ts to combine snapshotTools and visionTools. - Updated createConnection function in connection.ts to use everyTool by default, with conditional logic for visionTools based on config.vision. chore: increment package version to 0.0.29-16 in package.json chore: increment package version to 0.0.29-17 in package.json fix: only include one version of each tool in `everyTool` feat: enhance popup event logging in context.ts - Added console logs to track popup events, including when a popup is received, if it is a valid popup window, and when it is closed. - Improved visibility into the popup handling process for better debugging and monitoring. chore: increment package version to 0.0.29-19 in package.json chore: increment package version to 0.0.29-20 in package.json and streamline popup handling in context.ts - Updated package version to 0.0.29-20 in package.json. - Simplified the popup handling logic by directly checking the created page for popups and logging relevant events. - Introduced a set of standard target names to improve the detection of popup windows. chore: increment package version to 0.0.29-21 in package.json and enhance popup detection logic in context.ts - Updated package version to 0.0.29-21 in package.json. - Improved the popup detection logic by adding additional indicators and checks for popup-like features, enhancing the accuracy of the `_isPopupWindow` method. chore: increment package version to 0.0.29-22 in package.json and refactor popup detection logic in context.ts - Updated package version to 0.0.29-22 in package.json. - Refactored the `_isPopupWindow` method to utilize a new `popupAnalysis` function for improved popup detection. - Enhanced the analysis process with additional checks and confidence scoring for better accuracy in identifying popup windows. fix: update type for reasons array and improve window resizability check in popup analysis - Changed the type of the `reasons` array to explicitly be an array of strings for better type safety. - Updated the check for window resizability to use a more explicit boolean expression. fix: add error logging for popup window detection in context.ts - Introduced console error logging to capture and report errors encountered during the popup window detection process, improving debugging capabilities. chore: increment package version to 0.0.29-23 in package.json chore: increment package version to 0.0.29-24 in package.json and refactor popup analysis to be asynchronous - Updated package version to 0.0.29-24 in package.json. - Refactored the `popupAnalysis` function to be asynchronous, allowing for better handling of page evaluations. - Updated the call to `popupAnalysis` in `context.ts` to await the result, improving the flow of popup detection. chore: increment package version to 0.0.29-25 in package.json and move THRESHOLD constant inside popupAnalysis function - Updated package version to 0.0.29-25 in package.json. - Moved the `THRESHOLD` constant inside the `popupAnalysis` function for better encapsulation and clarity. chore: increment package version to 0.0.29-26 in package.json chore: increment package version to 0.0.29-27 in package.json and add logging for popup URL in context.ts - Updated package version to 0.0.29-27 in package.json. - Added a console log to output the URL of the popup for better debugging and tracking of popup behavior. refactor: update popup handling to create a new page instead of a new tab in context.ts - Changed the logic to create a new page directly and navigate to the popup URL, improving the handling of popups. - Updated error handling to log navigation failures for better debugging. chore: increment package version to 0.0.29-29 in package.json and enhance error handling in context.ts - Updated package version to 0.0.29-29 in package.json. - Improved error handling for popup management in context.ts, including timeout handling for URL fetching and enhanced logging for better debugging. refactor: simplify popup URL fetching in context.ts - Removed timeout handling for fetching the popup URL, streamlining the process. - Enhanced logging to output the fetched popup URL for better debugging. chore: increment package version to 0.0.29-31 in package.json and ensure popup page loads before fetching URL in context.ts - Updated package version to 0.0.29-31 in package.json. - Added a wait for the "domcontentloaded" state before fetching the popup URL in context.ts to improve reliability. chore: increment package version to 0.0.29-32 in package.json and enhance popup URL retrieval logic in context.ts - Updated package version to 0.0.29-32 in package.json. - Improved the logic for fetching the popup URL in context.ts with retry attempts and error handling to ensure reliability. refactor: enhance popup handling logic in context.ts - Updated _handlePopup method to return a boolean indicating if a popup was handled. - Improved error handling and logging for popup URL retrieval and closing popups. - Streamlined the logic to avoid unnecessary tab additions when a popup is detected. refactor: improve popup URL retrieval with retry logic in context.ts - Enhanced the _handlePopup method to implement a retry mechanism for fetching the popup URL, allowing up to three attempts. - Improved error handling and logging during the URL retrieval process. - Adjusted return values to better reflect the success of popup handling. chore: increment package version to 0.0.29-35 in package.json and extend timeout for popup URL fetching in context.ts - Updated package version to 0.0.29-35 in package.json. - Increased the timeout duration for waiting on popup URL resolution from 1500ms to 2500ms in context.ts to improve reliability. chore: increment package version to 0.0.29-36 in package.json and adjust timeout for popup URL fetching in context.ts - Updated package version to 0.0.29-36 in package.json. - Increased the timeout duration for waiting on popup URL resolution from 2500ms to 3000ms in context.ts to enhance reliability. - Ensured that the current tab is always switched to the newly created tab in context.ts. chore: increment package version to 0.0.29-37 in package.json and extend timeout for popup URL fetching in context.ts - Updated package version to 0.0.29-37 in package.json. - Increased the timeout duration for waiting on popup URL resolution from 3000ms to 4000ms in context.ts to enhance reliability. chore: increment package version to 0.0.29-38 in package.json and improve context closure handling in context.ts - Updated package version to 0.0.29-38 in package.json. - Enhanced the logic in context.ts to log a message and handle errors when closing the context if no tabs are left, improving robustness. chore: increment package version to 0.0.29-39 in package.json and refine context closure handling in context.ts - Updated package version to 0.0.29-39 in package.json. - Simplified the context closure logic in context.ts to use a promise-based approach for error handling, improving code clarity and robustness. refactor: implement retry logic for dialog handling in dialogs.ts - Added a retry mechanism to the dialog handling process, allowing up to three attempts to accept or dismiss the dialog, improving robustness against transient errors. - Ensured that the dialog state is always cleared after handling, regardless of success or failure. chore: add .prettierignore and standardize import quotes in TypeScript files - Introduced a .prettierignore file to exclude all files from formatting. - Standardized import statements across TypeScript files to use single quotes for consistency. - Updated package name in package-lock.json and README.md to reflect the new naming convention. - Enhanced linting script in package.json to automatically fix issues during linting. refactor: comment out console error and log statements in context.ts and dialogs.ts - Commented out various console log and error statements in context.ts to reduce noise during execution. - Updated dialog handling in dialogs.ts by commenting out the error logging to streamline the process. chore(extension): support reconnect, implement relay-extension protocol (microsoft#602) chore(extension): convert to typescript (microsoft#603) chore(extension): wrap CDP protocol (microsoft#604) fix(docs): Fix typo of windsurf in readme (microsoft#620) devops(docker): enhance Docker image publishing with ORAS end-of-life tagging (microsoft#641) This tags the images we publish as EOL immediately in order to get excluded from the image scanning. Like we do upstream in microsoft/playwright. docs: adding installation steps for Gemini CLI (microsoft#625) I just tried it out with Gemini CLI and it works like a charm, thanks for creating this MCP server! docs: add instructions to install in Goose (microsoft#580) docs: Update README about imageResponses option. (microsoft#646) feat(dblclick): add double click (microsoft#654) Fixes microsoft#652 chore: update to 1.54.0 (microsoft#653) Closes microsoft#535 chore: roll Playwright to 1.54.1 (microsoft#665) chore: remove extension code (microsoft#667) chore: mark v0.0.30 (microsoft#666) chore: migrate to locator._resolveSelector (microsoft#670) chore: include page errors in console messages (microsoft#671) Fixes microsoft#669 chore: make tab indexes 0-based (microsoft#674) Fixes microsoft#570 chore: resolve dialog races (microsoft#673) Fixes microsoft#595 chore: remove generate_test tool for now - it adds no value (microsoft#675) chore: introduce browser_evaluate (microsoft#678) Fixes microsoft#424 chore: turn vision into capability (microsoft#679) Fixes microsoft#420 chore: remove server experiment (microsoft#681) chore: remove image reply special case in cursor (microsoft#680) chore: sort install sections (microsoft#682) chore: mirror cli options w/ env vars (microsoft#685) Fixes microsoft#639 chore: allow right click (microsoft#687) Fixes microsoft#467 chore: include recent console logs in results (microsoft#689) chore: mark v0.0.31 (microsoft#691) chore(docs): make VSCode match other README sections (microsoft#706) fix: no-sandbox flag logic to only disable sandbox when explicitly passed (microsoft#709) feat: add fullPage mode to browser_take_screenshot (microsoft#704) chore: add mcp chrome extension (microsoft#710) chore: add GitHub Copilot agent YAML specification (microsoft#715) chore: use streamable http by default (microsoft#716) Co-authored-by: Copilot <[email protected]> chore(extension): support running in http mode (microsoft#717) Add test for browser_evaluate error handling (microsoft#719) fix: browser_take_screenshot to not require snapshot unless element is specified (microsoft#725) chore: align lint w/ playwright (microsoft#729) chore(extension): find installed chrome (microsoft#728) chore: move state to tab, do not cache snapshot (microsoft#730) chore(extension): propagate errors to the client (microsoft#736) chore(extension): handle root session id in the relay (microsoft#737) chore: introduce response type (microsoft#738) chore: follow up on tab snapshot capture (microsoft#739) chore: save session log (microsoft#740) chore(extension): terminate all connections when tab closes (microsoft#741) docs: Add LM Studio installation instructions (microsoft#688) chore: add eval script (microsoft#743) chore: do not double close connection (microsoft#744) chore: unify loops (microsoft#745) chore: one tool experiment (microsoft#746) chore(extension): use free port (microsoft#735) chore(extension): page selector for MCP (microsoft#750) chore: extract pure mcp server helpers (microsoft#751) chore: wire one tool in-process (microsoft#753) chore(extension): exit gracefully when waiting for extension connection (microsoft#754) chore: extract loop tools into a separate folder (microsoft#755) chore: retain the source code from the underlying tools (microsoft#756) chore: recommend sse by default (microsoft#758) chore: ping client and disconnect on connection termination (microsoft#764) Revert "chore: recommend sse by default" (microsoft#765) Reverts microsoft#758 Sounds like the stock streamable implementation is to spec, so we can keep it. chore(extension): reject second http connection (microsoft#766) chore: do not snapshot on fill (microsoft#767) chore: mark v0.0.32 (microsoft#768) chore(extension): use react for connect dialog (microsoft#777) chore(extension): use separate package.json (microsoft#778) chore(extension): do not show chrome: tabs (microsoft#780) chore: parse response in tests (microsoft#796) chore: record user actions in the session log (microsoft#798) chore: make tab snapshot structured to mimic it in recorder (microsoft#799) chore: use pngs by default for screenshots (microsoft#797) 1. Use PNG by default. 1. Increase JPG quality from `50` -> `90`. chore: serialize session entries for tool calls and user actions (microsoft#803) chore(extension): bind relay lifetime to browser context (microsoft#804) chore: refactor initialize (microsoft#812) chore: slice profile dirs by root in vscode (microsoft#814) chore: allow to switch between browser connection methods (microsoft#815) chore(extension): terminate connection on debugger detach (microsoft#816) chore: follow up with win test fix (microsoft#818) chore(extension): build into dist directory (microsoft#825) fix: cursor does not respond to listRoots (microsoft#826) chore(extension): create relay per context (microsoft#828) chore(extension): terminate connection if nothing has been selected (microsoft#827) chore(extension): do not send if socket is already closed (microsoft#834) * Remove debugger listeners if closed() is called as `ws.onclosed` is dispatched asynchronously * Tabs can be closed while update badge command is in flight * Inflight CDP commands fail if the tab closes, do not try to send their response to a closed socket chore(extension): proper watchdog for inactive page selector (microsoft#835) chore(extension): show error when connection is rejected due to inact… (microsoft#836) …ivity chore(extension): add test (microsoft#842) * On Linux headed mode under xvfb-run fails to properly launch the process. It works fine without xvfb-run, we don't have environment for that on CI, so run on macOS instead. * Node v18.20.8 stalls on `const uuid = crypto.randomUUID();`, so use v20 for the extension tests. devops: switch to node 20 on CI (microsoft#844) Node 18 maintanence period ended in April 2025. Running on 18 already caused a problem in microsoft#842 chore(extension): explicitly detach from debugger when connection closes (microsoft#847) chore(extension): connect button for each page, style tweaks (microsoft#848) <img width="643" height="709" alt="image" src="https://github.com/user-attachments/assets/850f2455-b853-4c0f-8047-a7f2ced16b7b" /> fix(docs): Invalid MCP Install Link (microsoft#846) chore: do not return fullPage screenshots to the LLM (microsoft#849) chore: roll Playwright to recent (microsoft#850) chore: mark 0.0.33 (microsoft#851) chore(extension): status page (microsoft#856) fix: emit code for waitfor (microsoft#862) Fixes microsoft#859 chore: bump test workers to 2 on CI (microsoft#863) chore: mcp backend switcher (microsoft#854) chore: introduce check-deps (microsoft#864) fix(proxy): properly forward root requests and client metadata (microsoft#865) fix: backtick quote escaping (microsoft#871) chore: tool definition without zod (microsoft#873) chore: roll Playwright to latest (microsoft#875) chore: run test server per context (microsoft#874) Fixes microsoft#869 chore: extract utils folder (microsoft#876) chore: separate proxy client from external (microsoft#877) chore: steer towards mcp types a bit (microsoft#880) fix: wait for initialization to complete before listing tools (microsoft#886) chore: move tool schema to mcp as it is used by all servers (microsoft#887) chore: close all clients in fixture (microsoft#878) docs: add opencode installation instructions (microsoft#895) chore(extension): add readme file, recommend --extension option (microsoft#894) chore(extension): connection timeout when extension not installed (microsoft#896) chore: try macos15 runners (microsoft#892) devops: extension publishing job (microsoft#888) chore: handle list roots in the server, with timeout (microsoft#898) chore(extension): connected badge while loading (microsoft#899) devops: set-version.js script (microsoft#902) chore: fix copyright (microsoft#903) devops: update extension manifest version (microsoft#904) chore: mark 0.0.34 (microsoft#901) chore: do not wrap mcp in proxy by default, drive-by deps fix (microsoft#909) chore: check extension version on connect (microsoft#907) chore: check version in page, link to instructions (microsoft#918) chore(vscode): add vscode mcp factory (microsoft#868) docs: add instructions for installation in openai codex (microsoft#927) chore: show download link on the status mismatch page (microsoft#928) <img width="610" height="108" alt="image" src="https://github.com/user-attachments/assets/bc1f7534-f282-44f0-bb58-e385b2bf82af" /> chore(extension): do not show tab selector for browser_navigate (microsoft#923) chore: mdb stub (microsoft#912) chore: merge tabs tool into one (microsoft#933) chore: remove navigate_forward due to low usage counts (microsoft#934) chore: introduce form filling tool (microsoft#935) chore(extension): do not complain about old extension version (microsoft#937) chore: mark v0.0.35 (microsoft#938) chore: version extension-relay protocol (microsoft#939) chore(extension): support custom executablePath (microsoft#947) Fixes microsoft#941 chore: introduce verification tools (microsoft#951) chore: update README and extension background script - Removed deprecated arguments from README: `--extension` and `--save-session`. - Added new tab management functions to README: `browser_tab_close`, `browser_tab_list`, `browser_tab_new`, and `browser_tab_select`. - Updated background script to handle connection timeout more efficiently by using `void` with `chrome.tabs.sendMessage`. chore: update version and enhance README - Updated package and lock file versions to 0.0.35-0. - Added new arguments to README: `--extension` for connecting to a running browser instance and `--save-session` for saving the Playwright MCP session. - Revised screenshot parameters in README to clarify image format options. - Consolidated tab management functions in README under `browser_tabs`. feat: enhance connection handling in BrowserServerBackend - Added a new method `getContext` to retrieve the context from `BrowserServerBackend`, ensuring it is initialized. - Updated `createConnection` to return both the server and the context, improving the connection interface. chore: update version to 0.0.35-3 and refactor server creation - Incremented package version to 0.0.35-3 in package.json. - Refactored server creation in multiple files to use async/await for better handling of asynchronous operations, ensuring that server instances are fully initialized before use. chore: update version to 0.0.35-4 and improve tab selection error handling - Incremented package version to 0.0.35-4 in package.json. - Enhanced error handling in tab selection by checking for undefined index in tabs.ts. feat: enhance connection handling in BrowserServerBackend - Added `getContext` method to retrieve the context from `BrowserServerBackend`, ensuring it is initialized. - Updated `createConnection` to return both the server and the context, improving the connection interface. - Refactored server creation to use async/await for better handling of asynchronous operations. fix: improve error handling for tab selection in tabs.ts - Updated the tab selection logic to explicitly check for undefined index, ensuring that a valid tab index is provided before proceeding. This change enhances error reporting and prevents potential runtime issues.
Edward-Upton
added a commit
to asteroidai/playwright-mcp
that referenced
this pull request
Aug 26, 2025
feat: enhance Connection type with context and improve createConnection signature - Added context property to the Connection type for better state management. - Reformatted createConnection function signature for improved readability. chore: update package version to 0.0.29-1 fix: update import path for Context and adjust package name in package-lock.json - Changed import path for Context from "./lib/context.js" to "./src/context.ts". - Updated package name in package-lock.json to "@asteroid_ai/playwright-mcp". chore: set package as non-private - Updated package.json to set "private" to false, allowing for potential publishing. chore: update package name to remove scope - Changed package name from "@asteroid_ai/playwright-mcp" to "asteroid-playwright-mcp" in package.json. chore: update import path for Context and increment package version - Changed import path for Context from "./src/context.ts" to "./lib/context.js". - Incremented package version to 0.0.29-2 in package.json. chore: update import path for Context and increment package version - Changed import path for Context from "./lib/context.js" to "./lib/context.d.ts". - Incremented package version to 0.0.29-3 in package.json. chore: update import paths and increment package version - Changed import path for Context from "./lib/context.d.ts" to "./src/context.js". - Added import for Tab from "./src/tab.js". - Incremented package version to 0.0.29-4 in package.json. - Removed "declaration" option from tsconfig.json. feat: add context and tab type definitions - Introduced new type definitions for Context and Tab in context.d.ts and tab.d.ts respectively. - Updated import paths in index.d.ts to reflect the new file structure. - Enhanced type safety and modularity for better code organization. chore: update package version to 0.0.29-6 and include additional type definitions - Incremented package version to 0.0.29-6 in package.json. - Added context.d.ts and tab.d.ts to .npmignore exceptions for better type definition management. chore: increment package version to 0.0.29-7 and refactor context.ts for improved readability - Updated package version to 0.0.29-7 in package.json. - Refactored code in context.ts for better readability, including consistent formatting and improved handling of popups. chore: increment package version to 0.0.29-8 and enhance context.ts for async handling - Updated package version to 0.0.29-8 in package.json. - Improved async handling in context.ts by awaiting page creation and popup handling for better reliability. chore: increment package version to 0.0.29-9 and simplify page creation handling in context.ts - Updated package version to 0.0.29-9 in package.json. - Simplified the page creation logic in context.ts by removing unnecessary popup handling checks. Revert "chore: increment package version to 0.0.29-9 and simplify page creation handling in context.ts" This reverts commit fff3d31. Revert "chore: increment package version to 0.0.29-7 and refactor context.ts for improved readability" This reverts commit 33033cf. chore: increment package version to 0.0.29-10 in package.json fix: enhance popup handling in context.ts - Added a private flag _isHandlingPopup to manage popup state. - Updated _onPageCreated to handle popups asynchronously and convert them to tabs when detected. - Ensured proper handling of popup state during conversion to maintain tab integrity. chore: increment package version to 0.0.29-11 in package.json chore: increment package version to 0.0.29-12 in package.json and enhance popup handling in context.ts - Updated package version to 0.0.29-12 in package.json. - Removed the private flag _isHandlingPopup and implemented a new method _handlePopup to manage popup windows more effectively. - Improved the logic for detecting and converting popups to tabs, ensuring better handling of various popup scenarios. chore: increment package version to 0.0.29-13 in package.json chore: increment package version to 0.0.29-14 in package.json and remove redundant popup navigation wait in context.ts fix: improve download error handling in context.ts - Added error handling for download.saveAs to log any issues during the save process. - Ensured that entry.finished is set to true regardless of the success or failure of the download operation. feat: introduce everyTool export and update connection logic - Added everyTool export in tools.ts to combine snapshotTools and visionTools. - Updated createConnection function in connection.ts to use everyTool by default, with conditional logic for visionTools based on config.vision. chore: increment package version to 0.0.29-16 in package.json chore: increment package version to 0.0.29-17 in package.json fix: only include one version of each tool in `everyTool` feat: enhance popup event logging in context.ts - Added console logs to track popup events, including when a popup is received, if it is a valid popup window, and when it is closed. - Improved visibility into the popup handling process for better debugging and monitoring. chore: increment package version to 0.0.29-19 in package.json chore: increment package version to 0.0.29-20 in package.json and streamline popup handling in context.ts - Updated package version to 0.0.29-20 in package.json. - Simplified the popup handling logic by directly checking the created page for popups and logging relevant events. - Introduced a set of standard target names to improve the detection of popup windows. chore: increment package version to 0.0.29-21 in package.json and enhance popup detection logic in context.ts - Updated package version to 0.0.29-21 in package.json. - Improved the popup detection logic by adding additional indicators and checks for popup-like features, enhancing the accuracy of the `_isPopupWindow` method. chore: increment package version to 0.0.29-22 in package.json and refactor popup detection logic in context.ts - Updated package version to 0.0.29-22 in package.json. - Refactored the `_isPopupWindow` method to utilize a new `popupAnalysis` function for improved popup detection. - Enhanced the analysis process with additional checks and confidence scoring for better accuracy in identifying popup windows. fix: update type for reasons array and improve window resizability check in popup analysis - Changed the type of the `reasons` array to explicitly be an array of strings for better type safety. - Updated the check for window resizability to use a more explicit boolean expression. fix: add error logging for popup window detection in context.ts - Introduced console error logging to capture and report errors encountered during the popup window detection process, improving debugging capabilities. chore: increment package version to 0.0.29-23 in package.json chore: increment package version to 0.0.29-24 in package.json and refactor popup analysis to be asynchronous - Updated package version to 0.0.29-24 in package.json. - Refactored the `popupAnalysis` function to be asynchronous, allowing for better handling of page evaluations. - Updated the call to `popupAnalysis` in `context.ts` to await the result, improving the flow of popup detection. chore: increment package version to 0.0.29-25 in package.json and move THRESHOLD constant inside popupAnalysis function - Updated package version to 0.0.29-25 in package.json. - Moved the `THRESHOLD` constant inside the `popupAnalysis` function for better encapsulation and clarity. chore: increment package version to 0.0.29-26 in package.json chore: increment package version to 0.0.29-27 in package.json and add logging for popup URL in context.ts - Updated package version to 0.0.29-27 in package.json. - Added a console log to output the URL of the popup for better debugging and tracking of popup behavior. refactor: update popup handling to create a new page instead of a new tab in context.ts - Changed the logic to create a new page directly and navigate to the popup URL, improving the handling of popups. - Updated error handling to log navigation failures for better debugging. chore: increment package version to 0.0.29-29 in package.json and enhance error handling in context.ts - Updated package version to 0.0.29-29 in package.json. - Improved error handling for popup management in context.ts, including timeout handling for URL fetching and enhanced logging for better debugging. refactor: simplify popup URL fetching in context.ts - Removed timeout handling for fetching the popup URL, streamlining the process. - Enhanced logging to output the fetched popup URL for better debugging. chore: increment package version to 0.0.29-31 in package.json and ensure popup page loads before fetching URL in context.ts - Updated package version to 0.0.29-31 in package.json. - Added a wait for the "domcontentloaded" state before fetching the popup URL in context.ts to improve reliability. chore: increment package version to 0.0.29-32 in package.json and enhance popup URL retrieval logic in context.ts - Updated package version to 0.0.29-32 in package.json. - Improved the logic for fetching the popup URL in context.ts with retry attempts and error handling to ensure reliability. refactor: enhance popup handling logic in context.ts - Updated _handlePopup method to return a boolean indicating if a popup was handled. - Improved error handling and logging for popup URL retrieval and closing popups. - Streamlined the logic to avoid unnecessary tab additions when a popup is detected. refactor: improve popup URL retrieval with retry logic in context.ts - Enhanced the _handlePopup method to implement a retry mechanism for fetching the popup URL, allowing up to three attempts. - Improved error handling and logging during the URL retrieval process. - Adjusted return values to better reflect the success of popup handling. chore: increment package version to 0.0.29-35 in package.json and extend timeout for popup URL fetching in context.ts - Updated package version to 0.0.29-35 in package.json. - Increased the timeout duration for waiting on popup URL resolution from 1500ms to 2500ms in context.ts to improve reliability. chore: increment package version to 0.0.29-36 in package.json and adjust timeout for popup URL fetching in context.ts - Updated package version to 0.0.29-36 in package.json. - Increased the timeout duration for waiting on popup URL resolution from 2500ms to 3000ms in context.ts to enhance reliability. - Ensured that the current tab is always switched to the newly created tab in context.ts. chore: increment package version to 0.0.29-37 in package.json and extend timeout for popup URL fetching in context.ts - Updated package version to 0.0.29-37 in package.json. - Increased the timeout duration for waiting on popup URL resolution from 3000ms to 4000ms in context.ts to enhance reliability. chore: increment package version to 0.0.29-38 in package.json and improve context closure handling in context.ts - Updated package version to 0.0.29-38 in package.json. - Enhanced the logic in context.ts to log a message and handle errors when closing the context if no tabs are left, improving robustness. chore: increment package version to 0.0.29-39 in package.json and refine context closure handling in context.ts - Updated package version to 0.0.29-39 in package.json. - Simplified the context closure logic in context.ts to use a promise-based approach for error handling, improving code clarity and robustness. refactor: implement retry logic for dialog handling in dialogs.ts - Added a retry mechanism to the dialog handling process, allowing up to three attempts to accept or dismiss the dialog, improving robustness against transient errors. - Ensured that the dialog state is always cleared after handling, regardless of success or failure. chore: add .prettierignore and standardize import quotes in TypeScript files - Introduced a .prettierignore file to exclude all files from formatting. - Standardized import statements across TypeScript files to use single quotes for consistency. - Updated package name in package-lock.json and README.md to reflect the new naming convention. - Enhanced linting script in package.json to automatically fix issues during linting. refactor: comment out console error and log statements in context.ts and dialogs.ts - Commented out various console log and error statements in context.ts to reduce noise during execution. - Updated dialog handling in dialogs.ts by commenting out the error logging to streamline the process. chore(extension): support reconnect, implement relay-extension protocol (microsoft#602) chore(extension): convert to typescript (microsoft#603) chore(extension): wrap CDP protocol (microsoft#604) fix(docs): Fix typo of windsurf in readme (microsoft#620) devops(docker): enhance Docker image publishing with ORAS end-of-life tagging (microsoft#641) This tags the images we publish as EOL immediately in order to get excluded from the image scanning. Like we do upstream in microsoft/playwright. docs: adding installation steps for Gemini CLI (microsoft#625) I just tried it out with Gemini CLI and it works like a charm, thanks for creating this MCP server! docs: add instructions to install in Goose (microsoft#580) docs: Update README about imageResponses option. (microsoft#646) feat(dblclick): add double click (microsoft#654) Fixes microsoft#652 chore: update to 1.54.0 (microsoft#653) Closes microsoft#535 chore: roll Playwright to 1.54.1 (microsoft#665) chore: remove extension code (microsoft#667) chore: mark v0.0.30 (microsoft#666) chore: migrate to locator._resolveSelector (microsoft#670) chore: include page errors in console messages (microsoft#671) Fixes microsoft#669 chore: make tab indexes 0-based (microsoft#674) Fixes microsoft#570 chore: resolve dialog races (microsoft#673) Fixes microsoft#595 chore: remove generate_test tool for now - it adds no value (microsoft#675) chore: introduce browser_evaluate (microsoft#678) Fixes microsoft#424 chore: turn vision into capability (microsoft#679) Fixes microsoft#420 chore: remove server experiment (microsoft#681) chore: remove image reply special case in cursor (microsoft#680) chore: sort install sections (microsoft#682) chore: mirror cli options w/ env vars (microsoft#685) Fixes microsoft#639 chore: allow right click (microsoft#687) Fixes microsoft#467 chore: include recent console logs in results (microsoft#689) chore: mark v0.0.31 (microsoft#691) chore(docs): make VSCode match other README sections (microsoft#706) fix: no-sandbox flag logic to only disable sandbox when explicitly passed (microsoft#709) feat: add fullPage mode to browser_take_screenshot (microsoft#704) chore: add mcp chrome extension (microsoft#710) chore: add GitHub Copilot agent YAML specification (microsoft#715) chore: use streamable http by default (microsoft#716) Co-authored-by: Copilot <[email protected]> chore(extension): support running in http mode (microsoft#717) Add test for browser_evaluate error handling (microsoft#719) fix: browser_take_screenshot to not require snapshot unless element is specified (microsoft#725) chore: align lint w/ playwright (microsoft#729) chore(extension): find installed chrome (microsoft#728) chore: move state to tab, do not cache snapshot (microsoft#730) chore(extension): propagate errors to the client (microsoft#736) chore(extension): handle root session id in the relay (microsoft#737) chore: introduce response type (microsoft#738) chore: follow up on tab snapshot capture (microsoft#739) chore: save session log (microsoft#740) chore(extension): terminate all connections when tab closes (microsoft#741) docs: Add LM Studio installation instructions (microsoft#688) chore: add eval script (microsoft#743) chore: do not double close connection (microsoft#744) chore: unify loops (microsoft#745) chore: one tool experiment (microsoft#746) chore(extension): use free port (microsoft#735) chore(extension): page selector for MCP (microsoft#750) chore: extract pure mcp server helpers (microsoft#751) chore: wire one tool in-process (microsoft#753) chore(extension): exit gracefully when waiting for extension connection (microsoft#754) chore: extract loop tools into a separate folder (microsoft#755) chore: retain the source code from the underlying tools (microsoft#756) chore: recommend sse by default (microsoft#758) chore: ping client and disconnect on connection termination (microsoft#764) Revert "chore: recommend sse by default" (microsoft#765) Reverts microsoft#758 Sounds like the stock streamable implementation is to spec, so we can keep it. chore(extension): reject second http connection (microsoft#766) chore: do not snapshot on fill (microsoft#767) chore: mark v0.0.32 (microsoft#768) chore(extension): use react for connect dialog (microsoft#777) chore(extension): use separate package.json (microsoft#778) chore(extension): do not show chrome: tabs (microsoft#780) chore: parse response in tests (microsoft#796) chore: record user actions in the session log (microsoft#798) chore: make tab snapshot structured to mimic it in recorder (microsoft#799) chore: use pngs by default for screenshots (microsoft#797) 1. Use PNG by default. 1. Increase JPG quality from `50` -> `90`. chore: serialize session entries for tool calls and user actions (microsoft#803) chore(extension): bind relay lifetime to browser context (microsoft#804) chore: refactor initialize (microsoft#812) chore: slice profile dirs by root in vscode (microsoft#814) chore: allow to switch between browser connection methods (microsoft#815) chore(extension): terminate connection on debugger detach (microsoft#816) chore: follow up with win test fix (microsoft#818) chore(extension): build into dist directory (microsoft#825) fix: cursor does not respond to listRoots (microsoft#826) chore(extension): create relay per context (microsoft#828) chore(extension): terminate connection if nothing has been selected (microsoft#827) chore(extension): do not send if socket is already closed (microsoft#834) * Remove debugger listeners if closed() is called as `ws.onclosed` is dispatched asynchronously * Tabs can be closed while update badge command is in flight * Inflight CDP commands fail if the tab closes, do not try to send their response to a closed socket chore(extension): proper watchdog for inactive page selector (microsoft#835) chore(extension): show error when connection is rejected due to inact… (microsoft#836) …ivity chore(extension): add test (microsoft#842) * On Linux headed mode under xvfb-run fails to properly launch the process. It works fine without xvfb-run, we don't have environment for that on CI, so run on macOS instead. * Node v18.20.8 stalls on `const uuid = crypto.randomUUID();`, so use v20 for the extension tests. devops: switch to node 20 on CI (microsoft#844) Node 18 maintanence period ended in April 2025. Running on 18 already caused a problem in microsoft#842 chore(extension): explicitly detach from debugger when connection closes (microsoft#847) chore(extension): connect button for each page, style tweaks (microsoft#848) <img width="643" height="709" alt="image" src="https://github.com/user-attachments/assets/850f2455-b853-4c0f-8047-a7f2ced16b7b" /> fix(docs): Invalid MCP Install Link (microsoft#846) chore: do not return fullPage screenshots to the LLM (microsoft#849) chore: roll Playwright to recent (microsoft#850) chore: mark 0.0.33 (microsoft#851) chore(extension): status page (microsoft#856) fix: emit code for waitfor (microsoft#862) Fixes microsoft#859 chore: bump test workers to 2 on CI (microsoft#863) chore: mcp backend switcher (microsoft#854) chore: introduce check-deps (microsoft#864) fix(proxy): properly forward root requests and client metadata (microsoft#865) fix: backtick quote escaping (microsoft#871) chore: tool definition without zod (microsoft#873) chore: roll Playwright to latest (microsoft#875) chore: run test server per context (microsoft#874) Fixes microsoft#869 chore: extract utils folder (microsoft#876) chore: separate proxy client from external (microsoft#877) chore: steer towards mcp types a bit (microsoft#880) fix: wait for initialization to complete before listing tools (microsoft#886) chore: move tool schema to mcp as it is used by all servers (microsoft#887) chore: close all clients in fixture (microsoft#878) docs: add opencode installation instructions (microsoft#895) chore(extension): add readme file, recommend --extension option (microsoft#894) chore(extension): connection timeout when extension not installed (microsoft#896) chore: try macos15 runners (microsoft#892) devops: extension publishing job (microsoft#888) chore: handle list roots in the server, with timeout (microsoft#898) chore(extension): connected badge while loading (microsoft#899) devops: set-version.js script (microsoft#902) chore: fix copyright (microsoft#903) devops: update extension manifest version (microsoft#904) chore: mark 0.0.34 (microsoft#901) chore: do not wrap mcp in proxy by default, drive-by deps fix (microsoft#909) chore: check extension version on connect (microsoft#907) chore: check version in page, link to instructions (microsoft#918) chore(vscode): add vscode mcp factory (microsoft#868) docs: add instructions for installation in openai codex (microsoft#927) chore: show download link on the status mismatch page (microsoft#928) <img width="610" height="108" alt="image" src="https://github.com/user-attachments/assets/bc1f7534-f282-44f0-bb58-e385b2bf82af" /> chore(extension): do not show tab selector for browser_navigate (microsoft#923) chore: mdb stub (microsoft#912) chore: merge tabs tool into one (microsoft#933) chore: remove navigate_forward due to low usage counts (microsoft#934) chore: introduce form filling tool (microsoft#935) chore(extension): do not complain about old extension version (microsoft#937) chore: mark v0.0.35 (microsoft#938) chore: version extension-relay protocol (microsoft#939) chore(extension): support custom executablePath (microsoft#947) Fixes microsoft#941 chore: introduce verification tools (microsoft#951) chore: update README and extension background script - Removed deprecated arguments from README: `--extension` and `--save-session`. - Added new tab management functions to README: `browser_tab_close`, `browser_tab_list`, `browser_tab_new`, and `browser_tab_select`. - Updated background script to handle connection timeout more efficiently by using `void` with `chrome.tabs.sendMessage`. chore: update version and enhance README - Updated package and lock file versions to 0.0.35-0. - Added new arguments to README: `--extension` for connecting to a running browser instance and `--save-session` for saving the Playwright MCP session. - Revised screenshot parameters in README to clarify image format options. - Consolidated tab management functions in README under `browser_tabs`. feat: enhance connection handling in BrowserServerBackend - Added a new method `getContext` to retrieve the context from `BrowserServerBackend`, ensuring it is initialized. - Updated `createConnection` to return both the server and the context, improving the connection interface. chore: update version to 0.0.35-3 and refactor server creation - Incremented package version to 0.0.35-3 in package.json. - Refactored server creation in multiple files to use async/await for better handling of asynchronous operations, ensuring that server instances are fully initialized before use. chore: update version to 0.0.35-4 and improve tab selection error handling - Incremented package version to 0.0.35-4 in package.json. - Enhanced error handling in tab selection by checking for undefined index in tabs.ts. feat: enhance connection handling in BrowserServerBackend - Added `getContext` method to retrieve the context from `BrowserServerBackend`, ensuring it is initialized. - Updated `createConnection` to return both the server and the context, improving the connection interface. - Refactored server creation to use async/await for better handling of asynchronous operations. fix: improve error handling for tab selection in tabs.ts - Updated the tab selection logic to explicitly check for undefined index, ensuring that a valid tab index is provided before proceeding. This change enhances error reporting and prevents potential runtime issues.
Edward-Upton
added a commit
to asteroidai/playwright-mcp
that referenced
this pull request
Aug 26, 2025
feat: enhance Connection type with context and improve createConnection signature - Added context property to the Connection type for better state management. - Reformatted createConnection function signature for improved readability. chore: update package version to 0.0.29-1 fix: update import path for Context and adjust package name in package-lock.json - Changed import path for Context from "./lib/context.js" to "./src/context.ts". - Updated package name in package-lock.json to "@asteroid_ai/playwright-mcp". chore: set package as non-private - Updated package.json to set "private" to false, allowing for potential publishing. chore: update package name to remove scope - Changed package name from "@asteroid_ai/playwright-mcp" to "asteroid-playwright-mcp" in package.json. chore: update import path for Context and increment package version - Changed import path for Context from "./src/context.ts" to "./lib/context.js". - Incremented package version to 0.0.29-2 in package.json. chore: update import path for Context and increment package version - Changed import path for Context from "./lib/context.js" to "./lib/context.d.ts". - Incremented package version to 0.0.29-3 in package.json. chore: update import paths and increment package version - Changed import path for Context from "./lib/context.d.ts" to "./src/context.js". - Added import for Tab from "./src/tab.js". - Incremented package version to 0.0.29-4 in package.json. - Removed "declaration" option from tsconfig.json. feat: add context and tab type definitions - Introduced new type definitions for Context and Tab in context.d.ts and tab.d.ts respectively. - Updated import paths in index.d.ts to reflect the new file structure. - Enhanced type safety and modularity for better code organization. chore: update package version to 0.0.29-6 and include additional type definitions - Incremented package version to 0.0.29-6 in package.json. - Added context.d.ts and tab.d.ts to .npmignore exceptions for better type definition management. chore: increment package version to 0.0.29-7 and refactor context.ts for improved readability - Updated package version to 0.0.29-7 in package.json. - Refactored code in context.ts for better readability, including consistent formatting and improved handling of popups. chore: increment package version to 0.0.29-8 and enhance context.ts for async handling - Updated package version to 0.0.29-8 in package.json. - Improved async handling in context.ts by awaiting page creation and popup handling for better reliability. chore: increment package version to 0.0.29-9 and simplify page creation handling in context.ts - Updated package version to 0.0.29-9 in package.json. - Simplified the page creation logic in context.ts by removing unnecessary popup handling checks. Revert "chore: increment package version to 0.0.29-9 and simplify page creation handling in context.ts" This reverts commit fff3d31. Revert "chore: increment package version to 0.0.29-7 and refactor context.ts for improved readability" This reverts commit 33033cf. chore: increment package version to 0.0.29-10 in package.json fix: enhance popup handling in context.ts - Added a private flag _isHandlingPopup to manage popup state. - Updated _onPageCreated to handle popups asynchronously and convert them to tabs when detected. - Ensured proper handling of popup state during conversion to maintain tab integrity. chore: increment package version to 0.0.29-11 in package.json chore: increment package version to 0.0.29-12 in package.json and enhance popup handling in context.ts - Updated package version to 0.0.29-12 in package.json. - Removed the private flag _isHandlingPopup and implemented a new method _handlePopup to manage popup windows more effectively. - Improved the logic for detecting and converting popups to tabs, ensuring better handling of various popup scenarios. chore: increment package version to 0.0.29-13 in package.json chore: increment package version to 0.0.29-14 in package.json and remove redundant popup navigation wait in context.ts fix: improve download error handling in context.ts - Added error handling for download.saveAs to log any issues during the save process. - Ensured that entry.finished is set to true regardless of the success or failure of the download operation. feat: introduce everyTool export and update connection logic - Added everyTool export in tools.ts to combine snapshotTools and visionTools. - Updated createConnection function in connection.ts to use everyTool by default, with conditional logic for visionTools based on config.vision. chore: increment package version to 0.0.29-16 in package.json chore: increment package version to 0.0.29-17 in package.json fix: only include one version of each tool in `everyTool` feat: enhance popup event logging in context.ts - Added console logs to track popup events, including when a popup is received, if it is a valid popup window, and when it is closed. - Improved visibility into the popup handling process for better debugging and monitoring. chore: increment package version to 0.0.29-19 in package.json chore: increment package version to 0.0.29-20 in package.json and streamline popup handling in context.ts - Updated package version to 0.0.29-20 in package.json. - Simplified the popup handling logic by directly checking the created page for popups and logging relevant events. - Introduced a set of standard target names to improve the detection of popup windows. chore: increment package version to 0.0.29-21 in package.json and enhance popup detection logic in context.ts - Updated package version to 0.0.29-21 in package.json. - Improved the popup detection logic by adding additional indicators and checks for popup-like features, enhancing the accuracy of the `_isPopupWindow` method. chore: increment package version to 0.0.29-22 in package.json and refactor popup detection logic in context.ts - Updated package version to 0.0.29-22 in package.json. - Refactored the `_isPopupWindow` method to utilize a new `popupAnalysis` function for improved popup detection. - Enhanced the analysis process with additional checks and confidence scoring for better accuracy in identifying popup windows. fix: update type for reasons array and improve window resizability check in popup analysis - Changed the type of the `reasons` array to explicitly be an array of strings for better type safety. - Updated the check for window resizability to use a more explicit boolean expression. fix: add error logging for popup window detection in context.ts - Introduced console error logging to capture and report errors encountered during the popup window detection process, improving debugging capabilities. chore: increment package version to 0.0.29-23 in package.json chore: increment package version to 0.0.29-24 in package.json and refactor popup analysis to be asynchronous - Updated package version to 0.0.29-24 in package.json. - Refactored the `popupAnalysis` function to be asynchronous, allowing for better handling of page evaluations. - Updated the call to `popupAnalysis` in `context.ts` to await the result, improving the flow of popup detection. chore: increment package version to 0.0.29-25 in package.json and move THRESHOLD constant inside popupAnalysis function - Updated package version to 0.0.29-25 in package.json. - Moved the `THRESHOLD` constant inside the `popupAnalysis` function for better encapsulation and clarity. chore: increment package version to 0.0.29-26 in package.json chore: increment package version to 0.0.29-27 in package.json and add logging for popup URL in context.ts - Updated package version to 0.0.29-27 in package.json. - Added a console log to output the URL of the popup for better debugging and tracking of popup behavior. refactor: update popup handling to create a new page instead of a new tab in context.ts - Changed the logic to create a new page directly and navigate to the popup URL, improving the handling of popups. - Updated error handling to log navigation failures for better debugging. chore: increment package version to 0.0.29-29 in package.json and enhance error handling in context.ts - Updated package version to 0.0.29-29 in package.json. - Improved error handling for popup management in context.ts, including timeout handling for URL fetching and enhanced logging for better debugging. refactor: simplify popup URL fetching in context.ts - Removed timeout handling for fetching the popup URL, streamlining the process. - Enhanced logging to output the fetched popup URL for better debugging. chore: increment package version to 0.0.29-31 in package.json and ensure popup page loads before fetching URL in context.ts - Updated package version to 0.0.29-31 in package.json. - Added a wait for the "domcontentloaded" state before fetching the popup URL in context.ts to improve reliability. chore: increment package version to 0.0.29-32 in package.json and enhance popup URL retrieval logic in context.ts - Updated package version to 0.0.29-32 in package.json. - Improved the logic for fetching the popup URL in context.ts with retry attempts and error handling to ensure reliability. refactor: enhance popup handling logic in context.ts - Updated _handlePopup method to return a boolean indicating if a popup was handled. - Improved error handling and logging for popup URL retrieval and closing popups. - Streamlined the logic to avoid unnecessary tab additions when a popup is detected. refactor: improve popup URL retrieval with retry logic in context.ts - Enhanced the _handlePopup method to implement a retry mechanism for fetching the popup URL, allowing up to three attempts. - Improved error handling and logging during the URL retrieval process. - Adjusted return values to better reflect the success of popup handling. chore: increment package version to 0.0.29-35 in package.json and extend timeout for popup URL fetching in context.ts - Updated package version to 0.0.29-35 in package.json. - Increased the timeout duration for waiting on popup URL resolution from 1500ms to 2500ms in context.ts to improve reliability. chore: increment package version to 0.0.29-36 in package.json and adjust timeout for popup URL fetching in context.ts - Updated package version to 0.0.29-36 in package.json. - Increased the timeout duration for waiting on popup URL resolution from 2500ms to 3000ms in context.ts to enhance reliability. - Ensured that the current tab is always switched to the newly created tab in context.ts. chore: increment package version to 0.0.29-37 in package.json and extend timeout for popup URL fetching in context.ts - Updated package version to 0.0.29-37 in package.json. - Increased the timeout duration for waiting on popup URL resolution from 3000ms to 4000ms in context.ts to enhance reliability. chore: increment package version to 0.0.29-38 in package.json and improve context closure handling in context.ts - Updated package version to 0.0.29-38 in package.json. - Enhanced the logic in context.ts to log a message and handle errors when closing the context if no tabs are left, improving robustness. chore: increment package version to 0.0.29-39 in package.json and refine context closure handling in context.ts - Updated package version to 0.0.29-39 in package.json. - Simplified the context closure logic in context.ts to use a promise-based approach for error handling, improving code clarity and robustness. refactor: implement retry logic for dialog handling in dialogs.ts - Added a retry mechanism to the dialog handling process, allowing up to three attempts to accept or dismiss the dialog, improving robustness against transient errors. - Ensured that the dialog state is always cleared after handling, regardless of success or failure. chore: add .prettierignore and standardize import quotes in TypeScript files - Introduced a .prettierignore file to exclude all files from formatting. - Standardized import statements across TypeScript files to use single quotes for consistency. - Updated package name in package-lock.json and README.md to reflect the new naming convention. - Enhanced linting script in package.json to automatically fix issues during linting. refactor: comment out console error and log statements in context.ts and dialogs.ts - Commented out various console log and error statements in context.ts to reduce noise during execution. - Updated dialog handling in dialogs.ts by commenting out the error logging to streamline the process. chore(extension): support reconnect, implement relay-extension protocol (microsoft#602) chore(extension): convert to typescript (microsoft#603) chore(extension): wrap CDP protocol (microsoft#604) fix(docs): Fix typo of windsurf in readme (microsoft#620) devops(docker): enhance Docker image publishing with ORAS end-of-life tagging (microsoft#641) This tags the images we publish as EOL immediately in order to get excluded from the image scanning. Like we do upstream in microsoft/playwright. docs: adding installation steps for Gemini CLI (microsoft#625) I just tried it out with Gemini CLI and it works like a charm, thanks for creating this MCP server! docs: add instructions to install in Goose (microsoft#580) docs: Update README about imageResponses option. (microsoft#646) feat(dblclick): add double click (microsoft#654) Fixes microsoft#652 chore: update to 1.54.0 (microsoft#653) Closes microsoft#535 chore: roll Playwright to 1.54.1 (microsoft#665) chore: remove extension code (microsoft#667) chore: mark v0.0.30 (microsoft#666) chore: migrate to locator._resolveSelector (microsoft#670) chore: include page errors in console messages (microsoft#671) Fixes microsoft#669 chore: make tab indexes 0-based (microsoft#674) Fixes microsoft#570 chore: resolve dialog races (microsoft#673) Fixes microsoft#595 chore: remove generate_test tool for now - it adds no value (microsoft#675) chore: introduce browser_evaluate (microsoft#678) Fixes microsoft#424 chore: turn vision into capability (microsoft#679) Fixes microsoft#420 chore: remove server experiment (microsoft#681) chore: remove image reply special case in cursor (microsoft#680) chore: sort install sections (microsoft#682) chore: mirror cli options w/ env vars (microsoft#685) Fixes microsoft#639 chore: allow right click (microsoft#687) Fixes microsoft#467 chore: include recent console logs in results (microsoft#689) chore: mark v0.0.31 (microsoft#691) chore(docs): make VSCode match other README sections (microsoft#706) fix: no-sandbox flag logic to only disable sandbox when explicitly passed (microsoft#709) feat: add fullPage mode to browser_take_screenshot (microsoft#704) chore: add mcp chrome extension (microsoft#710) chore: add GitHub Copilot agent YAML specification (microsoft#715) chore: use streamable http by default (microsoft#716) Co-authored-by: Copilot <[email protected]> chore(extension): support running in http mode (microsoft#717) Add test for browser_evaluate error handling (microsoft#719) fix: browser_take_screenshot to not require snapshot unless element is specified (microsoft#725) chore: align lint w/ playwright (microsoft#729) chore(extension): find installed chrome (microsoft#728) chore: move state to tab, do not cache snapshot (microsoft#730) chore(extension): propagate errors to the client (microsoft#736) chore(extension): handle root session id in the relay (microsoft#737) chore: introduce response type (microsoft#738) chore: follow up on tab snapshot capture (microsoft#739) chore: save session log (microsoft#740) chore(extension): terminate all connections when tab closes (microsoft#741) docs: Add LM Studio installation instructions (microsoft#688) chore: add eval script (microsoft#743) chore: do not double close connection (microsoft#744) chore: unify loops (microsoft#745) chore: one tool experiment (microsoft#746) chore(extension): use free port (microsoft#735) chore(extension): page selector for MCP (microsoft#750) chore: extract pure mcp server helpers (microsoft#751) chore: wire one tool in-process (microsoft#753) chore(extension): exit gracefully when waiting for extension connection (microsoft#754) chore: extract loop tools into a separate folder (microsoft#755) chore: retain the source code from the underlying tools (microsoft#756) chore: recommend sse by default (microsoft#758) chore: ping client and disconnect on connection termination (microsoft#764) Revert "chore: recommend sse by default" (microsoft#765) Reverts microsoft#758 Sounds like the stock streamable implementation is to spec, so we can keep it. chore(extension): reject second http connection (microsoft#766) chore: do not snapshot on fill (microsoft#767) chore: mark v0.0.32 (microsoft#768) chore(extension): use react for connect dialog (microsoft#777) chore(extension): use separate package.json (microsoft#778) chore(extension): do not show chrome: tabs (microsoft#780) chore: parse response in tests (microsoft#796) chore: record user actions in the session log (microsoft#798) chore: make tab snapshot structured to mimic it in recorder (microsoft#799) chore: use pngs by default for screenshots (microsoft#797) 1. Use PNG by default. 1. Increase JPG quality from `50` -> `90`. chore: serialize session entries for tool calls and user actions (microsoft#803) chore(extension): bind relay lifetime to browser context (microsoft#804) chore: refactor initialize (microsoft#812) chore: slice profile dirs by root in vscode (microsoft#814) chore: allow to switch between browser connection methods (microsoft#815) chore(extension): terminate connection on debugger detach (microsoft#816) chore: follow up with win test fix (microsoft#818) chore(extension): build into dist directory (microsoft#825) fix: cursor does not respond to listRoots (microsoft#826) chore(extension): create relay per context (microsoft#828) chore(extension): terminate connection if nothing has been selected (microsoft#827) chore(extension): do not send if socket is already closed (microsoft#834) * Remove debugger listeners if closed() is called as `ws.onclosed` is dispatched asynchronously * Tabs can be closed while update badge command is in flight * Inflight CDP commands fail if the tab closes, do not try to send their response to a closed socket chore(extension): proper watchdog for inactive page selector (microsoft#835) chore(extension): show error when connection is rejected due to inact… (microsoft#836) …ivity chore(extension): add test (microsoft#842) * On Linux headed mode under xvfb-run fails to properly launch the process. It works fine without xvfb-run, we don't have environment for that on CI, so run on macOS instead. * Node v18.20.8 stalls on `const uuid = crypto.randomUUID();`, so use v20 for the extension tests. devops: switch to node 20 on CI (microsoft#844) Node 18 maintanence period ended in April 2025. Running on 18 already caused a problem in microsoft#842 chore(extension): explicitly detach from debugger when connection closes (microsoft#847) chore(extension): connect button for each page, style tweaks (microsoft#848) <img width="643" height="709" alt="image" src="https://github.com/user-attachments/assets/850f2455-b853-4c0f-8047-a7f2ced16b7b" /> fix(docs): Invalid MCP Install Link (microsoft#846) chore: do not return fullPage screenshots to the LLM (microsoft#849) chore: roll Playwright to recent (microsoft#850) chore: mark 0.0.33 (microsoft#851) chore(extension): status page (microsoft#856) fix: emit code for waitfor (microsoft#862) Fixes microsoft#859 chore: bump test workers to 2 on CI (microsoft#863) chore: mcp backend switcher (microsoft#854) chore: introduce check-deps (microsoft#864) fix(proxy): properly forward root requests and client metadata (microsoft#865) fix: backtick quote escaping (microsoft#871) chore: tool definition without zod (microsoft#873) chore: roll Playwright to latest (microsoft#875) chore: run test server per context (microsoft#874) Fixes microsoft#869 chore: extract utils folder (microsoft#876) chore: separate proxy client from external (microsoft#877) chore: steer towards mcp types a bit (microsoft#880) fix: wait for initialization to complete before listing tools (microsoft#886) chore: move tool schema to mcp as it is used by all servers (microsoft#887) chore: close all clients in fixture (microsoft#878) docs: add opencode installation instructions (microsoft#895) chore(extension): add readme file, recommend --extension option (microsoft#894) chore(extension): connection timeout when extension not installed (microsoft#896) chore: try macos15 runners (microsoft#892) devops: extension publishing job (microsoft#888) chore: handle list roots in the server, with timeout (microsoft#898) chore(extension): connected badge while loading (microsoft#899) devops: set-version.js script (microsoft#902) chore: fix copyright (microsoft#903) devops: update extension manifest version (microsoft#904) chore: mark 0.0.34 (microsoft#901) chore: do not wrap mcp in proxy by default, drive-by deps fix (microsoft#909) chore: check extension version on connect (microsoft#907) chore: check version in page, link to instructions (microsoft#918) chore(vscode): add vscode mcp factory (microsoft#868) docs: add instructions for installation in openai codex (microsoft#927) chore: show download link on the status mismatch page (microsoft#928) <img width="610" height="108" alt="image" src="https://github.com/user-attachments/assets/bc1f7534-f282-44f0-bb58-e385b2bf82af" /> chore(extension): do not show tab selector for browser_navigate (microsoft#923) chore: mdb stub (microsoft#912) chore: merge tabs tool into one (microsoft#933) chore: remove navigate_forward due to low usage counts (microsoft#934) chore: introduce form filling tool (microsoft#935) chore(extension): do not complain about old extension version (microsoft#937) chore: mark v0.0.35 (microsoft#938) chore: version extension-relay protocol (microsoft#939) chore(extension): support custom executablePath (microsoft#947) Fixes microsoft#941 chore: introduce verification tools (microsoft#951) chore: update README and extension background script - Removed deprecated arguments from README: `--extension` and `--save-session`. - Added new tab management functions to README: `browser_tab_close`, `browser_tab_list`, `browser_tab_new`, and `browser_tab_select`. - Updated background script to handle connection timeout more efficiently by using `void` with `chrome.tabs.sendMessage`. chore: update version and enhance README - Updated package and lock file versions to 0.0.35-0. - Added new arguments to README: `--extension` for connecting to a running browser instance and `--save-session` for saving the Playwright MCP session. - Revised screenshot parameters in README to clarify image format options. - Consolidated tab management functions in README under `browser_tabs`. feat: enhance connection handling in BrowserServerBackend - Added a new method `getContext` to retrieve the context from `BrowserServerBackend`, ensuring it is initialized. - Updated `createConnection` to return both the server and the context, improving the connection interface. chore: update version to 0.0.35-3 and refactor server creation - Incremented package version to 0.0.35-3 in package.json. - Refactored server creation in multiple files to use async/await for better handling of asynchronous operations, ensuring that server instances are fully initialized before use. chore: update version to 0.0.35-4 and improve tab selection error handling - Incremented package version to 0.0.35-4 in package.json. - Enhanced error handling in tab selection by checking for undefined index in tabs.ts. feat: enhance connection handling in BrowserServerBackend - Added `getContext` method to retrieve the context from `BrowserServerBackend`, ensuring it is initialized. - Updated `createConnection` to return both the server and the context, improving the connection interface. - Refactored server creation to use async/await for better handling of asynchronous operations. fix: improve error handling for tab selection in tabs.ts - Updated the tab selection logic to explicitly check for undefined index, ensuring that a valid tab index is provided before proceeding. This change enhances error reporting and prevents potential runtime issues.
Edward-Upton
added a commit
to asteroidai/playwright-mcp
that referenced
this pull request
Aug 26, 2025
feat: enhance Connection type with context and improve createConnection signature - Added context property to the Connection type for better state management. - Reformatted createConnection function signature for improved readability. chore: update package version to 0.0.29-1 fix: update import path for Context and adjust package name in package-lock.json - Changed import path for Context from "./lib/context.js" to "./src/context.ts". - Updated package name in package-lock.json to "@asteroid_ai/playwright-mcp". chore: set package as non-private - Updated package.json to set "private" to false, allowing for potential publishing. chore: update package name to remove scope - Changed package name from "@asteroid_ai/playwright-mcp" to "asteroid-playwright-mcp" in package.json. chore: update import path for Context and increment package version - Changed import path for Context from "./src/context.ts" to "./lib/context.js". - Incremented package version to 0.0.29-2 in package.json. chore: update import path for Context and increment package version - Changed import path for Context from "./lib/context.js" to "./lib/context.d.ts". - Incremented package version to 0.0.29-3 in package.json. chore: update import paths and increment package version - Changed import path for Context from "./lib/context.d.ts" to "./src/context.js". - Added import for Tab from "./src/tab.js". - Incremented package version to 0.0.29-4 in package.json. - Removed "declaration" option from tsconfig.json. feat: add context and tab type definitions - Introduced new type definitions for Context and Tab in context.d.ts and tab.d.ts respectively. - Updated import paths in index.d.ts to reflect the new file structure. - Enhanced type safety and modularity for better code organization. chore: update package version to 0.0.29-6 and include additional type definitions - Incremented package version to 0.0.29-6 in package.json. - Added context.d.ts and tab.d.ts to .npmignore exceptions for better type definition management. chore: increment package version to 0.0.29-7 and refactor context.ts for improved readability - Updated package version to 0.0.29-7 in package.json. - Refactored code in context.ts for better readability, including consistent formatting and improved handling of popups. chore: increment package version to 0.0.29-8 and enhance context.ts for async handling - Updated package version to 0.0.29-8 in package.json. - Improved async handling in context.ts by awaiting page creation and popup handling for better reliability. chore: increment package version to 0.0.29-9 and simplify page creation handling in context.ts - Updated package version to 0.0.29-9 in package.json. - Simplified the page creation logic in context.ts by removing unnecessary popup handling checks. Revert "chore: increment package version to 0.0.29-9 and simplify page creation handling in context.ts" This reverts commit fff3d31. Revert "chore: increment package version to 0.0.29-7 and refactor context.ts for improved readability" This reverts commit 33033cf. chore: increment package version to 0.0.29-10 in package.json fix: enhance popup handling in context.ts - Added a private flag _isHandlingPopup to manage popup state. - Updated _onPageCreated to handle popups asynchronously and convert them to tabs when detected. - Ensured proper handling of popup state during conversion to maintain tab integrity. chore: increment package version to 0.0.29-11 in package.json chore: increment package version to 0.0.29-12 in package.json and enhance popup handling in context.ts - Updated package version to 0.0.29-12 in package.json. - Removed the private flag _isHandlingPopup and implemented a new method _handlePopup to manage popup windows more effectively. - Improved the logic for detecting and converting popups to tabs, ensuring better handling of various popup scenarios. chore: increment package version to 0.0.29-13 in package.json chore: increment package version to 0.0.29-14 in package.json and remove redundant popup navigation wait in context.ts fix: improve download error handling in context.ts - Added error handling for download.saveAs to log any issues during the save process. - Ensured that entry.finished is set to true regardless of the success or failure of the download operation. feat: introduce everyTool export and update connection logic - Added everyTool export in tools.ts to combine snapshotTools and visionTools. - Updated createConnection function in connection.ts to use everyTool by default, with conditional logic for visionTools based on config.vision. chore: increment package version to 0.0.29-16 in package.json chore: increment package version to 0.0.29-17 in package.json fix: only include one version of each tool in `everyTool` feat: enhance popup event logging in context.ts - Added console logs to track popup events, including when a popup is received, if it is a valid popup window, and when it is closed. - Improved visibility into the popup handling process for better debugging and monitoring. chore: increment package version to 0.0.29-19 in package.json chore: increment package version to 0.0.29-20 in package.json and streamline popup handling in context.ts - Updated package version to 0.0.29-20 in package.json. - Simplified the popup handling logic by directly checking the created page for popups and logging relevant events. - Introduced a set of standard target names to improve the detection of popup windows. chore: increment package version to 0.0.29-21 in package.json and enhance popup detection logic in context.ts - Updated package version to 0.0.29-21 in package.json. - Improved the popup detection logic by adding additional indicators and checks for popup-like features, enhancing the accuracy of the `_isPopupWindow` method. chore: increment package version to 0.0.29-22 in package.json and refactor popup detection logic in context.ts - Updated package version to 0.0.29-22 in package.json. - Refactored the `_isPopupWindow` method to utilize a new `popupAnalysis` function for improved popup detection. - Enhanced the analysis process with additional checks and confidence scoring for better accuracy in identifying popup windows. fix: update type for reasons array and improve window resizability check in popup analysis - Changed the type of the `reasons` array to explicitly be an array of strings for better type safety. - Updated the check for window resizability to use a more explicit boolean expression. fix: add error logging for popup window detection in context.ts - Introduced console error logging to capture and report errors encountered during the popup window detection process, improving debugging capabilities. chore: increment package version to 0.0.29-23 in package.json chore: increment package version to 0.0.29-24 in package.json and refactor popup analysis to be asynchronous - Updated package version to 0.0.29-24 in package.json. - Refactored the `popupAnalysis` function to be asynchronous, allowing for better handling of page evaluations. - Updated the call to `popupAnalysis` in `context.ts` to await the result, improving the flow of popup detection. chore: increment package version to 0.0.29-25 in package.json and move THRESHOLD constant inside popupAnalysis function - Updated package version to 0.0.29-25 in package.json. - Moved the `THRESHOLD` constant inside the `popupAnalysis` function for better encapsulation and clarity. chore: increment package version to 0.0.29-26 in package.json chore: increment package version to 0.0.29-27 in package.json and add logging for popup URL in context.ts - Updated package version to 0.0.29-27 in package.json. - Added a console log to output the URL of the popup for better debugging and tracking of popup behavior. refactor: update popup handling to create a new page instead of a new tab in context.ts - Changed the logic to create a new page directly and navigate to the popup URL, improving the handling of popups. - Updated error handling to log navigation failures for better debugging. chore: increment package version to 0.0.29-29 in package.json and enhance error handling in context.ts - Updated package version to 0.0.29-29 in package.json. - Improved error handling for popup management in context.ts, including timeout handling for URL fetching and enhanced logging for better debugging. refactor: simplify popup URL fetching in context.ts - Removed timeout handling for fetching the popup URL, streamlining the process. - Enhanced logging to output the fetched popup URL for better debugging. chore: increment package version to 0.0.29-31 in package.json and ensure popup page loads before fetching URL in context.ts - Updated package version to 0.0.29-31 in package.json. - Added a wait for the "domcontentloaded" state before fetching the popup URL in context.ts to improve reliability. chore: increment package version to 0.0.29-32 in package.json and enhance popup URL retrieval logic in context.ts - Updated package version to 0.0.29-32 in package.json. - Improved the logic for fetching the popup URL in context.ts with retry attempts and error handling to ensure reliability. refactor: enhance popup handling logic in context.ts - Updated _handlePopup method to return a boolean indicating if a popup was handled. - Improved error handling and logging for popup URL retrieval and closing popups. - Streamlined the logic to avoid unnecessary tab additions when a popup is detected. refactor: improve popup URL retrieval with retry logic in context.ts - Enhanced the _handlePopup method to implement a retry mechanism for fetching the popup URL, allowing up to three attempts. - Improved error handling and logging during the URL retrieval process. - Adjusted return values to better reflect the success of popup handling. chore: increment package version to 0.0.29-35 in package.json and extend timeout for popup URL fetching in context.ts - Updated package version to 0.0.29-35 in package.json. - Increased the timeout duration for waiting on popup URL resolution from 1500ms to 2500ms in context.ts to improve reliability. chore: increment package version to 0.0.29-36 in package.json and adjust timeout for popup URL fetching in context.ts - Updated package version to 0.0.29-36 in package.json. - Increased the timeout duration for waiting on popup URL resolution from 2500ms to 3000ms in context.ts to enhance reliability. - Ensured that the current tab is always switched to the newly created tab in context.ts. chore: increment package version to 0.0.29-37 in package.json and extend timeout for popup URL fetching in context.ts - Updated package version to 0.0.29-37 in package.json. - Increased the timeout duration for waiting on popup URL resolution from 3000ms to 4000ms in context.ts to enhance reliability. chore: increment package version to 0.0.29-38 in package.json and improve context closure handling in context.ts - Updated package version to 0.0.29-38 in package.json. - Enhanced the logic in context.ts to log a message and handle errors when closing the context if no tabs are left, improving robustness. chore: increment package version to 0.0.29-39 in package.json and refine context closure handling in context.ts - Updated package version to 0.0.29-39 in package.json. - Simplified the context closure logic in context.ts to use a promise-based approach for error handling, improving code clarity and robustness. refactor: implement retry logic for dialog handling in dialogs.ts - Added a retry mechanism to the dialog handling process, allowing up to three attempts to accept or dismiss the dialog, improving robustness against transient errors. - Ensured that the dialog state is always cleared after handling, regardless of success or failure. chore: add .prettierignore and standardize import quotes in TypeScript files - Introduced a .prettierignore file to exclude all files from formatting. - Standardized import statements across TypeScript files to use single quotes for consistency. - Updated package name in package-lock.json and README.md to reflect the new naming convention. - Enhanced linting script in package.json to automatically fix issues during linting. refactor: comment out console error and log statements in context.ts and dialogs.ts - Commented out various console log and error statements in context.ts to reduce noise during execution. - Updated dialog handling in dialogs.ts by commenting out the error logging to streamline the process. chore(extension): support reconnect, implement relay-extension protocol (microsoft#602) chore(extension): convert to typescript (microsoft#603) chore(extension): wrap CDP protocol (microsoft#604) fix(docs): Fix typo of windsurf in readme (microsoft#620) devops(docker): enhance Docker image publishing with ORAS end-of-life tagging (microsoft#641) This tags the images we publish as EOL immediately in order to get excluded from the image scanning. Like we do upstream in microsoft/playwright. docs: adding installation steps for Gemini CLI (microsoft#625) I just tried it out with Gemini CLI and it works like a charm, thanks for creating this MCP server! docs: add instructions to install in Goose (microsoft#580) docs: Update README about imageResponses option. (microsoft#646) feat(dblclick): add double click (microsoft#654) Fixes microsoft#652 chore: update to 1.54.0 (microsoft#653) Closes microsoft#535 chore: roll Playwright to 1.54.1 (microsoft#665) chore: remove extension code (microsoft#667) chore: mark v0.0.30 (microsoft#666) chore: migrate to locator._resolveSelector (microsoft#670) chore: include page errors in console messages (microsoft#671) Fixes microsoft#669 chore: make tab indexes 0-based (microsoft#674) Fixes microsoft#570 chore: resolve dialog races (microsoft#673) Fixes microsoft#595 chore: remove generate_test tool for now - it adds no value (microsoft#675) chore: introduce browser_evaluate (microsoft#678) Fixes microsoft#424 chore: turn vision into capability (microsoft#679) Fixes microsoft#420 chore: remove server experiment (microsoft#681) chore: remove image reply special case in cursor (microsoft#680) chore: sort install sections (microsoft#682) chore: mirror cli options w/ env vars (microsoft#685) Fixes microsoft#639 chore: allow right click (microsoft#687) Fixes microsoft#467 chore: include recent console logs in results (microsoft#689) chore: mark v0.0.31 (microsoft#691) chore(docs): make VSCode match other README sections (microsoft#706) fix: no-sandbox flag logic to only disable sandbox when explicitly passed (microsoft#709) feat: add fullPage mode to browser_take_screenshot (microsoft#704) chore: add mcp chrome extension (microsoft#710) chore: add GitHub Copilot agent YAML specification (microsoft#715) chore: use streamable http by default (microsoft#716) Co-authored-by: Copilot <[email protected]> chore(extension): support running in http mode (microsoft#717) Add test for browser_evaluate error handling (microsoft#719) fix: browser_take_screenshot to not require snapshot unless element is specified (microsoft#725) chore: align lint w/ playwright (microsoft#729) chore(extension): find installed chrome (microsoft#728) chore: move state to tab, do not cache snapshot (microsoft#730) chore(extension): propagate errors to the client (microsoft#736) chore(extension): handle root session id in the relay (microsoft#737) chore: introduce response type (microsoft#738) chore: follow up on tab snapshot capture (microsoft#739) chore: save session log (microsoft#740) chore(extension): terminate all connections when tab closes (microsoft#741) docs: Add LM Studio installation instructions (microsoft#688) chore: add eval script (microsoft#743) chore: do not double close connection (microsoft#744) chore: unify loops (microsoft#745) chore: one tool experiment (microsoft#746) chore(extension): use free port (microsoft#735) chore(extension): page selector for MCP (microsoft#750) chore: extract pure mcp server helpers (microsoft#751) chore: wire one tool in-process (microsoft#753) chore(extension): exit gracefully when waiting for extension connection (microsoft#754) chore: extract loop tools into a separate folder (microsoft#755) chore: retain the source code from the underlying tools (microsoft#756) chore: recommend sse by default (microsoft#758) chore: ping client and disconnect on connection termination (microsoft#764) Revert "chore: recommend sse by default" (microsoft#765) Reverts microsoft#758 Sounds like the stock streamable implementation is to spec, so we can keep it. chore(extension): reject second http connection (microsoft#766) chore: do not snapshot on fill (microsoft#767) chore: mark v0.0.32 (microsoft#768) chore(extension): use react for connect dialog (microsoft#777) chore(extension): use separate package.json (microsoft#778) chore(extension): do not show chrome: tabs (microsoft#780) chore: parse response in tests (microsoft#796) chore: record user actions in the session log (microsoft#798) chore: make tab snapshot structured to mimic it in recorder (microsoft#799) chore: use pngs by default for screenshots (microsoft#797) 1. Use PNG by default. 1. Increase JPG quality from `50` -> `90`. chore: serialize session entries for tool calls and user actions (microsoft#803) chore(extension): bind relay lifetime to browser context (microsoft#804) chore: refactor initialize (microsoft#812) chore: slice profile dirs by root in vscode (microsoft#814) chore: allow to switch between browser connection methods (microsoft#815) chore(extension): terminate connection on debugger detach (microsoft#816) chore: follow up with win test fix (microsoft#818) chore(extension): build into dist directory (microsoft#825) fix: cursor does not respond to listRoots (microsoft#826) chore(extension): create relay per context (microsoft#828) chore(extension): terminate connection if nothing has been selected (microsoft#827) chore(extension): do not send if socket is already closed (microsoft#834) * Remove debugger listeners if closed() is called as `ws.onclosed` is dispatched asynchronously * Tabs can be closed while update badge command is in flight * Inflight CDP commands fail if the tab closes, do not try to send their response to a closed socket chore(extension): proper watchdog for inactive page selector (microsoft#835) chore(extension): show error when connection is rejected due to inact… (microsoft#836) …ivity chore(extension): add test (microsoft#842) * On Linux headed mode under xvfb-run fails to properly launch the process. It works fine without xvfb-run, we don't have environment for that on CI, so run on macOS instead. * Node v18.20.8 stalls on `const uuid = crypto.randomUUID();`, so use v20 for the extension tests. devops: switch to node 20 on CI (microsoft#844) Node 18 maintanence period ended in April 2025. Running on 18 already caused a problem in microsoft#842 chore(extension): explicitly detach from debugger when connection closes (microsoft#847) chore(extension): connect button for each page, style tweaks (microsoft#848) <img width="643" height="709" alt="image" src="https://github.com/user-attachments/assets/850f2455-b853-4c0f-8047-a7f2ced16b7b" /> fix(docs): Invalid MCP Install Link (microsoft#846) chore: do not return fullPage screenshots to the LLM (microsoft#849) chore: roll Playwright to recent (microsoft#850) chore: mark 0.0.33 (microsoft#851) chore(extension): status page (microsoft#856) fix: emit code for waitfor (microsoft#862) Fixes microsoft#859 chore: bump test workers to 2 on CI (microsoft#863) chore: mcp backend switcher (microsoft#854) chore: introduce check-deps (microsoft#864) fix(proxy): properly forward root requests and client metadata (microsoft#865) fix: backtick quote escaping (microsoft#871) chore: tool definition without zod (microsoft#873) chore: roll Playwright to latest (microsoft#875) chore: run test server per context (microsoft#874) Fixes microsoft#869 chore: extract utils folder (microsoft#876) chore: separate proxy client from external (microsoft#877) chore: steer towards mcp types a bit (microsoft#880) fix: wait for initialization to complete before listing tools (microsoft#886) chore: move tool schema to mcp as it is used by all servers (microsoft#887) chore: close all clients in fixture (microsoft#878) docs: add opencode installation instructions (microsoft#895) chore(extension): add readme file, recommend --extension option (microsoft#894) chore(extension): connection timeout when extension not installed (microsoft#896) chore: try macos15 runners (microsoft#892) devops: extension publishing job (microsoft#888) chore: handle list roots in the server, with timeout (microsoft#898) chore(extension): connected badge while loading (microsoft#899) devops: set-version.js script (microsoft#902) chore: fix copyright (microsoft#903) devops: update extension manifest version (microsoft#904) chore: mark 0.0.34 (microsoft#901) chore: do not wrap mcp in proxy by default, drive-by deps fix (microsoft#909) chore: check extension version on connect (microsoft#907) chore: check version in page, link to instructions (microsoft#918) chore(vscode): add vscode mcp factory (microsoft#868) docs: add instructions for installation in openai codex (microsoft#927) chore: show download link on the status mismatch page (microsoft#928) <img width="610" height="108" alt="image" src="https://github.com/user-attachments/assets/bc1f7534-f282-44f0-bb58-e385b2bf82af" /> chore(extension): do not show tab selector for browser_navigate (microsoft#923) chore: mdb stub (microsoft#912) chore: merge tabs tool into one (microsoft#933) chore: remove navigate_forward due to low usage counts (microsoft#934) chore: introduce form filling tool (microsoft#935) chore(extension): do not complain about old extension version (microsoft#937) chore: mark v0.0.35 (microsoft#938) chore: version extension-relay protocol (microsoft#939) chore(extension): support custom executablePath (microsoft#947) Fixes microsoft#941 chore: introduce verification tools (microsoft#951) chore: update README and extension background script - Removed deprecated arguments from README: `--extension` and `--save-session`. - Added new tab management functions to README: `browser_tab_close`, `browser_tab_list`, `browser_tab_new`, and `browser_tab_select`. - Updated background script to handle connection timeout more efficiently by using `void` with `chrome.tabs.sendMessage`. chore: update version and enhance README - Updated package and lock file versions to 0.0.35-0. - Added new arguments to README: `--extension` for connecting to a running browser instance and `--save-session` for saving the Playwright MCP session. - Revised screenshot parameters in README to clarify image format options. - Consolidated tab management functions in README under `browser_tabs`. feat: enhance connection handling in BrowserServerBackend - Added a new method `getContext` to retrieve the context from `BrowserServerBackend`, ensuring it is initialized. - Updated `createConnection` to return both the server and the context, improving the connection interface. chore: update version to 0.0.35-3 and refactor server creation - Incremented package version to 0.0.35-3 in package.json. - Refactored server creation in multiple files to use async/await for better handling of asynchronous operations, ensuring that server instances are fully initialized before use. chore: update version to 0.0.35-4 and improve tab selection error handling - Incremented package version to 0.0.35-4 in package.json. - Enhanced error handling in tab selection by checking for undefined index in tabs.ts. feat: enhance connection handling in BrowserServerBackend - Added `getContext` method to retrieve the context from `BrowserServerBackend`, ensuring it is initialized. - Updated `createConnection` to return both the server and the context, improving the connection interface. - Refactored server creation to use async/await for better handling of asynchronous operations. fix: improve error handling for tab selection in tabs.ts - Updated the tab selection logic to explicitly check for undefined index, ensuring that a valid tab index is provided before proceeding. This change enhances error reporting and prevents potential runtime issues.
Edward-Upton
added a commit
to asteroidai/playwright-mcp
that referenced
this pull request
Aug 26, 2025
feat: enhance Connection type with context and improve createConnection signature - Added context property to the Connection type for better state management. - Reformatted createConnection function signature for improved readability. chore: update package version to 0.0.29-1 fix: update import path for Context and adjust package name in package-lock.json - Changed import path for Context from "./lib/context.js" to "./src/context.ts". - Updated package name in package-lock.json to "@asteroid_ai/playwright-mcp". chore: set package as non-private - Updated package.json to set "private" to false, allowing for potential publishing. chore: update package name to remove scope - Changed package name from "@asteroid_ai/playwright-mcp" to "asteroid-playwright-mcp" in package.json. chore: update import path for Context and increment package version - Changed import path for Context from "./src/context.ts" to "./lib/context.js". - Incremented package version to 0.0.29-2 in package.json. chore: update import path for Context and increment package version - Changed import path for Context from "./lib/context.js" to "./lib/context.d.ts". - Incremented package version to 0.0.29-3 in package.json. chore: update import paths and increment package version - Changed import path for Context from "./lib/context.d.ts" to "./src/context.js". - Added import for Tab from "./src/tab.js". - Incremented package version to 0.0.29-4 in package.json. - Removed "declaration" option from tsconfig.json. feat: add context and tab type definitions - Introduced new type definitions for Context and Tab in context.d.ts and tab.d.ts respectively. - Updated import paths in index.d.ts to reflect the new file structure. - Enhanced type safety and modularity for better code organization. chore: update package version to 0.0.29-6 and include additional type definitions - Incremented package version to 0.0.29-6 in package.json. - Added context.d.ts and tab.d.ts to .npmignore exceptions for better type definition management. chore: increment package version to 0.0.29-7 and refactor context.ts for improved readability - Updated package version to 0.0.29-7 in package.json. - Refactored code in context.ts for better readability, including consistent formatting and improved handling of popups. chore: increment package version to 0.0.29-8 and enhance context.ts for async handling - Updated package version to 0.0.29-8 in package.json. - Improved async handling in context.ts by awaiting page creation and popup handling for better reliability. chore: increment package version to 0.0.29-9 and simplify page creation handling in context.ts - Updated package version to 0.0.29-9 in package.json. - Simplified the page creation logic in context.ts by removing unnecessary popup handling checks. Revert "chore: increment package version to 0.0.29-9 and simplify page creation handling in context.ts" This reverts commit fff3d31. Revert "chore: increment package version to 0.0.29-7 and refactor context.ts for improved readability" This reverts commit 33033cf. chore: increment package version to 0.0.29-10 in package.json fix: enhance popup handling in context.ts - Added a private flag _isHandlingPopup to manage popup state. - Updated _onPageCreated to handle popups asynchronously and convert them to tabs when detected. - Ensured proper handling of popup state during conversion to maintain tab integrity. chore: increment package version to 0.0.29-11 in package.json chore: increment package version to 0.0.29-12 in package.json and enhance popup handling in context.ts - Updated package version to 0.0.29-12 in package.json. - Removed the private flag _isHandlingPopup and implemented a new method _handlePopup to manage popup windows more effectively. - Improved the logic for detecting and converting popups to tabs, ensuring better handling of various popup scenarios. chore: increment package version to 0.0.29-13 in package.json chore: increment package version to 0.0.29-14 in package.json and remove redundant popup navigation wait in context.ts fix: improve download error handling in context.ts - Added error handling for download.saveAs to log any issues during the save process. - Ensured that entry.finished is set to true regardless of the success or failure of the download operation. feat: introduce everyTool export and update connection logic - Added everyTool export in tools.ts to combine snapshotTools and visionTools. - Updated createConnection function in connection.ts to use everyTool by default, with conditional logic for visionTools based on config.vision. chore: increment package version to 0.0.29-16 in package.json chore: increment package version to 0.0.29-17 in package.json fix: only include one version of each tool in `everyTool` feat: enhance popup event logging in context.ts - Added console logs to track popup events, including when a popup is received, if it is a valid popup window, and when it is closed. - Improved visibility into the popup handling process for better debugging and monitoring. chore: increment package version to 0.0.29-19 in package.json chore: increment package version to 0.0.29-20 in package.json and streamline popup handling in context.ts - Updated package version to 0.0.29-20 in package.json. - Simplified the popup handling logic by directly checking the created page for popups and logging relevant events. - Introduced a set of standard target names to improve the detection of popup windows. chore: increment package version to 0.0.29-21 in package.json and enhance popup detection logic in context.ts - Updated package version to 0.0.29-21 in package.json. - Improved the popup detection logic by adding additional indicators and checks for popup-like features, enhancing the accuracy of the `_isPopupWindow` method. chore: increment package version to 0.0.29-22 in package.json and refactor popup detection logic in context.ts - Updated package version to 0.0.29-22 in package.json. - Refactored the `_isPopupWindow` method to utilize a new `popupAnalysis` function for improved popup detection. - Enhanced the analysis process with additional checks and confidence scoring for better accuracy in identifying popup windows. fix: update type for reasons array and improve window resizability check in popup analysis - Changed the type of the `reasons` array to explicitly be an array of strings for better type safety. - Updated the check for window resizability to use a more explicit boolean expression. fix: add error logging for popup window detection in context.ts - Introduced console error logging to capture and report errors encountered during the popup window detection process, improving debugging capabilities. chore: increment package version to 0.0.29-23 in package.json chore: increment package version to 0.0.29-24 in package.json and refactor popup analysis to be asynchronous - Updated package version to 0.0.29-24 in package.json. - Refactored the `popupAnalysis` function to be asynchronous, allowing for better handling of page evaluations. - Updated the call to `popupAnalysis` in `context.ts` to await the result, improving the flow of popup detection. chore: increment package version to 0.0.29-25 in package.json and move THRESHOLD constant inside popupAnalysis function - Updated package version to 0.0.29-25 in package.json. - Moved the `THRESHOLD` constant inside the `popupAnalysis` function for better encapsulation and clarity. chore: increment package version to 0.0.29-26 in package.json chore: increment package version to 0.0.29-27 in package.json and add logging for popup URL in context.ts - Updated package version to 0.0.29-27 in package.json. - Added a console log to output the URL of the popup for better debugging and tracking of popup behavior. refactor: update popup handling to create a new page instead of a new tab in context.ts - Changed the logic to create a new page directly and navigate to the popup URL, improving the handling of popups. - Updated error handling to log navigation failures for better debugging. chore: increment package version to 0.0.29-29 in package.json and enhance error handling in context.ts - Updated package version to 0.0.29-29 in package.json. - Improved error handling for popup management in context.ts, including timeout handling for URL fetching and enhanced logging for better debugging. refactor: simplify popup URL fetching in context.ts - Removed timeout handling for fetching the popup URL, streamlining the process. - Enhanced logging to output the fetched popup URL for better debugging. chore: increment package version to 0.0.29-31 in package.json and ensure popup page loads before fetching URL in context.ts - Updated package version to 0.0.29-31 in package.json. - Added a wait for the "domcontentloaded" state before fetching the popup URL in context.ts to improve reliability. chore: increment package version to 0.0.29-32 in package.json and enhance popup URL retrieval logic in context.ts - Updated package version to 0.0.29-32 in package.json. - Improved the logic for fetching the popup URL in context.ts with retry attempts and error handling to ensure reliability. refactor: enhance popup handling logic in context.ts - Updated _handlePopup method to return a boolean indicating if a popup was handled. - Improved error handling and logging for popup URL retrieval and closing popups. - Streamlined the logic to avoid unnecessary tab additions when a popup is detected. refactor: improve popup URL retrieval with retry logic in context.ts - Enhanced the _handlePopup method to implement a retry mechanism for fetching the popup URL, allowing up to three attempts. - Improved error handling and logging during the URL retrieval process. - Adjusted return values to better reflect the success of popup handling. chore: increment package version to 0.0.29-35 in package.json and extend timeout for popup URL fetching in context.ts - Updated package version to 0.0.29-35 in package.json. - Increased the timeout duration for waiting on popup URL resolution from 1500ms to 2500ms in context.ts to improve reliability. chore: increment package version to 0.0.29-36 in package.json and adjust timeout for popup URL fetching in context.ts - Updated package version to 0.0.29-36 in package.json. - Increased the timeout duration for waiting on popup URL resolution from 2500ms to 3000ms in context.ts to enhance reliability. - Ensured that the current tab is always switched to the newly created tab in context.ts. chore: increment package version to 0.0.29-37 in package.json and extend timeout for popup URL fetching in context.ts - Updated package version to 0.0.29-37 in package.json. - Increased the timeout duration for waiting on popup URL resolution from 3000ms to 4000ms in context.ts to enhance reliability. chore: increment package version to 0.0.29-38 in package.json and improve context closure handling in context.ts - Updated package version to 0.0.29-38 in package.json. - Enhanced the logic in context.ts to log a message and handle errors when closing the context if no tabs are left, improving robustness. chore: increment package version to 0.0.29-39 in package.json and refine context closure handling in context.ts - Updated package version to 0.0.29-39 in package.json. - Simplified the context closure logic in context.ts to use a promise-based approach for error handling, improving code clarity and robustness. refactor: implement retry logic for dialog handling in dialogs.ts - Added a retry mechanism to the dialog handling process, allowing up to three attempts to accept or dismiss the dialog, improving robustness against transient errors. - Ensured that the dialog state is always cleared after handling, regardless of success or failure. chore: add .prettierignore and standardize import quotes in TypeScript files - Introduced a .prettierignore file to exclude all files from formatting. - Standardized import statements across TypeScript files to use single quotes for consistency. - Updated package name in package-lock.json and README.md to reflect the new naming convention. - Enhanced linting script in package.json to automatically fix issues during linting. refactor: comment out console error and log statements in context.ts and dialogs.ts - Commented out various console log and error statements in context.ts to reduce noise during execution. - Updated dialog handling in dialogs.ts by commenting out the error logging to streamline the process. chore(extension): support reconnect, implement relay-extension protocol (microsoft#602) chore(extension): convert to typescript (microsoft#603) chore(extension): wrap CDP protocol (microsoft#604) fix(docs): Fix typo of windsurf in readme (microsoft#620) devops(docker): enhance Docker image publishing with ORAS end-of-life tagging (microsoft#641) This tags the images we publish as EOL immediately in order to get excluded from the image scanning. Like we do upstream in microsoft/playwright. docs: adding installation steps for Gemini CLI (microsoft#625) I just tried it out with Gemini CLI and it works like a charm, thanks for creating this MCP server! docs: add instructions to install in Goose (microsoft#580) docs: Update README about imageResponses option. (microsoft#646) feat(dblclick): add double click (microsoft#654) Fixes microsoft#652 chore: update to 1.54.0 (microsoft#653) Closes microsoft#535 chore: roll Playwright to 1.54.1 (microsoft#665) chore: remove extension code (microsoft#667) chore: mark v0.0.30 (microsoft#666) chore: migrate to locator._resolveSelector (microsoft#670) chore: include page errors in console messages (microsoft#671) Fixes microsoft#669 chore: make tab indexes 0-based (microsoft#674) Fixes microsoft#570 chore: resolve dialog races (microsoft#673) Fixes microsoft#595 chore: remove generate_test tool for now - it adds no value (microsoft#675) chore: introduce browser_evaluate (microsoft#678) Fixes microsoft#424 chore: turn vision into capability (microsoft#679) Fixes microsoft#420 chore: remove server experiment (microsoft#681) chore: remove image reply special case in cursor (microsoft#680) chore: sort install sections (microsoft#682) chore: mirror cli options w/ env vars (microsoft#685) Fixes microsoft#639 chore: allow right click (microsoft#687) Fixes microsoft#467 chore: include recent console logs in results (microsoft#689) chore: mark v0.0.31 (microsoft#691) chore(docs): make VSCode match other README sections (microsoft#706) fix: no-sandbox flag logic to only disable sandbox when explicitly passed (microsoft#709) feat: add fullPage mode to browser_take_screenshot (microsoft#704) chore: add mcp chrome extension (microsoft#710) chore: add GitHub Copilot agent YAML specification (microsoft#715) chore: use streamable http by default (microsoft#716) Co-authored-by: Copilot <[email protected]> chore(extension): support running in http mode (microsoft#717) Add test for browser_evaluate error handling (microsoft#719) fix: browser_take_screenshot to not require snapshot unless element is specified (microsoft#725) chore: align lint w/ playwright (microsoft#729) chore(extension): find installed chrome (microsoft#728) chore: move state to tab, do not cache snapshot (microsoft#730) chore(extension): propagate errors to the client (microsoft#736) chore(extension): handle root session id in the relay (microsoft#737) chore: introduce response type (microsoft#738) chore: follow up on tab snapshot capture (microsoft#739) chore: save session log (microsoft#740) chore(extension): terminate all connections when tab closes (microsoft#741) docs: Add LM Studio installation instructions (microsoft#688) chore: add eval script (microsoft#743) chore: do not double close connection (microsoft#744) chore: unify loops (microsoft#745) chore: one tool experiment (microsoft#746) chore(extension): use free port (microsoft#735) chore(extension): page selector for MCP (microsoft#750) chore: extract pure mcp server helpers (microsoft#751) chore: wire one tool in-process (microsoft#753) chore(extension): exit gracefully when waiting for extension connection (microsoft#754) chore: extract loop tools into a separate folder (microsoft#755) chore: retain the source code from the underlying tools (microsoft#756) chore: recommend sse by default (microsoft#758) chore: ping client and disconnect on connection termination (microsoft#764) Revert "chore: recommend sse by default" (microsoft#765) Reverts microsoft#758 Sounds like the stock streamable implementation is to spec, so we can keep it. chore(extension): reject second http connection (microsoft#766) chore: do not snapshot on fill (microsoft#767) chore: mark v0.0.32 (microsoft#768) chore(extension): use react for connect dialog (microsoft#777) chore(extension): use separate package.json (microsoft#778) chore(extension): do not show chrome: tabs (microsoft#780) chore: parse response in tests (microsoft#796) chore: record user actions in the session log (microsoft#798) chore: make tab snapshot structured to mimic it in recorder (microsoft#799) chore: use pngs by default for screenshots (microsoft#797) 1. Use PNG by default. 1. Increase JPG quality from `50` -> `90`. chore: serialize session entries for tool calls and user actions (microsoft#803) chore(extension): bind relay lifetime to browser context (microsoft#804) chore: refactor initialize (microsoft#812) chore: slice profile dirs by root in vscode (microsoft#814) chore: allow to switch between browser connection methods (microsoft#815) chore(extension): terminate connection on debugger detach (microsoft#816) chore: follow up with win test fix (microsoft#818) chore(extension): build into dist directory (microsoft#825) fix: cursor does not respond to listRoots (microsoft#826) chore(extension): create relay per context (microsoft#828) chore(extension): terminate connection if nothing has been selected (microsoft#827) chore(extension): do not send if socket is already closed (microsoft#834) * Remove debugger listeners if closed() is called as `ws.onclosed` is dispatched asynchronously * Tabs can be closed while update badge command is in flight * Inflight CDP commands fail if the tab closes, do not try to send their response to a closed socket chore(extension): proper watchdog for inactive page selector (microsoft#835) chore(extension): show error when connection is rejected due to inact… (microsoft#836) …ivity chore(extension): add test (microsoft#842) * On Linux headed mode under xvfb-run fails to properly launch the process. It works fine without xvfb-run, we don't have environment for that on CI, so run on macOS instead. * Node v18.20.8 stalls on `const uuid = crypto.randomUUID();`, so use v20 for the extension tests. devops: switch to node 20 on CI (microsoft#844) Node 18 maintanence period ended in April 2025. Running on 18 already caused a problem in microsoft#842 chore(extension): explicitly detach from debugger when connection closes (microsoft#847) chore(extension): connect button for each page, style tweaks (microsoft#848) <img width="643" height="709" alt="image" src="https://github.com/user-attachments/assets/850f2455-b853-4c0f-8047-a7f2ced16b7b" /> fix(docs): Invalid MCP Install Link (microsoft#846) chore: do not return fullPage screenshots to the LLM (microsoft#849) chore: roll Playwright to recent (microsoft#850) chore: mark 0.0.33 (microsoft#851) chore(extension): status page (microsoft#856) fix: emit code for waitfor (microsoft#862) Fixes microsoft#859 chore: bump test workers to 2 on CI (microsoft#863) chore: mcp backend switcher (microsoft#854) chore: introduce check-deps (microsoft#864) fix(proxy): properly forward root requests and client metadata (microsoft#865) fix: backtick quote escaping (microsoft#871) chore: tool definition without zod (microsoft#873) chore: roll Playwright to latest (microsoft#875) chore: run test server per context (microsoft#874) Fixes microsoft#869 chore: extract utils folder (microsoft#876) chore: separate proxy client from external (microsoft#877) chore: steer towards mcp types a bit (microsoft#880) fix: wait for initialization to complete before listing tools (microsoft#886) chore: move tool schema to mcp as it is used by all servers (microsoft#887) chore: close all clients in fixture (microsoft#878) docs: add opencode installation instructions (microsoft#895) chore(extension): add readme file, recommend --extension option (microsoft#894) chore(extension): connection timeout when extension not installed (microsoft#896) chore: try macos15 runners (microsoft#892) devops: extension publishing job (microsoft#888) chore: handle list roots in the server, with timeout (microsoft#898) chore(extension): connected badge while loading (microsoft#899) devops: set-version.js script (microsoft#902) chore: fix copyright (microsoft#903) devops: update extension manifest version (microsoft#904) chore: mark 0.0.34 (microsoft#901) chore: do not wrap mcp in proxy by default, drive-by deps fix (microsoft#909) chore: check extension version on connect (microsoft#907) chore: check version in page, link to instructions (microsoft#918) chore(vscode): add vscode mcp factory (microsoft#868) docs: add instructions for installation in openai codex (microsoft#927) chore: show download link on the status mismatch page (microsoft#928) <img width="610" height="108" alt="image" src="https://github.com/user-attachments/assets/bc1f7534-f282-44f0-bb58-e385b2bf82af" /> chore(extension): do not show tab selector for browser_navigate (microsoft#923) chore: mdb stub (microsoft#912) chore: merge tabs tool into one (microsoft#933) chore: remove navigate_forward due to low usage counts (microsoft#934) chore: introduce form filling tool (microsoft#935) chore(extension): do not complain about old extension version (microsoft#937) chore: mark v0.0.35 (microsoft#938) chore: version extension-relay protocol (microsoft#939) chore(extension): support custom executablePath (microsoft#947) Fixes microsoft#941 chore: introduce verification tools (microsoft#951) chore: update README and extension background script - Removed deprecated arguments from README: `--extension` and `--save-session`. - Added new tab management functions to README: `browser_tab_close`, `browser_tab_list`, `browser_tab_new`, and `browser_tab_select`. - Updated background script to handle connection timeout more efficiently by using `void` with `chrome.tabs.sendMessage`. chore: update version and enhance README - Updated package and lock file versions to 0.0.35-0. - Added new arguments to README: `--extension` for connecting to a running browser instance and `--save-session` for saving the Playwright MCP session. - Revised screenshot parameters in README to clarify image format options. - Consolidated tab management functions in README under `browser_tabs`. feat: enhance connection handling in BrowserServerBackend - Added a new method `getContext` to retrieve the context from `BrowserServerBackend`, ensuring it is initialized. - Updated `createConnection` to return both the server and the context, improving the connection interface. chore: update version to 0.0.35-3 and refactor server creation - Incremented package version to 0.0.35-3 in package.json. - Refactored server creation in multiple files to use async/await for better handling of asynchronous operations, ensuring that server instances are fully initialized before use. chore: update version to 0.0.35-4 and improve tab selection error handling - Incremented package version to 0.0.35-4 in package.json. - Enhanced error handling in tab selection by checking for undefined index in tabs.ts. feat: enhance connection handling in BrowserServerBackend - Added `getContext` method to retrieve the context from `BrowserServerBackend`, ensuring it is initialized. - Updated `createConnection` to return both the server and the context, improving the connection interface. - Refactored server creation to use async/await for better handling of asynchronous operations. fix: improve error handling for tab selection in tabs.ts - Updated the tab selection logic to explicitly check for undefined index, ensuring that a valid tab index is provided before proceeding. This change enhances error reporting and prevents potential runtime issues.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.