Y
Y
Yan Vetrov2021-10-08 11:26:28
JavaScript
Yan Vetrov, 2021-10-08 11:26:28

How to fix error when using socket io in Chrome Extension?

I want to use socket.io in my extension, but when I import the library, the extension throws an "Uncaught ReferenceError: document is not defined" error. I found out that socket.io does check document and window, but in background.js I can't use n. document API, nor window object. I am using manifest v3. What do I need to do to use socket.io?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question