Is it possible to detect when I click on the "Background Page" for my test plugin on the "chrome://extensions/" page? This question has been boggling my mind.
Currently, whenever I open the background page, the console remains undocked. After reading a post on Stack Overflow about detecting if the Chrome console is open (https://stackoverflow.com/questions/7798748/find-out-whether-chrome-console-is-open), I tried implementing the suggested solution within each content script. But, I struggle to make the plugin itself detect its own console opening.
Even after incorporating the function discussed in the aforementioned post into my background.js
, it doesn't seem to pick up on anything:
chrome.tabs.query({url:'chrome-devtools://*/*'}, function(tabs){
if (tabs.length > 0){
console.log('opened');
}
});
I would greatly appreciate any guidance or advice on this matter.