puter
puter copied to clipboard
Feature Request: Allow apps to determine their initial window dimensions
As an app developer I would like to have a way to suggest the window height and width of my app on initial load. Either
- in the developer app as part of the config for my app
- some way for the app itself to know what it's dimensions are and to be able to resize them on the fly
You can already know the app window dimensions but you cannot resize them. Using window.innerWidth
and window.innerHeight
you can get the size of the window that your app was opened in. I am using these properties to determine the window size in my app. https://puter.com/app/livewinsize
As @Axorax explained you can get the size of the window. But you're right, you can't resize the window using the SDK. I think this is a good idea, but I need to understand the security/abuse implications (I don't think there are any, but I wonder why browsers don't have it)
I've seen other implementations where if the size is below or above certain thresholds, they are ignored - this prevents abuse with too large or too small.
I would think that it would be okay to resize as long as permission is granted by the user.
On Tue, Mar 12, 2024 at 19:04 Andrew Wooldridge @.***> wrote:
I've seen other implementations where if the size is below or above certain thresholds, they are ignored - this prevents abuse with too large or too small.
— Reply to this email directly, view it on GitHub https://github.com/HeyPuter/puter/issues/81#issuecomment-1992715874, or unsubscribe https://github.com/notifications/unsubscribe-auth/AALVWWUBRXDWDYO2FYTD7STYX6CWDAVCNFSM6AAAAABESPMO3SVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSOJSG4YTKOBXGQ . You are receiving this because you are subscribed to this thread.Message ID: @.***>
I've seen other implementations where if the size is below or above certain thresholds, they are ignored - this prevents abuse with too large or too small.
I think this is the most appropriate implementation.
I would think that it would be okay to resize as long as permission is granted by the user.
this could work too but I wonder if displaying a dialog asking for resize permission is a little unfamiliar to the user.