I am trying to mimic the “Toggle Device Toolbar” click into a chrome extension.
I would like to have this extension to click and toggle device mode, since my company doesn’t allow us to use the devtools neither 3rd party extensions.
Could you guys help me with it?
I have tried with:
<code>window.resize()
</code>
<code>window.resize()
</code>
window.resize()
(in this case this is only resizing the window, but doesn’t trigger the device changing.
or
<code>chrome.windows.update(currWindowId, {
width: 375,
height: 812,
});
</code>
<code>chrome.windows.update(currWindowId, {
width: 375,
height: 812,
});
</code>
chrome.windows.update(currWindowId, {
width: 375,
height: 812,
});
But nothing seems to be working.
The expected behavior is literally clicking and the DOM should be a mobile version, or desktop by clicking back, with React or even with vanilla js.
Thanks!