Description
Problem Statement
With the upcoming Manifest V3 changes, almost all powerful extensions will end up having at least three separate extension contexts:
- an "extension service worker" that has access to all chrome.* APIs and is the core backbone of the extension (see introduction here)
- an "offscreen document" that has access to DOM APIs and enables extensions to perform DOM manipulation (see introduction here)
- a "sandbox" frame inside which extensions can run eval() - this frame is probably going to become more common now given strict MV3 requirements (see introduction here).
The extension service worker and the offscreen document are completely separate processes. The sandbox is iframed inside the offscreen document.
Coming back to SentryJS...right now, I have added Sentry.init
and configureScope
to all the three contexts. It is working fine. The issue I am facing is that all the breadcrumbs and tag data are separate between the three processes (nothing is shared).
So,
- when there any updates to the scope data - for example: the ID of the currently logged in user - I need to propagate that updates to all the three contexts and that's a lot of work to code up and do correctly.
- if there are any breadcrumbs, I only get the breadcrumbs from the context where this issue happened (let's say sandbox), and not the other contexts (service worker and the offscreen documents). This results in an incomplete understanding of the issue.
Question: what is a feature that SentryJS can implement to better support these use cases. As I mentioned at the beginning, with the upcoming Manifest V3 architecture, this scenario is going to be a lot more common.
Solution Brainstorm
I had one idea: allow me to initialise a "master" sentry context, and then once (at the initialisation step) I will setup the message hooks to connect other Sentry contexts with the master context. Then, from there on, SentryJS can internally use the provided message hooks to propagate updates from master to all the clients, and unify all the breadcrumbs (and other data) whenever any event occurs.
Metadata
Assignees
Type
Projects
Status
No status
Status
Waiting for: Community
Activity