mcp-browser-extension 0.9.35 → 0.9.36

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -701,6 +701,13 @@ class BridgeServer {
701
701
  nameFor(frame) {
702
702
  const installId = (0, profiles_1.isValidInstallId)(frame.installId) ? frame.installId : undefined;
703
703
  const helperProfile = this.opts.helperProfile ?? (0, config_1.resolveProfile)();
704
+ // Chrome won't tell an extension its profile, but we can look it up on disk.
705
+ const chrome = !installId || this.opts.chromeProfiles === null ? null
706
+ : this.opts.chromeProfiles ?? { nameOf: chrome_profile_name_1.chromeProfileName, keys: () => (0, chrome_profile_name_1.chromeProfileKeys)() };
707
+ const own = installId ? chrome?.nameOf(frame.ext?.id, installId) : undefined;
708
+ const ownKey = own ? (0, chrome_profile_name_1.profileKeyFromChromeName)(own) : undefined;
709
+ let otherProfiles;
710
+ const isOtherChromeProfile = (name) => name !== ownKey && (otherProfiles ??= chrome?.keys() ?? []).includes(name);
704
711
  let suggested;
705
712
  if (typeof frame.suggestedProfile === 'string' && frame.suggestedProfile.trim()) {
706
713
  try {
@@ -712,8 +719,10 @@ class BridgeServer {
712
719
  const label = routeKey(frame.profile);
713
720
  // Extensions before 0.9.35 saved the helper's name as if it was typed, so
714
721
  // every browser paired with Connect claimed it and knocked the others off.
715
- // That exact name is a suggestion; any other label is the person's choice.
716
- if (!installId || helperProfile === DEFAULT_PROFILE || label !== helperProfile) {
722
+ // A label that is the helper's name, or another Chrome profile's name on
723
+ // this computer, is a suggestion; any other label is the person's choice.
724
+ const fromHelper = helperProfile !== DEFAULT_PROFILE && label === helperProfile;
725
+ if (!installId || !(fromHelper || isOtherChromeProfile(label))) {
717
726
  return { profile: label, naming: 'options', installId };
718
727
  }
719
728
  suggested = label;
@@ -724,13 +733,8 @@ class BridgeServer {
724
733
  const conn = this.conns.get(name);
725
734
  return !!conn && conn.isOpen() && this.origins.get(name)?.installId !== installId;
726
735
  };
727
- // Chrome won't tell an extension its profile, but we can look it up on disk.
728
- const chrome = this.opts.chromeProfiles === null ? null
729
- : this.opts.chromeProfiles ?? { nameOf: chrome_profile_name_1.chromeProfileName, keys: () => (0, chrome_profile_name_1.chromeProfileKeys)() };
730
- const own = chrome?.nameOf(frame.ext?.id, installId);
731
- const ownKey = own ? (0, chrome_profile_name_1.profileKeyFromChromeName)(own) : undefined;
732
736
  // Never hand a browser the name of a different Chrome profile on this computer.
733
- if (suggested && suggested !== ownKey && chrome?.keys().includes(suggested))
737
+ if (suggested && isOtherChromeProfile(suggested))
734
738
  suggested = undefined;
735
739
  return { profile: this.registry.assign(installId, heldByOther, [suggested], ownKey), naming: 'auto', installId };
736
740
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "mcp-browser-extension",
3
3
  "mcpName": "io.github.Mehmoodqureshi/mcp-browser-extension",
4
- "version": "0.9.35",
4
+ "version": "0.9.36",
5
5
  "description": "Drive your real Chrome browser over MCP — real logins, real cookies. A stdio MCP server (CLI) plus an MV3 extension, driving Chrome via chrome.scripting/chrome.tabs. Multi-tab batch automation, accessibility snapshots, deny-all security by default.",
6
6
  "author": "Mehmood Ur Rehman Qureshi",
7
7
  "license": "MIT",