Commit 8ea03d47 authored by Tim van der Lippe's avatar Tim van der Lippe Committed by Commit Bot

Add support for fetching .mjs files in DevTools

We will soon be using `acorn.mjs`, which would previously throw errors
when loading, as `type="module"` enforces strict MIMEtype checking.

Bug: 1011811
Change-Id: I1eaea02f94ebf74ee8fc32678cf29dde86c25b2c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2212124
Auto-Submit: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Andrey Kosyakov <caseq@chromium.org>
Reviewed-by: default avatarAndrey Kosyakov <caseq@chromium.org>
Cr-Commit-Position: refs/heads/master@{#771219}
parent 9588121d
...@@ -57,6 +57,8 @@ std::string GetMimeTypeForPath(const std::string& path) { ...@@ -57,6 +57,8 @@ std::string GetMimeTypeForPath(const std::string& path) {
base::CompareCase::INSENSITIVE_ASCII)) { base::CompareCase::INSENSITIVE_ASCII)) {
return "text/css"; return "text/css";
} else if (base::EndsWith(filename, ".js", } else if (base::EndsWith(filename, ".js",
base::CompareCase::INSENSITIVE_ASCII) ||
base::EndsWith(filename, ".mjs",
base::CompareCase::INSENSITIVE_ASCII)) { base::CompareCase::INSENSITIVE_ASCII)) {
return "application/javascript"; return "application/javascript";
} else if (base::EndsWith(filename, ".png", } else if (base::EndsWith(filename, ".png",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment