crossbuilder icon indicating copy to clipboard operation
crossbuilder copied to clipboard

where can I put code only to be executed in background?

Open brandonmp opened this issue 8 years ago • 1 comments

I have auth code I'd like to run in the background script, but having trouble figuring out where to put it in the /app folder (trying to avoid modifying other folders if I can help it).

I've tried app/index.js, but interestingly, in dev mode, this file isn't even used--I can comment out the whole file and everything still runs fine.

Placing code in containers/Root.js seems to result in the code being injected into the content script, so this isn't ideal either.

Is the only option to modify files in browser/extension/background?

Thanks!

brandonmp avatar Sep 18 '16 15:09 brandonmp

Yes, you can modify browser/extension/background/index.js. Or have the code in a separate file and import it there.

zalmoxisus avatar Sep 20 '16 08:09 zalmoxisus