4

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...

2 Answers 2

14

Use the resizable flag.

chrome.app.window.create("YourPage.html", {
    "bounds": {
        "width": 320,
        "height": 240,
    },
    "resizable": false,
});
2
  • Can you tell the window to open fullscreen?
    – Kokodoko
    Mar 13, 2014 at 17:39
  • @Greg, what about preventing it from scaling only up or only down? Let's say I would't like a user to scale a window below 300x300? Aug 4, 2015 at 6:25
3

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.

1
  • 1
    This is now deprecated. Use resizable: false.
    – Grumdrig
    Feb 4, 2015 at 7:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.