Love Dager
Love Dager

Reputation: 2311

How to prevent resizing a Chrome Packaged App?

I've just jumped into developing apps for chrome, and just started with the "Hello World" example. My first thing I wanted to change is to prevent resizing of the window, I've searched and got nothing... :(

So, is this even possible right now?

Also, reading the documentation it says 'panel' is non-resizable,but at least in windows it is...

Upvotes: 4

Views: 4934

Answers (2)

Greg
Greg

Reputation: 21909

Use the resizable flag.

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

Upvotes: 14

Vincent Scheib
Vincent Scheib

Reputation: 18620

Specify min and max width and height when creating a window to constrain it. You can set min and max to the same value to make the window non-resizable.

E.g., here is a modified main.js from the Hello World sample:

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

For more details, see the app window api.

Upvotes: 3

Related Questions