Index: Source/devtools/front_end/SourceMap.js |
diff --git a/Source/devtools/front_end/SourceMap.js b/Source/devtools/front_end/SourceMap.js |
index 9aff06c0f79b58375e96d79da2a863bc791e7240..802b2df86b2cc0c3acd0909a245c9924c596096a 100644 |
--- a/Source/devtools/front_end/SourceMap.js |
+++ b/Source/devtools/front_end/SourceMap.js |
@@ -109,16 +109,16 @@ WebInspector.SourceMap.prototype = { |
/** |
* @param {string} sourceURL |
* @param {WebInspector.ResourceType} contentType |
- * @param {string=} mimeType |
* @return {WebInspector.ContentProvider} |
*/ |
- sourceContentProvider: function(sourceURL, contentType, mimeType) |
+ sourceContentProvider: function(sourceURL, contentType) |
{ |
- // FIXME: We should detect mime type automatically (e.g. based on file extension) |
+ var lastIndexOfDot = sourceURL.lastIndexOf("."); |
+ var extension = lastIndexOfDot !== -1 ? sourceURL.substr(lastIndexOfDot + 1) : ""; |
+ var mimeType = WebInspector.ResourceType.mimeTypesForExtensions[extension.toLowerCase()]; |
var sourceContent = this.sourceContent(sourceURL); |
- var contentProvider; |
if (sourceContent) |
- return new WebInspector.StaticContentProvider(contentType, sourceContent); |
+ return new WebInspector.StaticContentProvider(contentType, sourceContent, mimeType); |
return new WebInspector.CompilerSourceMappingContentProvider(sourceURL, contentType, mimeType); |
}, |