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

How to tell closure compiler that a web worker is usded in a project #4016

Open
zuhairtaha opened this issue Dec 2, 2022 · 3 comments
Open

Comments

@zuhairtaha
Copy link

I have a chrome extension project which has two folders, one is content-script which use dom
the other one is background which uses service worker
I would like to tell closure compiler which library/environment is used in each so that it give errors/warnings if I missused one of them

For example using window object or document.createElement in service woker should show an error

@brad4d
Copy link
Contributor

brad4d commented Dec 7, 2022

Roughly the answer is to compile the 2 parts separately using different externs files (standard for the web page, worker externs only for the worker one). However, I don't have a handy list of which externs those are, and I suspect you're looking for a solution that compiles all of these things together.

Honestly, we've never spent any time trying to support this use-case. Sorry.

@fingerartur
Copy link

@zuhairtaha I am afraid Service Worker and Web Worker are two very different things. Let's start by getting this straight. Which one are you trying to use?

@zuhairtaha
Copy link
Author

I use Service Worker

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

No branches or pull requests

3 participants