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

[feature] support workers #23

Open
Salakar opened this issue Jan 5, 2024 · 1 comment
Open

[feature] support workers #23

Salakar opened this issue Jan 5, 2024 · 1 comment
Assignees

Comments

@Salakar
Copy link

Salakar commented Jan 5, 2024

Thanks for this extension, do you have any plans to support workers, e.g. selecting a worker in chrome and console.diff does not exist currently and is only available on 'top':

image
image

@zendive
Copy link
Owner

zendive commented Jan 5, 2024

@Salakar appreciate. There is no extension API for injecting content scripts into page workers. Only to tab's page and its iframes. Also, due to an asynchronous nature of communication between content scripts and devtools panel of this extension, its not helphul to use it in step by step debuging mode (cause injected content-script is also becomes paused).

Howether, you can delegate the comparison of your worker context objects to a main thread (or top context) for example:

// worker
self.postMessage({type: 'compare', left, right});
// main thread
workerInstance.addEventListener('message', (e) => {
  if (e.data.type === 'compare') {
    console.diff?.(e.data.left, e.data.right);
  }
});

Reminder: the code not for production

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

2 participants