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 support #35

Closed
nickmccurdy opened this issue Jun 18, 2015 · 14 comments
Closed

Microsoft Edge support #35

nickmccurdy opened this issue Jun 18, 2015 · 14 comments

Comments

@nickmccurdy
Copy link
Contributor

I am interested in contributing to a Karma launcher for Microsoft Edge. Would it be best to fork this, create a new launcher from scratch, or treat Edge as another version of IE?

In my opinion, forking would be better. Edge can share IE's code for launching the EXE, though it would be better to keep the versioning scheme separate and drop support for things that may not be needed (such as x-au-compatible).

@dignifiedquire
Copy link
Member

Hey, great to hear. I think it would be nice to have support in the IE launcher for Edge, as we do something similar for the other launchers, e.g. the Chrome launcher can handle Chromium, Chrome Canary and Dart. You can take a look at how it's done at the moment here for Chrome.
So I would suggest something like that, maybe with splitting it up into multiple files though would be nicer.

@nickmccurdy
Copy link
Contributor Author

I think that Edge is going in a different direction than IE despite being based off of it, so in my opinion I'm not sure how easy it would be to treat Edge as another version of IE (and Microsoft might eventually deprecate IE in the future). That being said, there is still some similarity in how they need to be launched. I will keep investigating how it would be to include Edge support in this same launcher plugin.

Here are some of the differences that Edge has with IE that will affect us:

  • x-au-compatible is unnecessary (Edge doesn't support it because it does not have legacy browser support).
  • Edge is a Modern application, so the executable lives in a different place and has an ID appended to its filename. Additionally, Edge is an appx file instead of an exe file. This would cause the biggest differences with launching Edge vs. IE from the command line.
  • Edge removes legacy features from IE, and tries to render pages more similarly to WebKit.
  • Edge is only for Windows 10+. If I remember correctly, most Karma runners that are OS-specific simply don't launch a browser if they don't have them installed, so we might want to silently fail as well if it isn't too confusing.

@dignifiedquire
Copy link
Member

Thanks for the detailed explanation. In that case it could make sense to put it into a different package.
At the moment most of the launchers all have their own logic, more or less the same for detecting executables, maybe we could extract this logic into a package and use this in both places?
If you want I can create a new karma-edge-launcher repo and give you access to work on it.

@nickmccurdy
Copy link
Contributor Author

I started a fork, I'll see how it goes.

At the moment most of the launchers all have their own logic, more or less the same for detecting executables, maybe we could extract this logic into a package and use this in both places?

This sounds awesome. However, I'm starting to think that the Edge launcher will not only need to be launched differently, but it might also involve changes to Karma itself (because Microsoft Edge is not an EXE and Karma launches EXEs on Windows). If we can get around that, it would be cool to have a shared library for launching browsers across operating systems.

If you want I can create a new karma-edge-launcher repo and give you access to work on it.

If you want, thanks! I don't have a working implementation that will actually launch Edge yet, so if you want I can keep using my fork and then maybe move it to the organization later.

@dignifiedquire
Copy link
Member

As long as spawn supports starting edge it shoiukdn'y be a problem passing that to Karma.

Sure, you can work on your fork and when you are ready just let me know and we can pull it in :)

Let me know if you have any more questions.

@nickmccurdy
Copy link
Contributor Author

Thanks!

I assume you're talking about child_process.spawn()? If so, I'm having a hard time using it to successfully launch Edge. It seems like you can't run it like a normal executable file.

@dignifiedquire
Copy link
Member

Yes I am, that's what's karma is using to spawn processes. Not sure how up to date node is on the window side of things, might be best to look in the issue tracker/mailing list if there is something known about it.

@nickmccurdy
Copy link
Contributor Author

Thanks for your help, I managed to figure out a way to get the Karma launcher to launch Edge.

I am now running into issues with getting Karma to wait for the results from the launcher. I must use another process to launch Edge (I don't think it's possible to launch it directly), which causes Karma to prematurely stop waiting for the launcher because it thinks that Edge has crashed (when what really happened is that its launching process closed). I have opened a GitHub issue for this on the main Karma repo, please let me know if you have any ideas or recommendations: karma-runner/karma#1469

@PGrimes
Copy link

PGrimes commented Sep 18, 2015

The powershell approach taken in the fork seems to work. for keeping the process around.

@nickmccurdy
Copy link
Contributor Author

nickmccurdy commented Apr 30, 2016

I wrote an issue about the progress of my fork:

Microsoft just released the Edge Diagnostics Adapter for debugging Edge. Since it's tricky to launch Edge as a modern-style app (and there are still bugs on master currently), I'm going to try switching to this adapter.

If you're interested, you can track my progress in this pull request.

I plan on finishing this soon, which should make it ready to publish shortly after.

@nickmccurdy
Copy link
Contributor Author

My Edge fork is mostly working now, and I have an experimental version of it published on npm. It relies on Microsoft Edge Launcher, a command line exe launcher, to keep the browser open (I had a hard time getting this to work consistently with Node and PowerShell).

If it helps, I would be fine with moving it to the karma-runner organization, assuming it's stable enough for that.

@nickmccurdy
Copy link
Contributor Author

See karma-edge-launcher.

@mgol
Copy link

mgol commented Mar 20, 2017

@nickmccurdy Could your fork be moved into the karma-runner organization now?

@nickmccurdy
Copy link
Contributor Author

I would like to, but I don't have permission to do it on my own. See nickmccurdy/karma-edge-launcher#2.

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

4 participants