Firebug 1.6a9

15 views
Skip to first unread message

John J Barton

unread,
Apr 8, 2010, 12:10:40 PM4/8/10
to Firebug

Brian L. Matthews

unread,
Apr 8, 2010, 8:15:27 PM4/8/10
to fir...@googlegroups.com
On 4/8/10 9:10 AM, John J Barton wrote:
Release notes for 1.6a9
http://blog.getfirebug.com/2010/04/08/firebug-1-6a9

I wanted to try out XPathResult logging so I installed this, but I'm working on a Greasemonkey script, and it appears that console.log(object) doesn't make the [object Object] click able, and console.dir doesn't work at all in Greasemonkey scripts. Is that on purpose? Both worked in 1.5.3 with the same Greasemonkey script (although of course without the enhanced XPathResult display). I'm using Firefox 3.6.3 and Greasemonkey 0.8.20100408.6.

Brian

Honza (Jan Odvarko)

unread,
Apr 9, 2010, 2:56:34 AM4/9/10
to Firebug
> I wanted to try out XPathResult logging so I installed this, but I'm
> working on a Greasemonkey script, and it appears that
> console.log(object) doesn't make the [object Object] click able, and
> console.dir doesn't work at all in Greasemonkey scripts. Is that on
> purpose? Both worked in 1.5.3 with the same Greasemonkey script
> (although of course without the enhanced XPathResult display). I'm using
> Firefox 3.6.3 and Greasemonkey 0.8.20100408.6.

I have installed Firefox 3.6.3 + Firebug 1.6a9 + Greasemonkey
0.8.20100408.6.
and tried following test case:
http://getfirebug.com/tests/content/console/api/log-xpathresult.html

I see [h2, h2] in the Console panel (after clicking on the Execute
Test button),
which is the expected result. Does this test work for you?

If yes, what should I exactly do to reproduce your case?

Honza

Brian L. Matthews

unread,
Apr 9, 2010, 2:50:45 PM4/9/10
to fir...@googlegroups.com
On 4/8/10 11:56 PM, Honza (Jan Odvarko) wrote:
I wanted to try out XPathResult logging so I installed this, but I'm
working on a Greasemonkey script, and it appears that
console.log(object) doesn't make the [object Object] click able, and
console.dir doesn't work at all in Greasemonkey scripts. Is that on
purpose? Both worked in 1.5.3 with the same Greasemonkey script
(although of course without the enhanced XPathResult display). I'm using
Firefox 3.6.3 and Greasemonkey 0.8.20100408.6.
    
I have installed Firefox 3.6.3 + Firebug 1.6a9 + Greasemonkey
0.8.20100408.6.
and tried following test case:
http://getfirebug.com/tests/content/console/api/log-xpathresult.html
  
Sorry, I wasn't very clear. console.log and console.dir fail only when called from a Greasemonkey user script, they work fine (and the XPathResult display is nice, thanks!) from regular pages. So the URL above works as expected. Here's a test case for the failure in a user script:

1. Copy the text between the dashed lines below and save it in a file called test.user.js:

------------------------------ cut here ------------------------------
// ==UserScript==
// @name    Testing for Firebug 1.6a9
// @namespace    http://getfirebug.com
// @description    Test console.log and console.dir from a Greasemonkey script
// @include    http://getfirebug.com/*
// ==/UserScript==

var o = {'a': 23, 'b': 42};

console.log('o (via log):', o);
console.log('o (via dir):');
console.dir(o);

var r = document.evaluate('//h2', document.body, null,
    XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);

console.log('r (via log):', r);
console.log('r (via dir):');
console.dir(r);
------------------------------ cut here ------------------------------

2. Open test.user.js in Firefox. Greasemonkey should intercept the open and offer to install the user script. After the countdown click Install. That installs a user script that's run anytime a URL is visited starting with http://getfirebug.com/ (there's nothing special about that URL, I just needed some URL, and we're all familiar with that one :-)).

3. Visit getfirebug.com. If Firebug wasn't on for that page, turn it on, then go to the Console tab and reload the page.

4. The Greasemonkey script should log some stuff. With Firebug 1.5.3 I get:

o (via dir):
 
a
23
 
b
42
r (via log): XPathResult {}
r (via dir):
 
ANY_TYPE
0
 
ANY_UNORDERED_NODE_TYPE
8
 
BOOLEAN_TYPE
3
 
FIRST_ORDERED_NODE_TYPE
9
 
NUMBER_TYPE
1
 
ORDERED_NODE_ITERATOR_TYPE
5
 
ORDERED_NODE_SNAPSHOT_TYPE
7
 
STRING_TYPE
2
 
UNORDERED_NODE_ITERATOR_TYPE
4
 
UNORDERED_NODE_SNAPSHOT_TYPE
6
 
booleanValue
7
 
get invalidIteratorState
false
 
numberValue
7
 
resultType
7
 
singleNodeValue
7
 
snapshotLength
8
 
stringValue
7
 
iterateNext
iterateNext()
 
snapshotItem
snapshotItem()

(I hope that pasted ok). It's all static text except for "Object { a=23, more...}" and "XPathResult {}", both of which are links that can be clicked to display the item in the DOM tab.

5. Install 1.6a9 and visit getfirebug.com again. Now I get:

http://getfirebug.com/Testing for Firebug 1.6a9: o (via log):
[object Object]
http://getfirebug.com/Testing for Firebug 1.6a9: o (via dir):
http://getfirebug.com/Testing for Firebug 1.6a9: r (via log):
[object XPCNativeWrapper [object XPathResult]]
http://getfirebug.com/Testing for Firebug 1.6a9: r (via dir):

Now it's *all* static text, neither "[object Object]" nor "
[object XPCNativeWrapper [object XPathResult]]" are clickable, and note that there's no dir output. Also, why are the lines wrapped? My Firefox window is about 3 times wider than the longest line on the console, it shouldn't have had to wrap the lines.

Let me know if you need more information.

Thanks,
Brian

John J Barton

unread,
Apr 9, 2010, 3:01:13 PM4/9/10
to Firebug

On Apr 9, 11:50 am, "Brian L. Matthews" <blmatth...@gmail.com> wrote:
> On 4/8/10 11:56 PM, Honza (Jan Odvarko) wrote:>> I wanted to try out XPathResult logging so I installed this, but I'm
> >> working on a Greasemonkey script, and it appears that
> >> console.log(object) doesn't make the [object Object] click able, and
> >> console.dir doesn't work at all in Greasemonkey scripts. Is that on
> >> purpose? Both worked in 1.5.3 with the same Greasemonkey script
> >> (although of course without the enhanced XPathResult display). I'm using
> >> Firefox 3.6.3 and Greasemonkey 0.8.20100408.6.
>
> > I have installed Firefox 3.6.3 + Firebug 1.6a9 + Greasemonkey
> > 0.8.20100408.6.
> > and tried following test case:
> >http://getfirebug.com/tests/content/console/api/log-xpathresult.html
>
> Sorry, I wasn't very clear. console.log and console.dir fail only when
> called from a Greasemonkey user script, they work fine (and the
> XPathResult display is nice, thanks!) from regular pages. So the URL
> above works as expected. Here's a test case for the failure in a user
> script:

I guess that you need to contact Greasemonkey. I suppose they are
implementing console.log in the user scripts. We changed the console
implementation in 1.6a9, but not by a lot. There is probably some
small change needed.

Later in 1.6 we should be able to support testing with greasemonkey if
someone from that team or community wants to help with it.

jjb

>
> 1. Copy the text between the dashed lines below and save it in a file
> called test.user.js:
>
> ------------------------------ cut here ------------------------------
> // ==UserScript==
> // @name    Testing for Firebug 1.6a9
> // @namespace    http://getfirebug.com
> // @description    Test console.log and console.dir from a Greasemonkey
> script
> // @include    http://getfirebug.com/*
> // ==/UserScript==
>
> var o = {'a': 23, 'b': 42};
>
> console.log('o (via log):', o);
> console.log('o (via dir):');
> console.dir(o);
>
> var r = document.evaluate('//h2', document.body, null,
>      XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);
>
> console.log('r (via log):', r);
> console.log('r (via dir):');
> console.dir(r);
> ------------------------------ cut here ------------------------------
>
> 2. Open test.user.js in Firefox. Greasemonkey should intercept the open
> and offer to install the user script. After the countdown click Install.
> That installs a user script that's run anytime a URL is visited starting

> withhttp://getfirebug.com/(there's nothing special about that URL, I

> http://getfirebug.com/Testingfor Firebug 1.6a9: o (via log):
> [object Object]http://getfirebug.com/Testingfor Firebug 1.6a9: o (via dir):http://getfirebug.com/Testingfor Firebug 1.6a9: r (via log):
> [object XPCNativeWrapper [object XPathResult]]http://getfirebug.com/Testingfor Firebug 1.6a9: r (via dir):

Brian L. Matthews

unread,
Apr 9, 2010, 4:02:46 PM4/9/10
to fir...@googlegroups.com
On 4/9/10 12:01 PM, John J Barton wrote:
> On Apr 9, 11:50 am, "Brian L. Matthews"<blmatth...@gmail.com> wrote:
>
>> On 4/8/10 11:56 PM, Honza (Jan Odvarko) wrote:>> I wanted to try out XPathResult logging so I installed this, but I'm
>>
>>>> working on a Greasemonkey script, and it appears that
>>>> console.log(object) doesn't make the [object Object] click able, and
>>>> console.dir doesn't work at all in Greasemonkey scripts. Is that on
>>>> purpose? Both worked in 1.5.3 with the same Greasemonkey script
>>>> (although of course without the enhanced XPathResult display). I'm using
>>>> Firefox 3.6.3 and Greasemonkey 0.8.20100408.6.
>>>>
>>> I have installed Firefox 3.6.3 + Firebug 1.6a9 + Greasemonkey
>>> 0.8.20100408.6.
>>> and tried following test case:
>>> http://getfirebug.com/tests/content/console/api/log-xpathresult.html
>>>
>> Sorry, I wasn't very clear. console.log and console.dir fail only when
>> called from a Greasemonkey user script, they work fine (and the
>> XPathResult display is nice, thanks!) from regular pages. So the URL
>> above works as expected. Here's a test case for the failure in a user
>> script:
>>
> I guess that you need to contact Greasemonkey. I suppose they are
> implementing console.log in the user scripts. We changed the console
> implementation in 1.6a9, but not by a lot. There is probably some
> small change needed.
>

I'll contact the Greasemonkey people, although an identical version of
Greasemonkey works fine with 1.5.3, so something changed in 1.6a9 (or
maybe earlier, I didn't try any other 1.6's) that broke things. Maybe
it's because Greasemonkey is doing something wrong and 1.5.3 just
happened to work while 1.6a9 has tightened things up, but I'd still
think it important to maintain backward compatibility, particularly with
such a widely used extension as Greasemonkey.

Brian

Reply all
Reply to author
Forward
0 new messages