Using a Chrome extension to resize undocked dev tools window

249 views Asked by At

There's a bug on Vivaldi browser which will probably remain unfixed for the upcoming months: undocked dev tools windows do not remember their previous size across tabs, so each time you open dev tools they are small. There's also another dev tools bug which I'd like to workaround which includes focusing the dev tools window. Those bugs are driving me nuts!

So, I tried to create a Chrome extension and see if that could catch the dev tools opening event and resize the dev tools undocked window.

The first part, I've done it by using a content script which catches f12 and ctrl+shift+i and other ways of opening dev tools. Then, the content script sends a message to a background script and it should resize the opened dev tools window.

Here's the problem: there doesn't seem to be any way to get opened dev tools window in Chrome Extension API. I can get all the opened normal windows, but from that same API (chrome.windows) I can't find opened dev tools windows. Is there any way one can access opened dev tools windows?

I tried using chrome.devtools API but that's only accessible inside dev tools panels. Being this a private extension which will never get published, I can also try to use chrome.developerPrivate and other private APIs, but I don't know how to make them work.

Do you have any idea on how to proceed to get all opened dev tools windows? Could it be there isn't a way? If there isn't a way, could you maybe point me in the right direction into using private Chrome APIs in any way?

0

There are 0 answers