Answer the question
In order to leave comments, you need to log in
How to resize Popup window using buttons in Chrome extension?
There is an extension. By clicking on the button on the browser panel, a Popup window opens, for which popup.html is responsible.
There are 2 css files in the root of the extension folder. Let's
call them
style1.cssand
style2.css
Answer the question
In order to leave comments, you need to log in
There is no API in chrome to change the poput size! All these configurations are read from manifest.json once and it is impossible to resize from JS!
And if, when you click on the button using JS, add / remove the class from the top element
.mobile | .desktop, or just add and remove the .mobile class.
Well, tweak the style file a little so that it takes this into account.
//Вешаем обработчик событий на контейнер с popup
document.querySelector('.container')
.addEventListener('click', ({target}) => /<Id твоей кнопки>/.test(target.classList.join(''))
? /** Делаешь, что тебе нужно */
: false)/** Ничего не делаешь /*
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question