Skip to content
This repository has been archived by the owner on Nov 16, 2023. It is now read-only.

Chrome Extension Manifest V3 and onnx.js #297

Open
smstojanovic opened this issue May 21, 2021 · 0 comments
Open

Chrome Extension Manifest V3 and onnx.js #297

smstojanovic opened this issue May 21, 2021 · 0 comments

Comments

@smstojanovic
Copy link

I'm trying to load the onnx.js library in a Chrome extension with Manifest V3 in a service worker.

I'm attempting to import it via:

try{
  importScripts('/app/onnx.min.js');
} catch(err) {
  console.log(err);
}

with the following error printed out:

ReferenceError: window is not defined
    at onnx.min.js:1
    at background.js:8

Since there's no DOM access in a service worker, the window variable does not exist and therefore it doesn't look like onnx.js is going to work for the time being.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant