Using webRequest.onHeadersReceived causes Edge to download the page rather than navigate

Fixed, flighted Issue #8796739


Sep 8, 2016
This issue is public.
Fixed in build #
Reported by 12 people

Sign in to watch or report this issue.

Steps to reproduce

Sideload an extension that modifies headers inside onHeadersReceived in Edge

Navigate to


Edge navigates successfully


Edge downloads the page and does not navigate

Additional Information

This does not occur in Chrome


uBlock-Edge repro steps

The repro steps are pretty simple:

the preview release from the store:

it on in Edge



The page
loads successfully

The page is
downloaded by the browser


Comments and activity

  • Microsoft Edge Team

    Changed Assigned To to “Venkat K.”

    Changed Assigned To from “Venkat K.” to “Rajat J.”

  • We are seeing a similar error. Modifying the content-type header causes the request to fail (webRequest.onErrorOccurred is triggered) and Edge offers to download the file. This is not the behavior of Chrome.

  • Microsoft Edge Team

    Changed Steps to Reproduce

  • I have added an attachment containing an Extension that demonstrates the problem. The attachment contains both Chrome and Edge versions. The Edge version was created from the Chrome version using the Microsoft Edge Extension Toolkit.

    1. In Edge, load and enable the attached Header Mod Test extension from the “Header Mod Test - Edge” folder. The extension uses webRequest.onHeadersReceived() to change the Content-Type header to “text/html” when it is received as "image/cpi".

    2. Open the following link:

    If you look at the console, you will see that the after the extension modifies the Content-Type header, the request gets an error via WebRequest.onErrorOccurred:

    TEST MOD ERROR: Error 0x80004004 [object Object] Extension.js (44,13)
    “TEST MOD ERROR: Error 0x80004004”
    [functions]: ,
    proto: { },
    error: "Error 0x80004004",
    frameId: 0,
    fromCache: false,
    ip: "",
    method: "GET",
    parentFrameId: -1,
    requestId: "1B34-9DDDFD7-2",
    tabId: 2,
    timeStamp: 1482294137498,
    type: "main_frame",
    url: “

    Edge should have rendered the binary data as gibberish text in the current tab. This is what happens in Chrome and Firefox. It is also consistent with the documentation which states that if you modify the headers, "The browser will behave as if the server had sent the modified headers.". The extension changes the Content-Type to "text/html", so the browser should behave as if the server sent the binary data as html.

    We use this feature to implement a Chrome Extension viewer for our proprietary image format ( After the extension changes the content-type, Chrome navigates to the url as if it is ordinary html, and our extension injects a content-script into the incoming binary data that provides the viewer UI and renders the images from the binary data.

    We would like to add support for Edge to our viewer. If modifying the content-type header is not supported in Edge, is there an alternative Extension API that allows an Extension to handle the display of a proprietary mime type?

  • Microsoft Edge Team

    Changed Status to “Confirmed”

    Changed Status from “Confirmed” to “In code review”

    Changed Status from “In code review” to “In progress”

    Changed Assigned To from “Rajat J.” to “Scott L.”

    Changed Status from “In progress” to “Fixed, not yet flighted”

    Changed Status from “Fixed, not yet flighted” to “Fixed, flighted”

  • Hi thank you for fixing this!

    When will this be released? Not familiar with your release cycle.

  • Microsoft Edge Team

    Changed Assigned To to “Rajat J.”

    Changed Status from “Fixed, flighted”

    Changed Steps to Reproduce

    Changed Assigned To from “Rajat J.” to “Scott L.”

    Changed Status to “Fixed, flighted”

  • Hello,

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

    Best Wishes,

    The MS Edge Team

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

Sign in