Skip to content

Commit

Permalink
Add more mime types support for devtools
Browse files Browse the repository at this point in the history
  • Loading branch information
yren93 committed May 19, 2021
1 parent 1df3fb0 commit 0490e39
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/content/browser/devtools/devtools_http_handler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -416,6 +416,22 @@ static std::string GetMimeType(const std::string& filename) {
base::CompareCase::INSENSITIVE_ASCII)) {
return "image/svg+xml";
}

// blpwtk2: adapted from chrome/browser/ui/webui/devtools_ui_data_source.cc
else if (base::EndsWith(filename, ".mjs",
base::CompareCase::INSENSITIVE_ASCII)) {
return "application/javascript";
} else if (base::EndsWith(filename, ".map",
base::CompareCase::INSENSITIVE_ASCII)) {
return "application/json";
} else if (base::EndsWith(filename, ".ts",
base::CompareCase::INSENSITIVE_ASCII)) {
return "application/x-typescript";
} else if (base::EndsWith(filename, ".manifest",
base::CompareCase::INSENSITIVE_ASCII)) {
return "text/cache-manifest";
}

LOG(ERROR) << "GetMimeType doesn't know mime type for: "
<< filename
<< " text/plain will be returned";
Expand Down

0 comments on commit 0490e39

Please sign in to comment.