Sentry inclusion in Content Scripts of a Chrome Extension #10357
vincer-textexpander
started this conversation in
General
Replies: 1 comment
-
Ah... I may have answered my own question by digging in the Sentry JS SDK Docs a bit deeper. The topic on using Sentry SDK in shared environments discusses using private Sentry Client/Hub instances in conjunction with manually captured errors. There are also considerations for integrations that affect Sentry's 'global state'. So, the bottom line is that Sentry SDK can be used in Chrome Extension Content Scripts, but extra work must be done to properly isolate it. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello, we have a chrome extension and we would like to use the Sentry SDK in the content scripts, however we have not found a definitive answer as to whether it is fully supported or not.
On one hand there is this Sentry SDK comment that advises against including Sentry in a content script:
"Side-note to extension authors: Injecting the Sentry SDK on arbitrary pages is highly discouraged. Injected Sentry SDKs might clash with a Sentry SDK already running on a page. Not only will this mean that the SDK you injected most likely won't work, but also you break the SDK the website is already running - ruining fun for everyone."
However, according to this Chrome Developer topic, Content Scripts are isolated from any other in-page scripts:
"Note: Not only does each extension run in its own isolated world, but content scripts and the web page do too. This means that none of these (web page, content scripts, and any running extensions) can access the context and variables of the others."
Given this, we'd like to get an official position on including Sentry in Chrome Extension Content Scripts, and if it is not recommended, please explain why.
Thank you.
Beta Was this translation helpful? Give feedback.
All reactions