2

How can I show or hide the entire Firebug panel and its icon at runtime ?

I browsed through Firebug.chrome but could not find anything appropriate. I tried the following snippet which did not have any apparent effect, Firebug Lite was still there.

Firebug.extend(function (FBL) {
    alert('TEST'); // This is run
    FBL.Firebug.chrome.deactivate(); // No errors but nothing happens
});

The anonymous callback function is definitely invoked.

Arc
  • 11,143
  • 4
  • 52
  • 75

2 Answers2

3

Quite an old post, but still popping on google search for such a question.

I'm not even sure which version of Firebug Lite you were using, but the following works well with 1.4.0 (once the page has loaded):

Firebug.chrome.open();
Firebug.chrome.close();
Firebug.chrome.toggle();
Mangled Deutz
  • 11,384
  • 6
  • 39
  • 35
0

Firebug-Lite is enabled through the javascript function in the bookmark, and from there it just loads the javascript hosted at getfirebug.com.

If you control the website you're looking at, and want firebug to pop-up for that website, then you can add this to your code:

<script type="text/javascript">
    function bookmarklet(F,i,r,e,b,u,g,L,I,T,E){
           if(F.getElementById(b))
               return;
           E=F[i+'NS']&&F.documentElement.namespaceURI;
           E=E?F[i+'NS'](E,'script'):F[i]('script');
           E[r]('id',b);
           E[r]('src',I+g+T);E[r](b,u);
           (F[e]('head')[0]||F[e]('body')[0]).appendChild(E);
           E=new Image;
           E[r]('src',I+L);
       }

    $(document).ready(function() {
           bookmarklet(document,'createElement','setAttribute',
               'getElementsByTagName','FirebugLite','4','firebug-lite.js',
               'releases/lite/latest/skin/xp/sprite.png','https://getfirebug.com/','#startOpened');             
    });         
</script>

Or, did you mean that when you're browsing you always want Firebug / Firebug-Lite at the bottom?

Civilian
  • 614
  • 2
  • 9
  • 29
  • It's not about loading the script, it's about enabling / disabling it while being on the same page. It's for an application based on web technologies where Firebug Lite comes bundled with the software. – Arc Mar 19 '12 at 20:04
  • Okay. Well if you have JS interaction with the page anyway, why not define the bookmarklet function and then use it? And then you just have to figure out how to programmatically disable it-- maybe through something like $("#fbWindow_btDeactivate").click() ? – Civilian Mar 20 '12 at 00:28
  • There is no point in using the bookmarklet as is. One can always control the loading by creating a script tag. The interesting point is the proper disabling and re-enabling, and that was why I was asking in the first place. – Arc Mar 20 '12 at 20:09
  • Okay, sorry, you didn't explain your question very well. Keep in mind that even if you do figure out a way to enable/disable it programmatically, Firebug looks for a script tag with itself in the page, and will error out if it doesn't find it. – Civilian Mar 21 '12 at 00:50
  • 4
    I think I explained it fairly well - the question says enable and disable at runtime... whatever. – Arc Mar 21 '12 at 16:36