Console Filter 0.3 [discontinued]

Talk about add-ons and extension development.
User avatar
Philip Chee
Posts: 6475
Joined: March 1st, 2005, 3:03 pm
Contact:

Post by Philip Chee »

Add test for existence of map method:

Code: Select all

      // function introduced in JavaScript 1.6 (Gecko 1.8)
   if (!Array.prototype.map) {
      Array.prototype.map = function(aFunc)
      {
         var newArray = new Array();
         
         for (var i = 0; i < this.length; i++)
         {
            newArray[i] = aFunc(this[i], i);
         }
         
         return newArray;
      }
   }

Add test for Bug 296700:

Code: Select all

      // since the console's keyset doesn't have an id, it can't be overlayed (see Bug 296700)
   if (!document.getElementById("consoleKeys") {
      window.addEventListener("load", function() {
User avatar
Philip Chee
Posts: 6475
Joined: March 1st, 2005, 3:03 pm
Contact:

Post by Philip Chee »

Code: Select all

if (/^ConsoleFilter\./.test(keys[i].getAttribute("oncommand")))
What does this do?
old zeniko
Posts: 0
Joined: December 31st, 1969, 5:00 pm

Post by old zeniko »

onemen wrote:can u add Show All button to clear the filter like in about:config

I'd rather save the space for the filter box itself (the Web Search box I'm mimiking doesn't have such a button either). I could offer you however a <Show All> entry in the drop-down menu...

@Philip Chee:
Do you insist on those tests? Both the map method and the fix for Bug 296700 are included in Gecko 1.8 (among others in the upcoming Firefox 1.5), which doesn't include the patch-aviary.js file, since that file is only referenced in contents.rdf, but not in chrome.manifest.

Philip Chee wrote:

Code: Select all

if (/^ConsoleFilter\./.test(keys[i].getAttribute("oncommand")))
What does this do?

This determines whether a <key> is one of Console Filter's which should be manually added to the main keyset (part of the work-around for Bug 296700). The test relies on the fact that the commands of all of CF's keys refer to a method of the global object ConsoleFilter.
User avatar
Philip Chee
Posts: 6475
Joined: March 1st, 2005, 3:03 pm
Contact:

Post by Philip Chee »

zeniko wrote:@Philip Chee:
Do you insist on those tests? Both the map method and the fix for Bug 296700 are included in Gecko 1.8 (among others in the upcoming Firefox 1.5), which doesn't include the patch-aviary.js file, since that file is only referenced in contents.rdf, but not in chrome.manifest.
I don't insist on anything! I just thought that someone might implement the javascript array libraries as an extension for gecko 1.7 browsers then there might be a conflict. I've seen several subtly different versions that implement these new methods out there.

Also there are several extensions like Multizilla and (probably) All-in-One-Sidebar that replace console.xul with their own versions that might implement a keyset ID.
zeniko wrote:
Philip Chee wrote:

Code: Select all

if (/^ConsoleFilter\./.test(keys[i].getAttribute("oncommand")))
What does this do?

This determines whether a <key> is one of Console Filter's which should be manually added to the main keyset (part of the work-around for Bug 296700). The test relies on the fact that the commands of all of CF's keys refer to a method of the global object ConsoleFilter.
So why don't you give them a custom property e.g. consolefilterkey="true" and then use getElementsByAttribute(in DOMString name, in DOMString value):

Code: Select all

<key key="K" modifiers="accel" consolefilterkey="true" oncommand="ConsoleFilter.focus();"/>
<key key="Q" modifiers="accel" consolefilterkey="true" oncommand="ConsoleFilter.focus();"/>
....
var keys = getElementsByAttribute("consolefilterkey", "true")
keys.forEach(keyset.appendChild)
If you are going to implement array.map you might as well implement array.forEach
old zeniko
Posts: 0
Joined: December 31st, 1969, 5:00 pm

Post by old zeniko »

Philip Chee wrote:I don't insist on anything! I just thought that someone might implement the javascript array libraries as an extension for gecko 1.7 browsers then there might be a conflict. I've seen several subtly different versions that implement these new methods out there.

Alright, that's convincing. I'll readd the conditional.

Philip Chee wrote:Also there are several extensions like Multizilla and (probably) All-in-One-Sidebar that replace console.xul with their own versions that might implement a keyset ID.

True, but the id might vary. Anyway, in the worst case, I duplicate the keys, which shouldn't have any impact, at all.

Philip Chee wrote:So why don't you give them a custom property e.g. consolefilterkey="true" and then use getElementsByAttribute(in DOMString name, in DOMString value):

Good idea, I'll look into it.
Old Regis
Posts: 0
Joined: December 31st, 1969, 5:00 pm

Post by Old Regis »

Nice extension, its really cool to be able to get ride of css bug message.
I think you could add somewhere a list of which "special terms" are recognized and what they do.

Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9a1) Gecko/20050911 Firefox/1.6a1 ID:2005091107
User avatar
onemen
Posts: 1136
Joined: October 15th, 2004, 7:48 am

Post by onemen »

when i open javascript console All button is always focused, even if when i'v closed the console another button had the focus.
but the console content is matching to the button that had the focus.
old zeniko
Posts: 0
Joined: December 31st, 1969, 5:00 pm

Post by old zeniko »

I've uploaded <a href="http://www.haslo.ch/zeniko/software/consolefilter.xpi">Console Filter 0.2.11+</a> which gets closer to what CF 0.3 is going to look like.

Since Bug 306223 probably isn't going to make it, I've decided to disable category filtering (Firefox 1.0.x users got so far only a speed decrease). You can reenable it by toggling the preference extensions.consolefilter.categories. Additionally, I've added a permanent <Show All> filter for mouse users, and the All-button-bug should be fixed.
User avatar
mrtech
Posts: 2007
Joined: May 15th, 2003, 7:46 am
Location: New York
Contact:

Post by mrtech »

getting the following error with 0.2.14+ (Console2 not installed).

Code: Select all

Error: aRow is not defined
Source File: chrome://consolefilter/content/consolefilter.js
Line: 78
mel reyes • mrtech.com • BlogPlaxoLinkedInTwitter
Support mrtech.com get our toolbar
old zeniko
Posts: 0
Joined: December 31st, 1969, 5:00 pm

Post by old zeniko »

Sorry for that. I've just now uploaded a revised version of <a href="http://www.haslo.ch/zeniko/software/consolefilter.xpi">Console Filter v0.2.14+</a> which fixes the typo involved.
User avatar
mrtech
Posts: 2007
Joined: May 15th, 2003, 7:46 am
Location: New York
Contact:

Post by mrtech »

I take it this version isn't compatible with Console2 0.1.7?
mel reyes • mrtech.com • BlogPlaxoLinkedInTwitter
Support mrtech.com get our toolbar
old zeniko
Posts: 0
Joined: December 31st, 1969, 5:00 pm

Post by old zeniko »

mrtech wrote:I take it this version isn't compatible with Console2 0.1.7?

v0.2.14+ is, but you'll have to add the enhanced filter to the toolbar yourself (right-click -> Customize). Otherwise see the release notes at the start of this thread for compatibility infos.
User avatar
onemen
Posts: 1136
Joined: October 15th, 2004, 7:48 am

Post by onemen »

zeniko wrote:
mrtech wrote:I take it this version isn't compatible with Console2 0.1.7?

v0.2.14+ is, but you'll have to add the enhanced filter to the toolbar yourself (right-click -> Customize). Otherwise see the release notes at the start of this thread for compatibility infos.


there isn't any Customize option in v0.2.14+
where is the enhanced filter to the toolbar in v0.2.14+

and this error is still in v0.2.14+

Code: Select all

Error: aRow is not defined
Source File: chrome://consolefilter/content/consolefilter.js
Line: 78


did i mention that i use v0.2.14+ :)
User avatar
mrtech
Posts: 2007
Joined: May 15th, 2003, 7:46 am
Location: New York
Contact:

Post by mrtech »

onemen, clear your cache I was able to re-pull the latest build and if you have console2 just right-click and drop the filter to the toolbar.
mel reyes • mrtech.com • BlogPlaxoLinkedInTwitter
Support mrtech.com get our toolbar
User avatar
onemen
Posts: 1136
Joined: October 15th, 2004, 7:48 am

Post by onemen »

can u install both console2 and console filter in the same profile ?
Locked