Question

I'm building a Google Chrome Extension. I want to create a popup window using the chrome.windows.create API. Everything works but I don't know how to create the window with fixed size( user can't resize the window, also the maximize button should be disabled). Is it possible to do this?

Was it helpful?

Solution

Modern browsers such as Google Chrome tend not to allow this because it is seen as a user unfriendly limitation.

Still, you can force a window to keep its initial size using jquery as showed it this question: Disable Browser Window Resize.

var size = [window.width,window.height];

$(window).resize(function(){
    window.resizeTo(size[0],size[1]);
})
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top