reload after customize - firefox

i have a very simple firefox addon that essentially just displays the total number of open tabs.
So far it works beautifully, however after right clicking on the toolbar and selecting Customize… it only shows the default text until a tab is opened or closed.
i presume that i need to add an event listener for this event and call updateWidget(), however i can't find it in the API doc. So does anyone know how to do it?

Verified as bug, see : bugzilla.mozilla.org/show_bug.cgi?id=773297

Related

Lock Firebug to a specified page

Is there a way to keep Firebug on a single page, so that when I switch pages it remains on the page I want it set to?
For example, I'm working on a project and I get an error that I want to search for on Stack Overflow, but when I navigate here, the console changes to reflect this site. I'd like to stop that from happening.
There is no option to "pin" a page's data in Firebug (as of version 2.x). As far as I know this also doesn't work in any of the browser built-in dev tools.
Though the simple solution for your problem is to open the other page in a separate tab or window. Doing so keeps all the data of the page saved when you switch back to the tab containing your project's page.
Note that Firebug's activation model is based on URLs following the same origin policy. I.e. if you open it for your project's page, it will always get opened for your projects page, even on other tabs, but not for any other site.
I've found it useful to split the tab of interest off into a new window and to activate Firebug on that window. That way I can continue using my original tab collection/window without it changing as I link-hop.

How do I run Firefox inspector within an iFrame?

I know Chrome's inspector has a selector to choose which frame to use with the console. Firebug has a similar command, cd(window.frames[number]). Is there anything similar in Firefox Devtools? I suppose frame.window.eval could work, but only if it isn't cross-domain.
I was also wondering if there is a highlighter to inspect results of Web-console commands, for example document.getElementsByClassName(...). but you can at least change style of an element programmatically to 'see' it.
DOMNode objects do highlight in the page on hover in the web console and what is called the "variables view". The "variables view" is used in the web console too when you click on an object to see its properties (it's the sidebar that appears), and is also used in the debugger when paused at a breakpoint (right sidebar that contains the various scopes variables).
So, anytime a DOMNode appears in there, if you hover over it, it will be highlighted in the page.
When it comes to iframes, the webconsole does support the cd() command, see working with iframes.
We are also actively working on a bug that will add a drop-down to the toolbox whenever there are frames/iframes in the current page and allow you to easily switch from one to the other.
You can click to inspect a node in the console and debugger starting in Firefox 29, currently on the Aurora channel.

Ordering issue in modal window

I have a problem with a component that loads in to a modal window. I am using the Alpha User Points system and it has a component that gives you a full list of yous site's users. It also gives you the ability to order by username, by points etc. If I use it outside of modal window it works fine. If I use it in to modal window, ordering don't work!!! When I put my mouse over table's headers, outside of modal window gives this...javascript:tableOrdering('aup.referreid','asc','');In to modal window I see this...javascript:tableOrdering('aup.referreid','asc','');?ml=1 Using Firebug, I remove this ?ml=1 and it works into modal also!!! So the question is, why in to modal window gives this ?ml=1, what is this? And how will I remove it?
Well here is the answer... I use the Modalizer extension of nonumber.nl. I was loading my component through modalizer's modal box, this is why I had this issue. So, if anyone use Modalizer to popup components and have the same problem with me, just go to modalizer's Plugin Manager, find the option Convert Links inside Window and disable it!!! But, after this, if you want to add link in to modal window and you don't want to show-up the whole front page but only the component or what ever this is, you have to add at the end of the link this &ml=1.

Firefox Extension - Monitor refresh and change of tab

I need to know when a user refreshs the page and when he switches to another tab.
Does anyone has a clue how to capture this in a firefox extension?
Best regards
Christian
What you seem to want is knowing when the value in the location bar changes. This requires implementing nsIWebProgressListener interface. The only method you really need is onLocationChange, rest of them should be dummies. You can find the documentation along with code examples here: https://developer.mozilla.org/en/Code_snippets/Progress_Listeners. You can also use progress listeners to monitor page loads.

Manipulate Html from Firefox Extension

I am creating a Firefox extension that is somewhat similar to Firebug. There is a panel (or vbox) at the bottom of the browser that allows users to specify colors to certain Html elements. When they click the OK button, I would like these colors to get updated on the current web page.
I have my JavaScript working when I click the button (i am just throwing an alert), however when I change that JavaScript to change the css or styles of an element (by either using document.getElementById or jquery), nothing changes.
Is there something with Firefox extensions that I am missing? Any help is appreciated.
Let me know if you have any questions. Thanks
https://developer.mozilla.org/en/Extension_Frequently_Asked_Questions#Accessing_the_document_of_a_webpage_doesn%27t_work
You want content.document.getElementById() and similarly for every other construct you use.

Resources