python-eel / Eel

A little Python library for making simple Electron-like HTML/JS GUI apps
MIT License
6.44k stars 587 forks source link

Unable to set the window size #489

Open thakreyn opened 3 years ago

thakreyn commented 3 years ago

The browser window for the application always opens in full-screen mode despite specifying the size and position. How do I get around this and set the appropriate size.

Code snippet(s) Here is some code that can be easily used to reproduce the problem or understand what I need help with. Python file:

import eel

eel.init('web')

eel.start('index.html', size=(1280, 720))

HTML:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Game layout test</title>
</head>
<body bgcolor="red">
    <h1>Test</h1>
</body>
</html>

Desktop:

evheniu commented 3 years ago

Before you need to install "Google chrome browser".

import eel

eel.init('web')

eel.start('index.html', size=(1280, 720), mode='chrome')
thakreyn commented 3 years ago

Before you need to install "Google chrome browser".

import eel

eel.init('web')

eel.start('index.html', size=(1280, 720), mode='chrome')

Thank you for your response, I already have Google Chrome installed on my system. It still does not work. I tried using 'edge' but its still the same.

chmandzhiev commented 3 years ago

The browser window for the application always opens in full-screen mode despite specifying the size and position. How do I get around this and set the appropriate size.

Code snippet(s) Here is some code that can be easily used to reproduce the problem or understand what I need help with. Python file:

import eel

eel.init('web')

eel.start('index.html', size=(1280, 720))

HTML:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Game layout test</title>
</head>
<body bgcolor="red">
    <h1>Test</h1>
</body>
</html>

Desktop:

  • OS: Windows 10
  • Browser: Chrome (Version 91.0.4472.77 (Official Build) (64-bit))

To solve this problem, you can try: Add to head index.html even though eel.js file doesn't exist

omarcostahamido commented 2 years ago

To solve this problem, you can try: Add to head index.html even though eel.js file doesn't exist

Thank you.

@chmandzhiev answer should be added to the documentation somewhere.