RFE - Add the ability to filter what URLs are reported in the console



Toolkit Graveyard
Error Console
13 years ago
a year ago


(Reporter: Devon Miller, Unassigned)


(Depends on: 1 bug)





13 years ago
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; rv:1.7.3) Gecko/20040913 Firefox/0.10
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; rv:1.7.3) Gecko/20040913 Firefox/0.10

When I'm debugging javascript in my application, I set javascript.options.strict
to true. Unfortunately, this means that if I open another window to search for
some information, the JavaScript Concole gets flooded with errors and warnings
from that other site.

I would like the ability to restrict to the JavaScript Concole only display
errors from the site or sites I am debugging.

1) Ideally, there should be the ability to define an accept-list of URLs.

Only errors/warnings from the sites/pages matched by the list would be displayed
in the JavaScript Concole. For example entering "mysite.com" would indicate that
I am only interested in messages from www.mysite.com, cgi.mysite.com, etc.
Entering "*.mysite.com" would allow www.mysite.com, but would ignore mysite.com.
And, entering "http://mysite.com,myothersite.com/js" would allow non-secure
pages from mysite.com and either secure or non-secure pages starting with /js/
from myothersite.com. This can also be described in the negative as
"*.mysite.com,!cgi.mysite.com" would allow statis.mysite.com and www.mysite.com,
but would ignore cgi.mysite.com"

2) Alternatively, there should be an option to filter the messages displayed in
the JavaScript Concole as is done in the about:config page.

Reproducible: Always
Steps to Reproduce:
Depends on: 228205


13 years ago
Ever confirmed: true
I'm thinking this is an excellent idea, but maybe not in exactly the way the
reporter thinks.

Here's what I'm thinking:

javascript.options.uri.whitelist (string)
javascript.options.uri.blacklist (string, default to "chrome://")
javascript.options.url.favorwhitelist (boolean, default to true)
javascript.options.messages (boolean, default to false)
javascript.options.strict (boolean, already there)

The first two would indicate partial URLs, first by protocol (http://,
chrome://, data://, etc.), then by hostname, port, and pathname in that order. 
Subdomains (bugzilla.mozilla.org) in the whitelist would take precedence over
normal domains (mozilla.org).  The idea is that specific rules take precedence
over general ones.

Providing part of the parameter in the whitelist means blanket approval for
everything that doesn't have a more specific parameter in the blacklist, and
vice versa.  We would show console messages from the whitelist and exclude those
from the blacklist.  Where neither list defines specifically enough for a
particular URL of the console message, the favorwhitelist if true means show the

The javascript.options.message flag toggles whether the console reports messages
or not.  Most people would not care about them.

A fix like this would deprecate the javascript.options.showInConsole preference,
as we'd instead add "chrome://" to the blacklist for the same effect.

I'd be willing to work on a fix for this, assuming someone told me how to parse
a URL string into a location object with the right properties.
I forgot to mention:

That's where at least half of the fix for this would take place.
I'd like to have module owner feedback, please, contrasting this bug to bug
228205.  228205's approach is preferable to the one I'm considering here, but
not much in the way of traction.  This one, with nsIIOService, could have a
patch relatively quickly.
Personnally i'd like a very simple way to debug only one tab. I would open the
page, open the js console and I could indicate to this console to only debug the
page in question (maybe with a drop-down list with all opened tabs, selecting
the page in this drop-down list would only display errors about this page in the

Comment 5

13 years ago
*** Bug 133565 has been marked as a duplicate of this bug. ***

Comment 6

13 years ago
take a look at:

Console Filter helps you to find the relevant errors in the JavaScript Console.

perhaps we can port this to the javascript console so that we dont need a extension?


12 years ago
Blocks: 66425

Comment 7

12 years ago
Reporter: Are you sure you want something this fine-grained? How about doing what is suggested in bug 302211?

Comment 8

12 years ago
bug 302211 is about filtering the type of error, not the source of the error.

I am currently using the Console2 extension:   
to restrict what is shown, but it only allows me a single filter term.

So I can enter "foo" to only show messages from "foo.com". But, when I'm developing pages for "foo.com" and loading JS from "bar.com", I have no way to specify that I want to see messages from "foo" and "bar". 

I have resorted to running a separate browser so when I google for something the console doesn't get flooded.


11 years ago
No longer blocks: 66425


9 years ago
Product: Core → SeaMonkey


8 years ago
Assignee: error-console → nobody
Component: Error Console → Error Console
Product: SeaMonkey → Toolkit
QA Contact: jrgmorrison → error.console

Comment 9

7 years ago
Given the notoriously bad JS written by eg. Yahoo, not being able to filter the originator is pretty much a major annoyance!
Bug 760951 added a filter.
Last Resolved: 5 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 760951


a year ago
Product: Toolkit → Toolkit Graveyard
You need to log in before you can comment on or make changes to this bug.