Question

Does anyone know how to open new with specific size? brackets object does not contain any function to do that - there's only 2 brackets.app and brackets.fs object. Also if you try to open new window with

window.open("http://stackoverflow.com","some title","width=500,height=500");

it won't set the window size.

Any ideas/suggestions?

Was it helpful?

Solution

It looks like a bug in brackets-shell that the size you specify is getting ignored. (It could also be bug in CEF, the underlying Chromium wrapper that brackets-shell uses, but this implies it normally works in vanilla CEF – I'm guessing it's broken by the brackets-shell code that remembers your last window size across launches).

However, it's not a good idea to open an arbitrary website inside the Brackets shell itself. For one thing, you won't get back/forward buttons, or an address bar, or any of the other standard browser functionality. If you want to open an external website, use NativeApp.openURLInDefaultBrowser() instead (though just like clicking a link in any other app, you won't get to pick the window size). Or if you're building some UI that's more like a Brackets feature (not a remote URL), then it'd be much easier to use in-window popups instead – see the Dialogs API.

OTHER TIPS

That is how you open a new window, and set the size. I would assume you are coming across something else in your code, that is causing an error that you are not seeing.

Try binding it to a event call, like during a click event. Posting the code this applies to will help.

I'm guessing it's broken by the brackets-shell code that remembers your last window size across launches

Can anyone point to this code so I can take a look at it? Just get me close...

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top