So, I have this Chrome extension that downloads content from the Internet. Basically, the user clicks on the pop-up window icon, then some JavaScript on the base page loads some page, analyzes the image and puts it on the popup.html page. The problem is that popup.html does not resize to fit the actual size of the content. I saw a couple of similar questions here in StackOverflow, everyone answered "put <!DOCTYPE html>on top of your popup.html page", which in my case does not work. The size of the pop-up window remains very small (about 1 cm square).
I used to have some CSS style that fixed width and height, but I noticed that my content is not always the same size, so I would like the popup.html page to automatically resize to fit the content.
I know that in the worst case, I could parse the width and height of the image and set it as CSS, but I feel that there is a more elegant solution.
thank
source
share