Bug 1252077 - The debugger should identify Scratchpad sources as JavaScript;r=jlong
authorEddy Bruel <ejpbruel@mozilla.com>
Fri, 04 Mar 2016 13:01:47 +0100
changeset 325137 c3a501635246e9e7408d3f00e2c778dedaf8e22b
parent 325136 e082689e684d1bac1255f29786befe907fbf5942
child 325138 d53f6871ec137d77e57f53fe8cf90da8afe0e671
push id1128
push userjlund@mozilla.com
push dateWed, 01 Jun 2016 01:31:59 +0000
treeherdermozilla-release@fe0d30de989d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjlong
bugs1252077
milestone47.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1252077 - The debugger should identify Scratchpad sources as JavaScript;r=jlong
devtools/server/actors/utils/TabSources.js
--- a/devtools/server/actors/utils/TabSources.js
+++ b/devtools/server/actors/utils/TabSources.js
@@ -298,17 +298,19 @@ TabSources.prototype = {
     // script element, or does not have a src attribute.
     let element = aSource.element ? aSource.element.unsafeDereference() : null;
     if (element && (element.tagName !== "SCRIPT" || !element.hasAttribute("src"))) {
       spec.isInlineSource = true;
     } else {
       if (url) {
         // There are a few special URLs that we know are JavaScript:
         // inline `javascript:` and code coming from the console
-        if (url.indexOf("javascript:") === 0 || url === 'debugger eval code') {
+        if (url.indexOf("Scratchpad/") === 0 ||
+            url.indexOf("javascript:") === 0 ||
+            url === "debugger eval code") {
           spec.contentType = "text/javascript";
         } else {
           try {
             let pathname = new URL(url).pathname;
             let filename = pathname.slice(pathname.lastIndexOf("/") + 1);
             let index = filename.lastIndexOf(".");
             let extension = index >= 0 ? filename.slice(index + 1) : "";
             if (extension === "xml") {