How to control frame height and width in chrome extension?

I am working with the chrome extension.

Here, by clicking the button, I have to open the menu. When the toolbar is loaded into memory, it creates space for the menu item that I want to delete in the page load.

Before button clickAfter click button

+4
source share
1 answer

Assuming there are no visible elements above 100 pixels on the popup page:

document.body.style.height="100px"; document.getElementsByTagName("html")[0].style.height="100px"; 

If this does not work, then some element is still considered visible (Chrome is misleading).

The best way to understand this is to use the popup inspector.

  • Right-click on the pop-up window icon, select "View Pop-up Window".
  • Set height for <html> and <body> elements
  • Set height for your container div
  • Play with height , overflow:hidden , float:left , display:none in the div container and its children until the pop-up window is reduced to the required height.
+1
source

All Articles