How to prevent Chrome Packaged app from resizing?

I just switched to developing applications for chrome and just started with the Hello World example. My first thing I wanted to change was to prevent the window from being resized, I searched and got nothing ... :(

So is this possible now?

In addition, reading the documentation that says β€œpanel” cannot be changed, but at least in windows it ...

+4
source share
2 answers

Use the resize flag.

chrome.app.window.create("YourPage.html", { "bounds": { "width": 320, "height": 240, }, "resizable": false, }); 
+13
source

Specify the minimum and maximum width and height when creating the window to limit it. You can set min and max to the same value so that the window does not change.

For example, here is the main.js change from the Hello World example:

 chrome.app.runtime.onLaunched.addListener(function() { chrome.app.window.create('index.html', {minWidth: 500, minHeight: 309, maxWidth: 500, maxHeight: 309}); }); 

See api application window for details.

+3
source

All Articles