summaryrefslogtreecommitdiffstats
path: root/webkit
diff options
context:
space:
mode:
Diffstat (limited to 'webkit')
-rw-r--r--webkit/glue/devtools/js/devtools.js17
-rw-r--r--webkit/glue/devtools/js/inspector_controller_impl.js13
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);
};