webhelm 1.0.56 → 1.0.57

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "webhelm",
3
- "version": "1.0.56",
3
+ "version": "1.0.57",
4
4
  "description": "Agent browser automation in a visible managed Chrome with persistent JavaScript sessions",
5
5
  "type": "module",
6
6
  "bin": {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "manifest_version": 3,
3
3
  "name": "WebHelm",
4
- "version": "1.0.56",
4
+ "version": "1.0.57",
5
5
  "description": "Own named Chrome tab-group workspaces and lazy reusable tab pools for browser agents.",
6
6
  "permissions": [
7
7
  "storage",
@@ -138,7 +138,8 @@ chrome.webNavigation.onCreatedNavigationTarget.addListener((details) => {
138
138
 
139
139
  chrome.tabs.onUpdated.addListener((_tabId, changeInfo, tab) => {
140
140
  if (changeInfo.url || Object.prototype.hasOwnProperty.call(changeInfo, "groupId")) scheduleBadge();
141
- if (!Object.prototype.hasOwnProperty.call(changeInfo, "groupId")) return;
141
+ if (!Object.prototype.hasOwnProperty.call(changeInfo, "groupId") &&
142
+ !/^chrome:\/\/(?:newtab|new-tab-page)(?:[/?#]|$)/.test(changeInfo.url || "")) return;
142
143
  manager.inheritWorkspaceForCreatedTab(tab).then(scheduleBadge).catch((error) => {
143
144
  console.warn("WebHelm failed to reconcile tab group ownership", error);
144
145
  });
@@ -372,6 +372,24 @@ export class WorkspaceManager {
372
372
  const groups = await this.chrome.tabGroups.query({});
373
373
  const groupsById = new Map(groups.map((candidate) => [candidate.id, candidate]));
374
374
 
375
+ // Chrome can give a browser-created New Tab an opener in the active
376
+ // managed group. A New Tab page is not a site-created child session.
377
+ // Use the latest snapshot because group and URL events can arrive separately.
378
+ tab = tabsById.get(tabId) || tab;
379
+ if (/^chrome:\/\/(?:newtab|new-tab-page)(?:[/?#]|$)/.test(this.tabUrl(tab))) {
380
+ if (this.isOwnedTab(tab) || this.designCompanionTabIds.has(tabId)) return null;
381
+ const group = groupsById.get(tab.groupId);
382
+ if (group?.title && (await this.configuredWorkspace(group.title)).entry) {
383
+ const current = await this.chrome.tabs.get(tabId);
384
+ if (current.groupId === group.id && !this.isOwnedTab(current) &&
385
+ !this.designCompanionTabIds.has(tabId)) {
386
+ await this.chrome.tabs.ungroup([tabId]);
387
+ return { workspace: group.title, groupId: group.id, tabId, releasedUnexpected: true };
388
+ }
389
+ }
390
+ return null;
391
+ }
392
+
375
393
  let ancestor = Number.isInteger(openerTabId) ? tabsById.get(openerTabId) : null;
376
394
  const visited = new Set();
377
395
  let inherited = null;