Index: chrome/browser/renderer_host/buffered_resource_handler.cc |
diff --git a/chrome/browser/renderer_host/buffered_resource_handler.cc b/chrome/browser/renderer_host/buffered_resource_handler.cc |
index 33e6489c6b2fb0e2df89fd35be861393b7ab691d..097cd17e5cad007f81adeb4c713da33b3e6e26b5 100644 |
--- a/chrome/browser/renderer_host/buffered_resource_handler.cc |
+++ b/chrome/browser/renderer_host/buffered_resource_handler.cc |
@@ -15,6 +15,7 @@ |
#include "chrome/browser/renderer_host/resource_dispatcher_host.h" |
#include "chrome/browser/renderer_host/resource_dispatcher_host_request_info.h" |
#include "chrome/browser/renderer_host/x509_user_cert_resource_handler.h" |
+#include "chrome/common/extensions/user_script.h" |
#include "chrome/common/url_constants.h" |
#include "net/base/io_buffer.h" |
#include "net/base/mime_sniffer.h" |
@@ -448,6 +449,10 @@ bool BufferedResourceHandler::ShouldDownload(bool* need_plugin_list) { |
return true; |
} |
+ // Special-case user scripts to get downloaded instead of viewed. |
+ if (UserScript::HasUserScriptFileExtension(request_->url())) |
+ return true; |
+ |
// MIME type checking. |
if (net::IsSupportedMimeType(type)) |
return false; |