diff options
author | yurys@google.com <yurys@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-29 09:34:37 +0000 |
---|---|---|
committer | yurys@google.com <yurys@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-29 09:34:37 +0000 |
commit | 15efd3cf409b8004e483783c0e88239c9f24c60d (patch) | |
tree | 1cb7a56c32122f8032712744363d3742d3c031b5 | |
parent | 345a8b7973e6693d115d20573f7cef17e4525cb3 (diff) | |
download | chromium_src-15efd3cf409b8004e483783c0e88239c9f24c60d.zip chromium_src-15efd3cf409b8004e483783c0e88239c9f24c60d.tar.gz chromium_src-15efd3cf409b8004e483783c0e88239c9f24c60d.tar.bz2 |
DevTools: temporary fix for bug 23260. Guess resource type and content mimeType based on file extension.BUG=23260
Review URL: http://codereview.chromium.org/249032
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@27473 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | webkit/glue/devtools/js/devtools.js | 17 | ||||
-rw-r--r-- | webkit/glue/devtools/js/inspector_controller_impl.js | 13 |
2 files changed, 29 insertions, 1 deletions
diff --git a/webkit/glue/devtools/js/devtools.js b/webkit/glue/devtools/js/devtools.js index 335ee7f..8ae71c9 100644 --- a/webkit/glue/devtools/js/devtools.js +++ b/webkit/glue/devtools/js/devtools.js @@ -410,3 +410,20 @@ WebInspector.ConsoleMessage.prototype.setMessageBody = function(args) { orig.call(this, args); }; })(); + +// Temporary fix for http://crbug/23260. +(function() { +var orig = WebInspector.ResourcesPanel.prototype._createResourceView; +WebInspector.ResourcesPanel.prototype._createResourceView = function( + resource) { + if (resource.type == undefined && resource.url) { + if (resource.url.search('\.js$') != -1) { + resource.type = WebInspector.Resource.Type.Script; + } else if (scriptOrResource.url.search('\.html$') != -1) { + resource.type = WebInspector.Resource.Type.Document; + } + } + + return orig.apply(this, arguments); +}; +})(); diff --git a/webkit/glue/devtools/js/inspector_controller_impl.js b/webkit/glue/devtools/js/inspector_controller_impl.js index 2b9f10a..8f20e8e 100644 --- a/webkit/glue/devtools/js/inspector_controller_impl.js +++ b/webkit/glue/devtools/js/inspector_controller_impl.js @@ -124,7 +124,18 @@ devtools.InspectorControllerImpl.prototype.addResourceSourceToFrame = if (!resource) { return; } - DevToolsHost.addResourceSourceToFrame(identifier, resource.mimeType, element); + + // Temporary fix for http://crbug/23260. + var mimeType = resource.mimeType; + if (!mimeType && resource.url) { + if (resource.url.search('\.js$') != -1) { + mimeType = 'application/x-javascript'; + } else if (resource.url.search('\.html$') != -1) { + mimeType = 'text/html'; + } + } + + DevToolsHost.addResourceSourceToFrame(identifier, mimeType, element); }; |