Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Timeout vs. mutation observer?

182 views
Skip to first unread message

Jan Odvarko

unread,
Jan 28, 2014, 9:52:34 AM1/28/14
to dev-devel...@lists.mozilla.org
In order to customize an existing dev-tools shortcuts (Ctrl+Shift+C,
inspector), Firebug is changing

an attribute of an existing <key> XUL element. This element is not available
since the beginning

and so, Firebug is using a timeout (100ms) that is repeatedly executed till
the <key> element is there.



Another solution could be to use a mutation observer and

use an event when the <key> element is there.



What is a better approach, using a timeout or mutation observer?

What would you recommend for extension developers?



Honza



---
This email is free from viruses and malware because avast! Antivirus protection is active.
http://www.avast.com

sebastia...@gmail.com

unread,
Jan 29, 2014, 3:13:18 AM1/29/14
to
One important point is also whether it's wise to implement a general solution for continously detecting overwritten shortcuts vs. checking for this specific shortcut until it's there.

Sebastian

Panos Astithas

unread,
Jan 29, 2014, 4:34:14 AM1/29/14
to Jan Odvarko, dev-developer-tools
Can you check if the shortcuts are registered by the time the
"devtools-loaded" observer notification is fired? If not, perhaps we should
add another event just for this case.
> _______________________________________________
> dev-developer-tools mailing list
> dev-devel...@lists.mozilla.org
> https://lists.mozilla.org/listinfo/dev-developer-tools
>

odv...@gmail.com

unread,
Jan 29, 2014, 5:55:48 AM1/29/14
to
On Wednesday, January 29, 2014 10:34:14 AM UTC+1, Panos Astithas wrote:
> Can you check if the shortcuts are registered by the time the
>
> "devtools-loaded" observer notification is fired? If not, perhaps we should
>
> add another event just for this case.

I see, we'll try it. Thanks for the tip Panos!

Honza
0 new messages