Finding all bookmarks with keywords

Discussion of features in Mozilla Firefox
Post Reply
User avatar
dotancohen
Posts: 261
Joined: November 10th, 2007, 2:58 am
Contact:

Finding all bookmarks with keywords

Post by dotancohen »

How can one parse his bookmarks, to get a list of only bookmarks with keywords? Thanks.
. . . What is Firefox?
. . . . . .
User avatar
dickvl
Posts: 54161
Joined: July 18th, 2005, 3:25 am

Post by dickvl »

You can try to open the bookmark.html file in Firefox and use a bookmarklet like this to hide links without a SHORTCUTURL:

Code: Select all

javascript:(function(){var e=document.getElementsByTagName('a'),E,n=0; for(i=0;E=e[i];i++){if(!E.getAttribute('SHORTCUTURL')){E.setAttribute('style','display:none');n++}} alert('Ready: '+n)})()

Something like this will add the keywords

Code: Select all

javascript:(function(){var c='red',e=document.getElementsByTagName('a'),E,k=0,n,t; for(i=0;E=e[i];i++){t=E.getAttribute('SHORTCUTURL'); if(t&&t!=''){n=document.createElement('span'); n.style.color=c;n.innerHTML='['+t+']'; E.appendChild(n);k++} else{void(E.setAttribute('style','display:none'));}} alert('Ready: '+k)})()

Code: Select all

javascript:(function(){var c='red',e=document.getElementsByTagName('a'),E,k=0,n,t; for(i=0;E=e[i];i++){t=E.getAttribute('SHORTCUTURL'); if(t&&t!=''){n=document.createElement('span'); n.style.color=c;n.innerHTML='['+t+']'; E.appendChild(n);k++}} alert('Ready: '+k);})()
Last edited by dickvl on July 2nd, 2008, 10:12 am, edited 2 times in total.
User avatar
dotancohen
Posts: 261
Joined: November 10th, 2007, 2:58 am
Contact:

Post by dotancohen »

That is an amazing and creative solution, dickvl. It does what I need. Thanks!
. . . What is Firefox?
. . . . . .
User avatar
dickvl
Posts: 54161
Joined: July 18th, 2005, 3:25 am

Post by dickvl »

You're welcome.
I've added a second version that adds the keywords.
User avatar
dotancohen
Posts: 261
Joined: November 10th, 2007, 2:58 am
Contact:

Post by dotancohen »

dickvl, I have a collection of tips for various programs that I use. I plan on putting it all online sometime in the future. Would you mind if I add this? Most of the tips are not of the nature that I would need to ask permission, but your bookmarklet looks to be a creation, not just a tip.

Thanks again.
. . . What is Firefox?
. . . . . .
User avatar
dickvl
Posts: 54161
Joined: July 18th, 2005, 3:25 am

Post by dickvl »

No, go ahead.
It was just a quick try to see if it worked.
I would appreciate if you mention that I created it.
User avatar
dotancohen
Posts: 261
Joined: November 10th, 2007, 2:58 am
Contact:

Post by dotancohen »

> I would appreciate if you mention that I created it.

Of course, that was never in doubt. Thanks.
. . . What is Firefox?
. . . . . .
User avatar
dickvl
Posts: 54161
Joined: July 18th, 2005, 3:25 am

Post by dickvl »

You're welcome.
Post Reply