N
N
Nadim Zakirov2020-01-22 18:37:29
JavaScript
Nadim Zakirov, 2020-01-22 18:37:29

How to pass message from devtools.js to background.js in Google Chrome extension?

I want to pass information about network connections to the background page for further processing:

chrome.devtools.network.onRequestFinished.addListener(
  function(request) {
    chrome.extension.sendMessage(request.request.url);
  }
);

However, sendMessage doesn't work inside devtools.html/devtools.js =(
How to correctly pass a message to devtools.js ➜ background.js?
And tell me if connection messages will come at all if the developer console is not open?
Yes, I read the documentation and there it is written that the chrome.devtools.* toolkit only works from devtools.js and only while the console is open. However, if this is true, then I don’t understand how this extension works, for example . It does not require opening the console, but connecting like- it shows!

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question