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

Add support for Microsoft Edge via Edge Diagnostics Adaptor #21

Closed
auchenberg opened this issue Apr 15, 2016 · 8 comments
Closed

Add support for Microsoft Edge via Edge Diagnostics Adaptor #21

auchenberg opened this issue Apr 15, 2016 · 8 comments

Comments

@auchenberg
Copy link

We at Microsoft has now made it possible to debug Microsoft Edge via Edge Diagnostics Adaptor over the Chrome Debugging Protocol.

It has a protocol.json file which could be fetched from the repo at https://github.com/Microsoft/edge-diagnostics-adaptor/blob/master/protocol.json, or we could add an HTTP endpoint to fetch it from something like /json/protocol directly from the adaptor.

We think it cold be exciting to have this library working with multiple browsers supporting the Chrome Debugging Protocol.

Are you interested in collaboration?

@cyrus-and
Copy link
Owner

This sounds interesting! I'll play around with the adaptor as soon as I manage to get a Windows 10 box up and running.

Anyway, if the adaptor behaves exactly as the original Remote Debugging Protocol this library should already work with it. The only difference would be the protocol.json, but now it is possible to provide a custom descriptor at initialization. I'll try this as a first step.

Also, related to #17, I was trying to add support for native ES6 promises to the current API; basically a promise is returned when the callback is omitted. I believe that maintaining both paradigms may be useful. This feature is mostly done, I'll merge it soon.

@auchenberg
Copy link
Author

Great! We also released https://github.com/microsoft/edge-diagnostics-launch, which is a node wrapper that fetches the adaptor binary and launches Edge with a given URL. That should make integration even easier.

I'll give the feeding of the protocol.json a spin right away.

@auchenberg
Copy link
Author

Works perfectly. Here's a GIST that shows an example of chrome-remote-interface working with Edge.
https://gist.github.com/auchenberg/355b77886a5b93427d2ff6c592f4b064

@cyrus-and
Copy link
Owner

Hmm, I don't seem to be able to make it work, while the HTTP API works I cannot connect to the WebSocket. Here's what I tried:

  1. start Edge;

  2. start EdgeDiagnosticsAdapter.exe:

    Edge Diagnostics Adapter
    Could not set ACL to allow access to IE EPM or Edge.
    Error Code: 1332
    You can set the ACL manually by adding Read & Execute permissions for 'All APPLICATION PACAKGES' to each dll.
    Proxy server listening on port 9222...
    
  3. start chrome-repl and EdgeDiagnosticsAdapter.exe prints:

    DEBUG MESSAGE: Attempting to attach to 64 bit tab
    Connection rejected for: /devtools/page/E8A36086-8AFC-4300-AC94-8322FB2DC812
    [2016-04-24 20:01:41] [error] Handshake ended with HTTP error: 400
    

I'm trying this in a (64 bit) VM. I get similar results with a 32 bit laptop, the difference is that here I don't get the DEBUG MESSAGE: Attempting to attach to 64 bit tab message.

@auchenberg
Copy link
Author

@cyrus-and I opened an issue on the adapter, microsoft/edge-diagnostics-adapter#19

cyrus-and added a commit that referenced this issue Apr 25, 2016
cyrus-and added a commit that referenced this issue Apr 25, 2016
Edge already supports the remote debugging protocol (via Edge Diagnostics
Adaptor). This commit allows to fetch the JSON protocol directly from Edge
itself.  Since it is not possible to do the same with Chrome, some changes were
needed in order to provide a consistent API:

* the protocol is fetched *remotely* by default (from the repository, for what
  concerns Chrome and from `/json/protocol`, for what concerns Edge);

* the boolean returned by `Chrome.Protocol()` method is now named `fallback`
  instead of `fromChrome` (and the semantics changed accordingly).

Related to #21 and closes #24.
@andysterland
Copy link

[Cross posting from the Edge adapter issue 19]

@cyrus-and

Hmmm. Honestly not sure what happened here. I believe that error code basically means it couldn't find the builtin name 'ALL APPLICATION PACKAGES' msdn. But that name should exsist on Win10 (and down to Windows 8). If you:

  1. Find the proxy.dll and proxy64.dll
  2. Right click on the dll and properties
  3. Go to the Security panel
  4. Edit
  5. Add..
  6. Make sure you have the location to your local machine name (and not a domain etc.)
  7. Search for ALL APPLICATION PACKAGES (type it in the box)
  8. Check Names this should resolve the name and underline it (if this fails we have a problem!)
  9. Ok OK, OK
  10. Now try it...

Fwiw and this is probably unrelated but the binaries should be somewhere local and not ran from a share.

@cyrus-and
Copy link
Owner

@auchenberg I finally managed (thanks to @andysterland) to fix this.

After some very brief testing, the support for Edge seems to work properly. :) I'm going to bump a new release and push it on NPM. Let me know if you come across any issues.

@auchenberg
Copy link
Author

Yay 🎉 Big day!

We'll let you know if issues arise. Thanks for the help!

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

3 participants