简体   繁体   中英

Fixed window size in a chrome extension

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?

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]);
})

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM