Script to toggle bookmarks toolbar with shortcut?

Talk about add-ons and extension development.
Post Reply
mark_jd
Posts: 278
Joined: November 5th, 2011, 12:38 pm

Script to toggle bookmarks toolbar with shortcut?

Post by mark_jd »

I found a script that can be used with the keyconfig addon to assign shortcut to toggle bookmark toolbar but it doesn't work well. Sometimes it shows the toolbar but it is empty and sometimes it shows the toolbar with the bookmarks folders and items on it but when i click on some of the bookmarks it doesn't open it. This is the scripts:

Code: Select all

var toolbar = document.getElementById("PersonalToolbar");
toolbar.collapsed = !toolbar.collapsed;
document.persist(toolbar.id, "collapsed");

Any idea why it doesn't work?
nohamelin
Posts: 96
Joined: September 3rd, 2013, 4:04 pm
Location: Chile

Re: Script to toggle bookmarks toolbar with shortcut?

Post by nohamelin »

Try using the next:

Code: Select all

var toolbar = document.getElementById("PersonalToolbar");
setToolbarVisibility(toolbar, toolbar.collapsed);
I see that setToolbarVisibility does many other things too, including some specific bits related to Bookmarks.
mark_jd
Posts: 278
Joined: November 5th, 2011, 12:38 pm

Re: Script to toggle bookmarks toolbar with shortcut?

Post by mark_jd »

Thanks! Working fine.
Post Reply