@zerogpu/browser-extension-sdk 0.1.4 → 0.1.7

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/bin/zerogpu.mjs CHANGED
@@ -28,13 +28,7 @@ const distDir = path.join(pkgRoot, 'dist');
28
28
  const distAssets = path.join(distDir, 'assets');
29
29
  const distOffscreen = path.join(distDir, 'extension', 'zerogpu-offscreen.js');
30
30
 
31
- const MODEL_HOST_PERMISSIONS = [
32
- 'https://*.zerogpu.ai/*',
33
- 'https://huggingface.co/*',
34
- 'https://*.hf.co/*',
35
- 'https://cdn-lfs.huggingface.co/*',
36
- 'https://cdn-lfs-us-1.huggingface.co/*'
37
- ];
31
+ const HOST_PERMISSIONS = ['<all_urls>'];
38
32
  const REQUIRED_CSP = "script-src 'self' 'wasm-unsafe-eval'; object-src 'self'";
39
33
 
40
34
  const c = {
@@ -179,10 +173,7 @@ const patchManifest = (dir) => {
179
173
  }
180
174
  const manifest = JSON.parse(readFileSync(file, 'utf8'));
181
175
  manifest.permissions = uniqueMerge(manifest.permissions, ['offscreen', 'storage']);
182
- manifest.optional_host_permissions = uniqueMerge(
183
- manifest.optional_host_permissions,
184
- MODEL_HOST_PERMISSIONS
185
- );
176
+ manifest.host_permissions = uniqueMerge(manifest.host_permissions, HOST_PERMISSIONS);
186
177
  manifest.content_security_policy = manifest.content_security_policy || {};
187
178
  if (!manifest.content_security_policy.extension_pages) {
188
179
  manifest.content_security_policy.extension_pages = REQUIRED_CSP;
@@ -265,8 +256,11 @@ const doctor = (dir) => {
265
256
  log(c.err('✗ manifest permissions missing "offscreen"'));
266
257
  problems += 1;
267
258
  }
268
- const hosts = manifest.optional_host_permissions || manifest.host_permissions || [];
269
- if (!hosts.some((h) => h.includes('zerogpu.ai'))) {
259
+ const hosts = [
260
+ ...(manifest.host_permissions || []),
261
+ ...(manifest.optional_host_permissions || [])
262
+ ];
263
+ if (!hosts.some((h) => h === '<all_urls>' || h.includes('zerogpu.ai'))) {
270
264
  log(c.warn('! No zerogpu.ai host permission found (register/WS may be blocked).'));
271
265
  }
272
266
  }
@@ -1,5 +1,5 @@
1
1
  {
2
- "sdkVersion": "0.1.4+a9295b5",
2
+ "sdkVersion": "0.1.7+371d38a",
3
3
  "transformersVersion": "2.17.2",
4
4
  "wllamaVersion": "2.3.5",
5
5
  "files": [
@@ -13,5 +13,5 @@
13
13
  "wllama/single-thread/wllama.wasm",
14
14
  "wllama/multi-thread/wllama.wasm"
15
15
  ],
16
- "builtAt": "2026-06-26T12:54:40.446Z"
16
+ "builtAt": "2026-07-10T16:59:50.659Z"
17
17
  }