| Index: third_party/WebKit/Source/core/dom/ScriptLoader.cpp
|
| diff --git a/third_party/WebKit/Source/core/dom/ScriptLoader.cpp b/third_party/WebKit/Source/core/dom/ScriptLoader.cpp
|
| index ed5c0f3b2cb0978ec4f3a670470b771a4cfc23eb..ffebfa4db4587c37ef4d17ee35fcf30536cdca9c 100644
|
| --- a/third_party/WebKit/Source/core/dom/ScriptLoader.cpp
|
| +++ b/third_party/WebKit/Source/core/dom/ScriptLoader.cpp
|
| @@ -388,9 +388,16 @@ bool ScriptLoader::executeScript(const ScriptSourceCode& sourceCode)
|
| }
|
|
|
| String mimetype = resource->httpContentType();
|
| - if (mimetype.startsWith("image/")) {
|
| + if (mimetype.startsWith("image/") || mimetype == "text/csv" || mimetype.startsWith("audio/") || mimetype.startsWith("video/")) {
|
| contextDocument->addConsoleMessage(ConsoleMessage::create(SecurityMessageSource, ErrorMessageLevel, "Refused to execute script from '" + resource->url().elidedString() + "' because its MIME type ('" + mimetype + "') is not executable."));
|
| - UseCounter::count(frame, UseCounter::BlockedSniffingImageToScript);
|
| + if (mimetype.startsWith("image/"))
|
| + UseCounter::count(frame, UseCounter::BlockedSniffingImageToScript);
|
| + else if (mimetype.startsWith("audio/"))
|
| + UseCounter::count(frame, UseCounter::BlockedSniffingAudioToScript);
|
| + else if (mimetype.startsWith("video/"))
|
| + UseCounter::count(frame, UseCounter::BlockedSniffingVideoToScript);
|
| + else if (mimetype == "text/csv")
|
| + UseCounter::count(frame, UseCounter::BlockedSniffingCSVToScript);
|
| return false;
|
| }
|
|
|
|
|