Disabling/re-enabling sentry at runtime (raven-js)

Hi there. This is specific to raven-js usage.

Is there any way to call Raven.config again and change some options for a running instance?
Or maybe a better angle: is there just a way to just stop the running instance and restart it later?

Currently got sentry working via raven-js in our web extension. It has 4 main scripts from all of which Raven is config’d and installed (same DSN). Seems to be all working fine and tracking errors from all scripts.

One of the scripts affords a simple toggle for users to say “enable/disable all tracking in the extension” - this includes sentry stuff. How it works is it sets a bool flag in web ext local storage from that one script, which all the other scripts should also be able to see.

After reading the docs and prior discussions I saw the shouldSendCallback function you can pass. My idea being to read that local storage flag and return it. However web ext local storage is async access only and that option doesn’t seem to support Promises - I think out of luck with that idea.

Instead of reading from local storage inside shouldSendCallback, I thought maybe I could call Raven.config again every time the local storage value changes (can add storage listeners to react to changes from other scripts), to re-configure the already running sentry instances. This does not seem to work though. Have also tried Raven.uninstall().config(...).install() on every change, although that doesn’t seem to change it.

Does anyone have any other ideas - or maybe some docs I’m missing? Let me know if I’m not being entirely clear on how it works or I what I want to do. Thanks for reading