Dynamically creating a style element triggers a XHR request to ""

Fixed Issue #14214977

Details

Author
Jerome L.
Created
Oct 13, 2017
Privacy
This issue is public.
Found in
  • Microsoft Edge
Reports
Reported by 1 person

Sign in to watch or report this issue.

Steps to reproduce

Adding a style element dynamically triggers a XHR request to "". Therefore, if my base tag defines the base as /foo, a XHR request to /foo will be triggered, which might end up responding a 404 error.

Look at the Network tab in the dev tools to see the request.

Here’s a simple HTML snippet to reproduce the issue.

<html>
    <head>
        <base href="/foo"></base>
    </head>
    <body>
        <script>
            function createStyleElement() {
                document.head.appendChild(document.createElement('style'))
            }
        </script>
        When dynamically creating a style element, a request to the base URL (here /foo) is made (see the Network tab in the dev tools).<br>
        <button onclick="createStyleElement()">Create style element</button>
    </body>
</html>

Attachments

1 attachment

Comments and activity

  • Microsoft Edge Team

    Changed Assigned To to “James M.”

    Changed Status to “Fixed”

  • Hello,

    Thank you for providing this information about the issue. We are pleased to report this feature is fixed in Edge 16299 and is available in our latest Insider Preview build in the Fast ring.

    Best Wishes,
    The MS Edge Team

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

Sign in