Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Microsoft Edge (Chromium) app mode #251

Open
ncotrb opened this issue Mar 3, 2020 · 5 comments
Open

Microsoft Edge (Chromium) app mode #251

ncotrb opened this issue Mar 3, 2020 · 5 comments
Assignees

Comments

@ncotrb
Copy link

ncotrb commented Mar 3, 2020

Dear EEL team, thank you for this incredibly useful module! It is a successful lightweight alternative to Electron. I'm currently building a simple app with EEL. =)

Feature request description
The Microsoft Edge Browser (from version 79.0.309 on) is based on Chromium, which opens up completely new possibilities. Microsoft is currently shipping an update (KB 4541302), which automatically updates Edge to this new base in almost every Win10 installation.

I noticed that you can now use APP MODE with Edge (Chromium) just like Google Chrome. This results in much better app windows even for users who don't have Gooogle Chrome installed.

To use the app mode, 'edge.py' has to be adjusted as follows:

import sys, subprocess as sps, os

name = 'Edge'

def run(path, options, start_urls):
    if path != 'edge_legacy':
        if options['app_mode']:
            for url in start_urls:
                sps.Popen([path, '--app=%s' % url] + options['cmdline_args'], 
                        stdout=sps.PIPE, stderr=sps.PIPE, stdin=sps.PIPE)
        else:
            args = options['cmdline_args'] + start_urls
            sps.Popen([path, '--new-window'] + args,
                    stdout=sps.PIPE, stderr=sys.stderr, stdin=sps.PIPE)
    else:
        cmd = 'start microsoft-edge:{}'.format(start_urls[0])
        sps.Popen(cmd, stdout=sys.stdout, stderr=sys.stderr, stdin=sps.PIPE, shell=True)

def find_path():
    if sys.platform in ['win32', 'win64']:
        return _find_edge_win()
    else:
        return None

def _find_edge_win():
    import winreg as reg
    reg_path = r'SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\msedge.exe'

    for install_type in reg.HKEY_CURRENT_USER, reg.HKEY_LOCAL_MACHINE:
        try:
            reg_key = reg.OpenKey(install_type, reg_path, 0, reg.KEY_READ)
            edge_path = reg.QueryValue(reg_key, None)
            reg_key.Close()
            if not os.path.isfile(edge_path):
                continue
        except WindowsError:
            edge_path = 'edge_legacy'
        else:
            break

    return edge_path

If the new Edge (Chromium) Browser is not found in the system there is a fallback to the old Edge Browser.

julesontheroad added a commit to julesontheroad/NSC_BUILDER that referenced this issue Mar 10, 2020
julesontheroad added a commit to julesontheroad/NSC_BUILDER that referenced this issue Jun 30, 2020
@samuelhwilliams
Copy link
Collaborator

Hey @ncotrb - this looks great. Thanks for sharing it with us. I'm going to keep this open as it looks like a useful feature to add. Sorry it's taken so long. Hopefully we can get it in soon 🤞

@tobikuch
Copy link

The Code of @ncotrb is working for me, too. Is there any update on adding this feature? Would be very helpful for us.

@EricSamsonG2
Copy link

This works great for me as well. This would be a great thing to implement.

@samuelhwilliams
Copy link
Collaborator

Thanks for reviving - I had lost track of this one. I'll try to get it in a state to merge, though I don't have much time with Windows development these days. If anyone wants to put up a PR before I do, that would be welcomed 👍

@samuelhwilliams samuelhwilliams self-assigned this Feb 9, 2023
@samuelhwilliams samuelhwilliams pinned this issue Feb 9, 2023
@doug-benn doug-benn mentioned this issue Feb 13, 2023
@aqasemi
Copy link

aqasemi commented Dec 2, 2023

Hey, any idea why this hasn't been merged yet?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants