Access localhost via Microsoft Edge extension background page

By design Issue #8984919

Details

Author
Fish B.
Created
Sep 20, 2016
Privacy
This issue is public.
Reports
Reported by 6 people

Sign in to watch or report this issue.

Steps to reproduce

Recently we migrated a Chrome extension to Microsoft Edge. For Edge hasn’t implemented native messaging, so we want to communicate with native app by websocket via Edge extension background page.

After testing, we found that, in the background page websocket can access external host successfully, but localhost, even though access ‘127.0.0.1’ failed. And we try to access localhost in the web page, it did!

Edge browser info: userAgent: “Mozilla/5.0 (Windows NT 10.0; Win64; x64; ServiceUI 8) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.79 Safari/537.36 Edge/14.14393” We have checked "Allow localhost loopback (this might put your device at risk)" from about:flags.

Does Edge extension background page support access localhost? If it does, how can we achieve it? If not, could anyone help?

We run the WebSocket server as this example: https://blog.idrsolutions.com/2013/12/websockets-an-introduction/.

The extension can be downloaded from: https://github.com/chhxia/Edge-Extension.

Attachments

Comments and activity

  • Microsoft Edge Team

    Changed Assigned To to “Brad E.”

  • I’m not 100% sure if it does or not but I do have a couple of things to try. And a few questions regarding the extension I got from your GitHub link.

    First try this:
    1.) Add localhost to your intranet sites in IE 11
    2.) Add it to your trusted sites
    3.) Even though it may be strange, try adding an entry to your hosts file and see if that changes anything

    Where do I look to see the failure of WebSocket requests sent to localhost? I do not see anything in the network tab when I inspect the background page. Do I need to inspect traffic with Fiddler or Wireshark?

  • This item of
    feedback will be closed out soon due to inactivity. Please provide any details
    that you have so that we can investigate further and prevent closure of the
    item.

     

    All the best,

    The MS Edge Team

  • Hello,
    Sorry that I did not clearly state the extension.
    To test the extension:
    1 run the WebSocket server as this example: https://blog.idrsolutions.com/2013/12/websockets-an-introduction/.

    1. load the extension to Edge
    2. open Edge extension panel, make extension “WebSocket_BackgroundPage” to "show button next to the address bar’
    3. click the extension button next to the address bar, we will open a websocket, If it is open successfully, alert "open…", otherwise, alert “close…”

    Every time click the extension button, alert "close…";

    Add localhost to your intranet sites in IE 11
    Also alert “close…”
    No exception.

    Thanks for your help!

  • Microsoft Edge Team

    Changed Status to “Confirmed”

    Changed Status from “Confirmed” to “By design”

  • We are working on Native Messaging for the next release and using native messaging is the right way to solve this scenario. Localhost access is not enabled from extension background page is by design.

    All the best,
    The MS Edge Team

  • Hi, Brad
    Could you tell the time of next release?
    Our project need it to make plan.

    Thanks.

  • Hi, Brad
    I have checked from https://developer.microsoft.com/en-us/microsoft-edge/platform/changelog/
    the latest 14951 does not have the native message update.
    Could you tell which release will contain the native message feature?

    Best wishes
    BurningFish

  • Hi Brad,

    In our project also important to have a connection with desktop application. So I wanted to know is there are exist raw estimation when we can play with native messaging?

    Kostiantyn

  • Hi Brad,

    It’s also crucial in our project to connect with native application from background page, please kindly share if you have raw estimation when we can expect the native messaging.

    Easton

You need to sign in to your Microsoft account to add a comment.

Sign in