Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Web] using OffscreenCanvas when DOM is not available #19032

Closed
jiangzhuo opened this issue Jan 6, 2024 · 0 comments
Closed

[Web] using OffscreenCanvas when DOM is not available #19032

jiangzhuo opened this issue Jan 6, 2024 · 0 comments
Labels
platform:web issues related to ONNX Runtime web; typically submitted using template

Comments

@jiangzhuo
Copy link
Contributor

Describe the issue

I am using onnxruntime-web in web worker, execution provider is wasm.
DOM API is not avaiable in some environment, like web woker or service worker.

To reproduce

image
Here is an repo can reproduce this error.
This is using onnxruntime-web in chrome extension, onnxruntime-web is used in a web worker, it should be same as in a web worker in web page.

Urgency

No response

ONNX Runtime Installation

Built from Source

ONNX Runtime Version or Commit ID

1.16.3

Execution Provider

'wasm'/'cpu' (WebAssembly CPU)

@jiangzhuo jiangzhuo added the platform:web issues related to ONNX Runtime web; typically submitted using template label Jan 6, 2024
@jiangzhuo jiangzhuo changed the title [Web] using OffscreenCanvas when DOM is not avaiable [Web] using OffscreenCanvas when DOM is not available Jan 6, 2024
fs-eire pushed a commit that referenced this issue Jan 12, 2024
### Description
when DOM API is not avaiable, using OffscreenCanvas


### Motivation and Context
In some environment like service worker or web worker, the DOM API is
not avaiable, we can use OffscreenCanvas API to replace
`document.createElement('canvas')`.
Most of the APIs of OffscreenCanvas and HTMLCanvasElement are the same,
except that `toDataUrl` is missing.

It fix this issues #19032
mszhanyi pushed a commit that referenced this issue Jan 15, 2024
### Description
when DOM API is not avaiable, using OffscreenCanvas


### Motivation and Context
In some environment like service worker or web worker, the DOM API is
not avaiable, we can use OffscreenCanvas API to replace
`document.createElement('canvas')`.
Most of the APIs of OffscreenCanvas and HTMLCanvasElement are the same,
except that `toDataUrl` is missing.

It fix this issues #19032
siweic0 pushed a commit to siweic0/onnxruntime-web that referenced this issue May 9, 2024
### Description
when DOM API is not avaiable, using OffscreenCanvas


### Motivation and Context
In some environment like service worker or web worker, the DOM API is
not avaiable, we can use OffscreenCanvas API to replace
`document.createElement('canvas')`.
Most of the APIs of OffscreenCanvas and HTMLCanvasElement are the same,
except that `toDataUrl` is missing.

It fix this issues microsoft#19032
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
platform:web issues related to ONNX Runtime web; typically submitted using template
Projects
None yet
Development

No branches or pull requests

1 participant