When I add script tag with src (i.e. <script type="text/javascript" src="chrome://foo/foo.js" />), it isn't available in the script tag and therefore it can't be debugged. (files from http protocol works fine and in 1.0 it worked both)
Code (supply js url): var e = document.createElement("script"); e.setAttribute("type", "text/javascript"); e.setAttribute("src", "chrome://foo/content/foo.js"); document.body.appendChild(e);
Comment #1
Posted on Apr 29, 2008 by Quick ElephantYes, chrome urls are filtered out. I'll have to see if there is a way around this. Which version are you running?
Comment #2
Posted on May 1, 2008 by Quick ElephantIf you supply a test case I will take a look. Thanks.
Comment #3
Posted on Sep 7, 2008 by Quick ElephantI tried your code in the command line of Firebug 1.3a1 on Firefox 3.0.1. I got: Security Error: Content at http://code.google.com/p/fbug/issues/list?q=label:commandLine&updated=595&ts=1220761106&can=1 may not load or link to chrome://foo/content/foo.js
So I guess the problem is not to critical since normally chrome urls are not allowed.
Comment #4
Posted on Apr 16, 2009 by Quick ElephantTo make progress this issue needs a test case.
Comment #5
Posted on Mar 26, 2010 by Helpful CatI have the same problem. My config is:
- Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.9.1.8) Gecko/20100202 Firefox/3.5.8
- Firebug 1.5.3
- and (since today) Chromebug 1.6.0a7
Before today I could never debug any script from chrome URLs with FB. They just didn't show up in the Script section of FB. There's really nothing showing up there. But script errors show up in the console section. But when I click on the URL in the error message no debug occurs, but the source of the JS pops up in a FF source code window with the line of error selected.
A few minutes ago, I installed Chromebug. Now, when I open the FB panel within the tab where my Chrome url/Xul file is loaded, there appears a drop-down list button labeled with the name of the Xul file. In the textbox beneath the text: "1 Filtered chrome url chrome://myxul/content/galleryManager/galleryManager.xul" appears. When I push the button there's a list that contains also the (three) JS files that are included in the Xul file (they have also a Chrome URL). I can check these list items, too. If I check e.g. one of the JS files, the drop-down list collapses and the name of the file becomes the new label of the button; the text beneath changes to the new filepath. But when I click the button again, the label and the text is changed back to the former Xul file, before the dd list becomes visible; the JS file is still checked! When I make the list disappear and click the button again, also the hook has been changed to the former Xul file. Nevertheless, if I repeat this procedure sometimes this behaviour disappears and changes to "normal" behaviour. Then the "pathologic" behaviour re-establishes, then again not, and so on.
On the top of the dd list I can see the message: "Warning. Script Panel was inactive during page load".
Yesterday in the about:config I set - extensions.firebug.service.showAllSourceFiles;true Meanwhile I set also - extensions.chromebug.showChromeErrors;true - extensions.chromebug.showChromeMessages;true
After I made the last two settings, there appeared an option in the Script section pop-up menu (when you click on the little arrow button right to the label "Script" of the Script tab) saying "Show chrome sources" (in my FB actually in German).
When I activated the "break on all errors" option in the Script section and reloaded the page -- nothing happens in the Script section. Except that the button with the Xul file completely disappears; only the button "All" remains available. I have to close and reopen the FB panel to make the other button show up again. Then the hook in the dd list is at the Xul file again, no matter what was checked before. When I then switch to the Console section I can now see several errors caused by FB:
(The entries with a small "x" where present before I installed Chromebug and are caused by my own script code. All errors except the "Invalid ..." are marked with a white cross in a red bullet. No traceback available. "Zeile 707" means "Line 707".) x Invalid chrome URI: / X Firebug cannot find _firebugConsole element true Window galleryManager.xul X Firebug cannot find firebugCommandLineAttached attribute on firebug console element, its too early for command line Window galleryManager.xul X uncaught exception: _FirebugCommandLine init failed in chrome://myxul/content/galleryManager/galleryManager.xul because TypeError: window.loadFirebugConsole is not a function [Break on this error] (no source for ) x andSynCat.dynObj is undefined [Break on this error] Filtered chrome url chrome://programs/content/JavaScript/xmlParser.js xmlParser.js (Zeile 707) X Firebug cannot find firebugCommandLineAttached attribute on firebug console element, its too early for command line Window galleryManager.xul x Invalid chrome URI: /
Right now, when I switch from this tab to the tab where the Xul file is loaded and the FB panel is opened, FF freezes for several seconds (30 and more). When I switch off the "break on all errors" option this behaviour disappears.
I'm now going to try Venkman in a portable version of FF to see, if that works better. But I would prefer to use FB instead of Venkman.
What kind of test-case do you need for this problem? I'm not a pro in reporting and talking about errors in extensions. I don't understand much of the text in the error report and talk in the issues on this page (not in this issue) at all. So don't expect too much from me in creating a test-case, but I would be happy to help.
Comment #6
Posted on Mar 26, 2010 by Quick ElephantI can't make out what problem is being reported here.
For generic discussions please use the newsgroup.
Firebug is designed to debug Web pages (only). Chromebug works for chrome urls. This bug report is about Firebug, therefore I believe the answer should be "working as designed". But perhaps I don't understand the issue here.
Comment #7
Posted on Apr 29, 2010 by Helpful CatThis is not a generic discussion. My Problem is just as mentioned in the title of this issue: "javascript from chrome URLs cannot be debugged". The URL of the JS is "chrome://myxul/content/galleryManager/galleryManager.js" and this script is included with a tag into an XUL source (which is also loaded via a chrome URL).
I don't understand the relation between Firebug and Chromebug completly. The latter seemed to me kind of a "Plug-in" for Firebug. I considered Chromebug--if installed--to enable Firebug to debug chrome URLs. Is that wrong? Obviously it changed the functionality of Firebug slightly after installation, but in an errorful way, as mentioned above.
The issue here is, that neither Firebug nor Chromebug nor the combination of both debug JS from chrome URLs. But mayby it's my fault and I don't understand the topics of this issue.
And sorry for the late answer, I thought I'd get an e-mail notification on a new comment, but I didn't.
Comment #8
Posted on Apr 29, 2010 by Swift CatChromebug will debug js from chrome urls. We do it every day. http://getfirebug.com/wiki/index.php/Chromebug_User_Guide
If Chromebug fails for you I'll try to fix it. But to do so I need an example that shows how it fails. In using Chromebug you don't need to open Firebug. Look for your js in the Files menu of Chromebug. Loading XUL in to a Firefox tab may be one case that does not work, I don't know since I've never heard of anyone doing that.
Comment #9
Posted on May 1, 2010 by Helpful CatOk, obviously it runs now on my XUL. Thank you. If now it does the same good job as Firebug for non-XUL documents, I will be glad.
I'm a complete newbee to XUL. This may explain my problems. I would never have got the idea that I have to start Firefox with a command line parameter. (E.g. Venkman didn't need that.) I thought Chromebug to be (after installation) part of Firebug and I never before had an add-on that needed this.
Maybe this should be stressed out more clearly in the User Guide. E.g. the text: "To start Chromebug then firefox use:", is kind of confusing, since I don't know why I should want to start Chromebug alone and after that start Firefox, or more generalized, start at first an add-on of Firefox and after that Firefox itself, this appears fairly senseless. This seems like a special usage for some special (undetermined) reason. But I want to start "Firefox WITH Chromebug". So maybe you should change that text a little bit.
This is the same with the sentence: "Install an exactly matching version of Firebug". As I was up to install Chromebug I had already installed Firebug and tested it via the add-ons panel to be the newest version--which is still 1.5.3, at least as far as it seems to be checkable by the add-ons panel functionality. But there is no version 1.5.3 of Chromebug! It was quite not obvious that there are by some reason some other "special" versions of Firebug behind that link in the User Guide and that, for that reason, I had follow that link.
You may also make clear in the User Guide that the version numbers must match, just the same way as it is mentioned in the introduction window of Chromebug itself. This might also lead more newbies like me to click that link to look, whether there is something to find, what the usual update process of Firefox didn't find.
Thanks Markus
Comment #10
Posted on Jun 13, 2010 by Quick Elephanthttp://getfirebug.com/releases/chromebug supports debugging chrome URLs
Status: Fixed
Labels:
Type-Defect
Priority-Medium
debugger
1.0
chromebug
Test-case-needed