Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Attempts to add support for resource:// URLs.

Fix: "newURI(" throws an error when URLs has three slashes "///" such "resource:///modules/XPIProvider.jsm", and these end 'unblockable'.
  • Loading branch information...
commit 742d0ad38a6550f386564e0e1fc080054f8e2c06 1 parent f015ef1
@titoBouzout authored
View
10 chrome/content/console2/console2.css
@@ -77,17 +77,21 @@ sourcelink > label {
.console-box:not([modeLang~="CSS"]) > .console-row[category~="CSS"],
.console-box:not([modeLang~="XML"]) > .console-row[category]:not([category~="javascript"]):not([category~="JavaScript"]):not([category~="CSS"]),
-.console-box:not([modeCtx~="Chrome"]) > .console-row[category~="chrome"],
+.console-box:not([modeCtx~="Chrome"]) > .console-row[category~="chrome"]:not([href^="resource://"]),
.console-box:not([modeCtx~="Chrome"]) > .console-row[category~="component"],
.console-box:not([modeCtx~="Chrome"]) > .console-row[category~="XPConnect"],
.console-box:not([modeCtx~="Chrome"]) > .console-row[href^="chrome://"],
-.console-box:not([modeCtx~="Chrome"]) > .console-row[href^="resource://"],
+/*.console-box:not([modeCtx~="Chrome"]) > .console-row[href^="resource://"],*/
.console-box:not([modeCtx~="Chrome"]) > .console-row[type="error"]:not([category]),
.console-box:not([modeCtx~="Content"]) > .console-row:not([category]):not([href^="chrome://"]):not([type="error"]),
-.console-box:not([modeCtx~="Content"]) > .console-row[category]:not([category~="chrome"]):not([category~="component"]):not([category~="XPConnect"]):not([href^="chrome://"]):not([href^="resource://"]),
+.console-box:not([modeCtx~="Content"]) > .console-row[category]:not([category~="chrome"]):not([category~="component"]):not([category~="XPConnect"]):not([href^="chrome://"])
+/*:not([href^="resource://"])*/
+,
.console-box[dupes="false"] > .console-row[dupe="true"],
+.console-box:not([modeCtx~="Resource"]) > .console-row[href^="resource://"],
+
.console-row[type="hidden"] {
display: none;
}
View
10 chrome/content/console2/console2.js
@@ -9,7 +9,7 @@ var gCodeToEvaluate = null;
var gModes = { // set to defaults
"": { "Errors": true, "Warnings": true, "Messages": true },
"Lang": { "JS": true, "CSS": false, "XML": false },
- "Ctx": { "Chrome": false, "Content": true }
+ "Ctx": { "Chrome": false, "Content": true , "Resource": false }
};
var Cc = Components.classes;
@@ -375,13 +375,13 @@ var gBlacklist = ("@mozilla.org/permissionmanager;1" in Cc)?{
{
if (this.isSupported(aURL))
{
- this.mPermissionManager.add(this.mIOService.newURI(aURL, null, null), "console2", this.DENY_DOMAIN);
+ this.mPermissionManager.add(this.mIOService.newURI(aURL.replace(/\:\/\/+/, '://'), null, null), "console2", this.DENY_DOMAIN);
}
},
isSupported: function(aURL)
{
- return /^(https?|chrome):\/+./.test(aURL);
+ return /^(https?|chrome|resource):\/+./.test(aURL);
}
}:{ // non-persisting version for Thunderbird
mIOService: Cc["@mozilla.org/network/io-service;1"].getService(Ci.nsIIOService),
@@ -431,13 +431,13 @@ var gBlacklist = ("@mozilla.org/permissionmanager;1" in Cc)?{
{
if (this.isSupported(aURL))
{
- this.mBlocking[this.mIOService.newURI(aURL, null, null).host] = true;
+ this.mBlocking[this.mIOService.newURI(aURL.replace(/\:\/\/+/, '://'), null, null).host] = true;
}
},
isSupported: function(aURL)
{
- return /^(https?|chrome):\/+./.test(aURL);
+ return /^(https?|chrome|resource):\/+./.test(aURL);
}
};
View
2  chrome/content/console2/console2.xml
@@ -184,7 +184,7 @@
if (aMessage.sourceName)
{
- row.setAttribute("href", aMessage.sourceName);
+ row.setAttribute("href", aMessage.sourceName.replace(/\:\/\/+/, '://'));
row.setAttribute("line", aMessage.lineNumber || 0);
}
else
View
5 chrome/content/console2/console2.xul
@@ -69,6 +69,7 @@
<broadcaster id="Console:modeLangXML" label="&lang.xml.label;" oncommand="toggleMode('XML', 'Lang');"/>
<broadcaster id="Console:modeCtxChrome" label="&ctx.chr.label;" oncommand="toggleMode('Chrome', 'Ctx');"/>
<broadcaster id="Console:modeCtxContent" label="&ctx.cnt.label;" oncommand="toggleMode('Content', 'Ctx');"/>
+ <broadcaster id="Console:modeCtxResource" label="Resource" oncommand="toggleMode('Resource', 'Ctx');"/>
<broadcaster id="Console:modeDupes" label="&dupes.label;" oncommand="toggleDupes();"/>
</broadcasterset>
@@ -97,6 +98,7 @@
<menuitem type="radio" group="ctx" label="&ctx.all.label;" accesskey="&ctx.all.accesskey;" _mode="All"/>
<menuitem type="radio" group="ctx" label="&ctx.chr.label;" accesskey="&ctx.chr.accesskey;" _mode="Chrome"/>
<menuitem type="radio" group="ctx" label="&ctx.cnt.label;" accesskey="&ctx.cnt.accesskey;" _mode="Content"/>
+ <menuitem type="radio" group="ctx" label="Resource" accesskey="Z" _mode="Resource"/>
</menupopup>
</toolbarbutton>
@@ -111,6 +113,7 @@
<toolbarbutton id="item_modeCtxChrome" type="checkbox" observes="Console:modeCtxChrome" accesskey="&ctx.chr2.accesskey;" tooltiptext="&ctx.chr.tooltip;" class="textonly"/>
<toolbarbutton id="item_modeCtxContent" type="checkbox" observes="Console:modeCtxContent" accesskey="&ctx.cnt2.accesskey;" tooltiptext="&ctx.cnt.tooltip;" class="textonly"/>
+ <toolbarbutton id="item_modeCtxResource" type="checkbox" observes="Console:modeCtxResource" accesskey="Z" tooltiptext="Resource" class="textonly"/>
<toolbarbutton id="item_clearConsole" label="&clear.label;" accesskey="&clear.accesskey;" tooltiptext="&clear.tooltip;" oncommand="clearConsole();"/>
<toolbarbutton id="item_copyItem" observes="cmd_copy" label="&copyCmd.label;" tooltiptext="&copyCmd.tooltip;" class="textonly"/>
@@ -184,7 +187,7 @@
accesskey="&extBar.accesskey;"
customizable="true"
nowindowdrag="true"
- defaultset="item_modeLangJS,item_modeLangCSS,item_modeLangXML,separator,item_modeCtxChrome,item_modeCtxContent,spring,menu_consoleTools"
+ defaultset="item_modeLangJS,item_modeLangCSS,item_modeLangXML,separator,item_modeCtxChrome,item_modeCtxContent,item_modeCtxResouce,spring,menu_consoleTools"
context="ToolbarContext"/>
<toolbar id="ToolbarEval"
class="chromeclass-toolbar"
View
1  chrome/content/console2/suite/consoleOverlay.xul
@@ -188,6 +188,7 @@
<toolbarbutton id="item_modeCtxChrome" accesskey="&ctx.chr3.accesskey;"/>
<toolbarbutton id="item_modeCtxContent" accesskey="&ctx.cnt3.accesskey;"/>
+ <toolbarbutton id="item_modeCtxResource" accesskey="Z"/>
<toolbarbutton id="ButtonEval" accesskey="&evaluate3.accesskey;"/>
<toolbarbutton id="menu_consoleTools" accesskey="&tools3.accesskey;"/>
View
BIN  console2-0.8r.xpi
Binary file not shown
View
2  install.rdf
@@ -5,7 +5,7 @@
<id>{1280606b-2510-4fe0-97ef-9b5a22eafe80}</id>
<name>Console²</name>
- <version>0.8</version>
+ <version>0.8r</version>
<type>2</type><!-- extension -->
<unpack>false</unpack>
Please sign in to comment.
Something went wrong with that request. Please try again.