webhelm 1.0.22 → 1.0.23

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.22",
3
+ "version": "1.0.23",
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": "0.4.7",
4
+ "version": "0.4.8",
5
5
  "description": "Own named Chrome tab-group workspaces and lazy reusable tab pools for browser agents.",
6
6
  "permissions": [
7
7
  "storage",
@@ -86,12 +86,13 @@ export async function ensureExtensionLoaded(browser, {skip=false,extensionDir=EX
86
86
  if(skip)return {skipped:true};
87
87
  if(!allowUpdate && (!fs.existsSync(path.join(extensionDir,'manifest.json')) || !identical(extensionDir)))
88
88
  throw Error('Extension update deferred: active browser Sessions must finish before staging new content');
89
- const {path:dir,version}=allowUpdate?stageExtension(extensionDir):{path:extensionDir,version:extensionVersion};
89
+ const {path:dir,version,updated=false}=allowUpdate?stageExtension(extensionDir):{path:extensionDir,version:extensionVersion};
90
90
  let modern=false, installed;
91
91
  try{
92
92
  const state=await browser.send('Extensions.getExtensions');
93
93
  modern=true;installed=state.extensions?.find(e=>e.id===EXTENSION_ID);
94
- if(!installed || !installed.enabled || installed.version!==version || canonicalPath(installed.path)!==canonicalPath(dir)){
94
+ // Updating files at the same directory and version also needs a worker reload.
95
+ if(updated || !installed || !installed.enabled || installed.version!==version || canonicalPath(installed.path)!==canonicalPath(dir)){
95
96
  if(!allowUpdate)throw Error('Extension reload deferred: active browser Sessions must finish');
96
97
  const loaded=await browser.send('Extensions.loadUnpacked',{path:dir});
97
98
  if(loaded.id!==EXTENSION_ID)throw Error('Chrome loaded an unexpected extension ID');