Eel: Changing window's size and position doesn't work

Created on 6 Feb 2020  路  5Comments  路  Source: ChrisKnott/Eel

Describe the problem
I am trying to add a frontend, using Eel, to my Python app. I want the only browser window that the app opens to be of a certain size and position. Running below code opens a chrome window of the default size (the size of the las opened and modified window).
Please help!

Code snippet(s)

import eel
eel.init('web', allowed_extensions=['.js', '.html'])
eel.start('main.html', geometry={'size': (200, 100), 'position': (50, 50)}) 

<!DOCTYPE html>
<html>
  <head>
    <title class="title">Hello, World!</title>
    <script type="text/javascript" src="/eel.js"></script>
  </head>

  <body>
    Hello, World!
  </body>
</html>

Desktop (please complete the following information):

  • OS: Windows 10 ( version 1909
  • Browser: Chrome
  • Chrome version: 79.0.3945.130
help wanted

Most helpful comment

EDIT: It must have been a bug; I have once more tested it and it works just fine !

All 5 comments

@TheBdouilleur Not sure why geometry isn't working in your example, but you could try this as an alternative

eel.start('index.html', size=(1024, 768), position=(0,0))

This is what I use in mine and it does it exactly as you expect it to

Thank you @Zeerti, running eel.start('index.html', size=(1024, 768), position=(0,0)) doesn't work either.
Maybe the problem is a setting on my system or on Chrome ?

EDIT: I just tried running eel.start('index.html', mode='edge', size=(1024, 768), position=(0,0)) but it doesn't work either.

EDIT: It must have been a bug; I have once more tested it and it works just fine !

@TheBdouilleur glad to hear it :)

Was this page helpful?
0 / 5 - 0 ratings