summaryrefslogtreecommitdiffstats
path: root/WebCore/inspector/front-end/SourceView.js
diff options
context:
space:
mode:
Diffstat (limited to 'WebCore/inspector/front-end/SourceView.js')
-rw-r--r--WebCore/inspector/front-end/SourceView.js7
1 files changed, 5 insertions, 2 deletions
diff --git a/WebCore/inspector/front-end/SourceView.js b/WebCore/inspector/front-end/SourceView.js
index 7510c8c..97a5bd5 100644
--- a/WebCore/inspector/front-end/SourceView.js
+++ b/WebCore/inspector/front-end/SourceView.js
@@ -104,8 +104,11 @@ WebInspector.SourceView.prototype = {
{
delete this._frameNeedsSetup;
this.sourceFrame.removeEventListener("content loaded", this._contentLoaded, this);
-
- if (this.resource.type === WebInspector.Resource.Type.Script) {
+
+ if (this.resource.type === WebInspector.Resource.Type.Script
+ || this.resource.mimeType === 'application/json'
+ || this.resource.mimeType === 'application/javascript'
+ || /\.js(on)?$/.test(this.resource.lastPathComponent) ) {
this.sourceFrame.addEventListener("syntax highlighting complete", this._syntaxHighlightingComplete, this);
this.sourceFrame.syntaxHighlightJavascript();
} else