X
Tap here to go to the mobile version of the site.

Support Forum

I want a simple text sortable list of the names of all my bookmarks.

Posted

When I save some bookmarks, I add a remark about the site or a hint about the password. I would like to extract a simple sortable list of all the bookmark names so that I can sort and list and take it with me when travelling, print it, etc. The more sophisticated bookmark programs aren't suitable for my purposes.

When I save some bookmarks, I add a remark about the site or a hint about the password. I would like to extract a simple sortable list of all the bookmark names so that I can sort and list and take it with me when travelling, print it, etc. The more sophisticated bookmark programs aren't suitable for my purposes.

Chosen solution

Hmm, actually, maybe you didn't mean an opening parenthesis at the beginning of the name, but anywhere in the name? In that case:

var aels=document.querySelectorAll('a[href]:not([href^="javascript:"]'); 
var tbl=document.createElement("table");
document.body.appendChild(tbl);
tbl.outerHTML = '<table border="1" cellspacing="0" style="width:1200px; table-layout:fixed;"><thead><tr><th>Name</th><th>URL</th></tr></thead><tbody id="tbod"></tbody></table>';
var i, n, l, d, t=document.getElementById("tbod");
for (i=0; i<aels.length; i++){
  n=aels[i].textContent;
  if (n.indexOf('(')>-1){
    l=aels[i].href;
    t.insertAdjacentHTML('beforeend', '<tr><td>'+n+'</td><td>'+l+'</td></tr>');
  }
}
t.parentNode.scrollIntoView();
Read this answer in context 0

Additional System Details

Installed Plug-ins

  • Shockwave Flash 24.0 r0

Application

  • Firefox 50.1.0
  • User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:50.0) Gecko/20100101 Firefox/50.0
  • Support URL: https://support.mozilla.org/1/firefox/50.1.0/WINNT/en-US/

Extensions

  • Application Update Service Helper 1.0 (aushelper@mozilla.org)
  • Auto Opt-out for Flash 1.0.6 (@mcafee-optout)
  • Autoclose Bookmark&History Folders 0.7.2 ({2e84684e-01d1-4e3e-d672-6a833d883155})
  • Bulk Image Downloader 4.91.0.0 ({524B8EF8-C312-11DB-8039-536F56D89593})
  • HTTPS Everywhere 5.2.8 (https-everywhere@eff.org)
  • McAfee Security Scan Plus 1.0.1-signed.1-signed ({e4f94d1e-2f53-401e-8885-681602c0ddd8})
  • McAfee WebAdvisor 5.0.218.0 ({4ED1F68A-5463-4931-9384-8FFF5ED91D92})
  • Multi-process staged rollout 1.5 (e10srollout@mozilla.org)
  • New Tab Override (browser.newtab.url replacement) 5.0 (newtaboverride@agenedia.com)
  • Pocket 1.0.5 (firefox@getpocket.com)
  • Show Parent Folder 2.1.1 (showParentFolder@alice)
  • SimpleSort Bookmarks 1.0.0 (simple-sort-bookmarks@dominiofelice.com)
  • uBlock Origin 1.10.2 (uBlock0@raymondhill.net)
  • Web Compat 1.0 (webcompat@mozilla.org)
  • Xmarks 4.3.19 (foxmarks@kei.com)
  • Dashlane 4.2.3 (jetpack-extension@dashlane.com) (Inactive)
  • KeeFox 1.6.4 (keefox@chris.tomlinson) (Inactive)

Javascript

  • incrementalGCEnabled: True

Graphics

  • adapterDescription: Intel(R) HD Graphics 4600
  • adapterDescription2:
  • adapterDeviceID: 0x0412
  • adapterDeviceID2:
  • adapterDrivers: igdumdim64 igd10iumd64 igd10iumd64 igd12umd64 igdumdim32 igd10iumd32 igd10iumd32 igd12umd32
  • adapterDrivers2:
  • adapterRAM: Unknown
  • adapterRAM2:
  • adapterSubsysID: 06221028
  • adapterSubsysID2:
  • adapterVendorID: 0x8086
  • adapterVendorID2:
  • crashGuards: []
  • currentAudioBackend: wasapi
  • direct2DEnabled: True
  • directWriteEnabled: True
  • directWriteVersion: 10.0.14393.351
  • driverDate: 9-29-2016
  • driverDate2:
  • driverVersion: 20.19.15.4531
  • driverVersion2:
  • featureLog: {u'fallbacks': [], u'features': [{u'status': u'available', u'description': u'Compositing', u'log': [{u'status': u'available', u'type': u'default'}], u'name': u'HW_COMPOSITING'}, {u'status': u'available', u'description': u'Direct3D11 Compositing', u'log': [{u'status': u'available', u'type': u'default'}], u'name': u'D3D11_COMPOSITING'}, {u'status': u'disabled', u'description': u'Direct3D9 Compositing', u'log': [{u'status': u'disabled', u'message': u'Disabled by default', u'type': u'default'}], u'name': u'D3D9_COMPOSITING'}, {u'status': u'available', u'description': u'Direct2D', u'log': [{u'status': u'available', u'type': u'default'}], u'name': u'DIRECT2D'}, {u'status': u'available', u'description': u'Direct3D11 hardware ANGLE', u'log': [{u'status': u'available', u'type': u'default'}], u'name': u'D3D11_HW_ANGLE'}]}
  • info: {u'AzureCanvasAccelerated': 0, u'AzureCanvasBackend': u'direct2d 1.1', u'AzureFallbackCanvasBackend': u'cairo', u'AzureContentBackend': u'direct2d 1.1'}
  • isGPU2Active: False
  • numAcceleratedWindows: 2
  • numTotalWindows: 2
  • supportsHardwareH264: Yes; Using D3D11 API
  • webgl2Renderer: (no info)
  • webglRenderer: Google Inc. -- ANGLE (Intel(R) HD Graphics 4600 Direct3D11 vs_5_0 ps_5_0)
  • windowLayerManagerRemote: True
  • windowLayerManagerType: Direct3D 11

Modified Preferences

Misc

  • User JS: No
  • Accessibility: No
cor-el
  • Top 10 Contributor
  • Moderator
17693 solutions 160087 answers

You can create an HTML backup and open this file in a Firefox tab.

You can create an HTML backup and open this file in a Firefox tab. *[[/questions/748417]]

Question owner

No, if I open the HTML backup in Firefox I get an unsortable HTML list. If I open the backup in a text editor, I get the complete HTML code for the bookmarks.

No, if I open the HTML backup in Firefox I get an unsortable HTML list. If I open the backup in a text editor, I get the complete HTML code for the bookmarks.
jscher2000
  • Top 10 Contributor
8838 solutions 72241 answers

Hi zootsuit, you can use a script to modify the HTML document on the fly or extract the links into a separate document. Since you criticized the HTML document as "unsortable" could you describe in more detail exactly what you want to end up with?

Hi zootsuit, you can use a script to modify the HTML document on the fly or extract the links into a separate document. Since you criticized the HTML document as "unsortable" could you describe in more detail exactly what you want to end up with?
jscher2000
  • Top 10 Contributor
8838 solutions 72241 answers

By the way, there's an add-on to create a CSV file showing the particular fields (e.g., name, URL, description) of interest to you but I haven't tried it myself:

https://addons.mozilla.org/firefox/addon/places-to-csv-sdk/

A CSV file can be opened in Microsoft Excel, Google Sheets, or a free office suite like OpenOffice.org or LibreOffice. Once in a spreadsheet program, it can be sorted and formatted.

By the way, there's an add-on to create a CSV file showing the particular fields (e.g., name, URL, description) of interest to you but I haven't tried it myself: https://addons.mozilla.org/firefox/addon/places-to-csv-sdk/ A CSV file can be opened in Microsoft Excel, Google Sheets, or a free office suite like OpenOffice.org or LibreOffice. Once in a spreadsheet program, it can be sorted and formatted.

Question owner

Thanks, but I tried it but it keeps failing. Don't know why. Maybe I have too many bookmarks. I've got more than 800.

Thanks, but I tried it but it keeps failing. Don't know why. Maybe I have too many bookmarks. I've got more than 800.
cor-el
  • Top 10 Contributor
  • Moderator
17693 solutions 160087 answers

Another bookmarklet to sort the links:

javascript:(function(){
function bm(h,t,y){with(this){uri=h;title=t;type=y}}
bm.prototype={uri:"",title:"",type:""};
function soh(a,b){return(a.uri>b.uri)}
function sot(a,b){return(a.title.toLowerCase()>b.title.toLowerCase())}
var s=prompt('%S','%S'),S=s?new RegExp(s,'i'):/.*/,L=1,O=1;
var BM=[],BS=[null,soh,sot],T=[],ty="text/x-moz-place";
for(i=0;N=document.links[i];i++){if(S.test(N.href)){BM.push(new bm(N.href,N.innerHTML,ty))}}
if(O){BM=BM.sort(BS[O])}
T='<html><body><style>body{counter-reset:links}a{color:#000;}a:before{content:"["counter(links)"] ";counter-increment:links;}</style>';
for(i=0;B=BM[i];i++){T+='<a href="'+B.uri+'">'+(L==2?B.title:B.uri)+'</a><br>'}
T+='</body></html>';
if(prompt('JSON',JSON.stringify(BM).replace(/^\[/,"").replace(/\]$/,""))){with(window.open().document){write(T);close()}}
})()

(updated for JSON output)

Another bookmarklet to sort the links: <pre><nowiki>javascript:(function(){ function bm(h,t,y){with(this){uri=h;title=t;type=y}} bm.prototype={uri:"",title:"",type:""}; function soh(a,b){return(a.uri>b.uri)} function sot(a,b){return(a.title.toLowerCase()>b.title.toLowerCase())} var s=prompt('%S','%S'),S=s?new RegExp(s,'i'):/.*/,L=1,O=1; var BM=[],BS=[null,soh,sot],T=[],ty="text/x-moz-place"; for(i=0;N=document.links[i];i++){if(S.test(N.href)){BM.push(new bm(N.href,N.innerHTML,ty))}} if(O){BM=BM.sort(BS[O])} T='<html><body><style>body{counter-reset:links}a{color:#000;}a:before{content:"["counter(links)"] ";counter-increment:links;}</style>'; for(i=0;B=BM[i];i++){T+='<a href="'+B.uri+'">'+(L==2?B.title:B.uri)+'</a><br>'} T+='</body></html>'; if(prompt('JSON',JSON.stringify(BM).replace(/^\[/,"").replace(/\]$/,""))){with(window.open().document){write(T);close()}} })() </nowiki></pre> ---- (updated for JSON output)

Modified by cor-el

jscher2000
  • Top 10 Contributor
8838 solutions 72241 answers

zootsuit said

Thanks, but I tried it but it keeps failing. Don't know why. Maybe I have too many bookmarks. I've got more than 800.

Hmm, that doesn't seem like an excessive number.

By the way, if you can't solve the problem in Firefox, another option would be to create the HTML export file then import that into Internet Explorer, which will convert them to Windows Favorites. There probably are more tools to work with Windows Favorites than with Firefox bookmarks.

''zootsuit [[#answer-945639|said]]'' <blockquote> Thanks, but I tried it but it keeps failing. Don't know why. Maybe I have too many bookmarks. I've got more than 800. </blockquote> Hmm, that doesn't seem like an excessive number. By the way, if you can't solve the problem in Firefox, another option would be to create the HTML export file then import that into Internet Explorer, which will convert them to Windows Favorites. There probably are more tools to work with Windows Favorites than with Firefox bookmarks.
jscher2000
  • Top 10 Contributor
8838 solutions 72241 answers

Helpful Reply

As long as we're hacking about with scripts... this one will gather the bookmarks (other than bookmarklets) into a three column table: name, URL, description (assuming that's where you put your notes). You can select and copy the table and paste it into a word processor or spreadsheet program.

Select and copy this script:

var aels=document.querySelectorAll('a[href]:not([href^="javascript:"]'); 
var tbl=document.createElement("table");
document.body.appendChild(tbl);
tbl.outerHTML = '<table border="1" cellspacing="0" style="width:1200px; table-layout:fixed;"><thead><tr><th>Name</th><th>URL</th><th>Description</th></tr></thead><tbody id="tbod"></tbody></table>';
var i, n, l, d, t=document.getElementById("tbod");
for (i=0; i<aels.length; i++){
  n=aels[i].textContent;
  l=aels[i].href;
  if (aels[i].parentNode.nextElementSibling){
    if (aels[i].parentNode.nextElementSibling.nodeName=="DD") d=aels[i].parentNode.nextElementSibling.textContent;
	else d="";
  } else d="";
  t.insertAdjacentHTML('beforeend', '<tr><td>'+n+'</td><td>'+l+'</td><td>'+d+'</td></tr>');
}
t.parentNode.scrollIntoView();

Then after opening your exported bookmarks file in a tab, open the Web Console using either:

  • Ctrl+Shift+k
  • "3-bar" menu button > Developer > Web Console
  • Tools menu > Web Developer > Web Console

Paste the script in the blank line at the bottom of the console and press Enter to run it. It will take a moment, and then the page should scroll to the table. You can close the web console at that point.

As long as we're hacking about with scripts... this one will gather the bookmarks (other than bookmarklets) into a three column table: name, URL, description (assuming that's where you put your notes). You can select and copy the table and paste it into a word processor or spreadsheet program. Select and copy this script: <pre>var aels=document.querySelectorAll('a[href]:not([href^="javascript:"]'); var tbl=document.createElement("table"); document.body.appendChild(tbl); tbl.outerHTML = '&lt;table border="1" cellspacing="0" style="width:1200px; table-layout:fixed;">&lt;thead>&lt;tr>&lt;th>Name&lt;/th>&lt;th>URL&lt;/th>&lt;th>Description&lt;/th>&lt;/tr>&lt;/thead>&lt;tbody id="tbod">&lt;/tbody>&lt;/table>'; var i, n, l, d, t=document.getElementById("tbod"); for (i=0; i&lt;aels.length; i++){ n=aels[i].textContent; l=aels[i].href; if (aels[i].parentNode.nextElementSibling){ if (aels[i].parentNode.nextElementSibling.nodeName=="DD") d=aels[i].parentNode.nextElementSibling.textContent; else d=""; } else d=""; t.insertAdjacentHTML('beforeend', '&lt;tr>&lt;td>'+n+'&lt;/td>&lt;td>'+l+'&lt;/td>&lt;td>'+d+'&lt;/td>&lt;/tr>'); } t.parentNode.scrollIntoView(); </pre> Then after opening your exported bookmarks file in a tab, open the Web Console using either: * Ctrl+Shift+k * "3-bar" menu button > Developer > Web Console * Tools menu > Web Developer > Web Console Paste the script in the blank line at the bottom of the console and press Enter to run it. It will take a moment, and then the page should scroll to the table. You can close the web console at that point.

Question owner

I'll try the script. I've also found a complicated way to get the bookmarks into Word, where their names can be sorted.

RE Internet Explorer, it can't import all the bookmarks. I don't know if there are simply too many or some of the names or URLs can't fit into IE's rules for favorites, or what. In any case, importing didn't work.

I'll try the script. I've also found a complicated way to get the bookmarks into Word, where their names can be sorted. RE Internet Explorer, it can't import all the bookmarks. I don't know if there are simply too many or some of the names or URLs can't fit into IE's rules for favorites, or what. In any case, importing didn't work.

Question owner

The script works great. I can copy the table into Excel.

I don't use descriptions, so I was able to remove saving them from the script.

You've been generous. Can I ask you how to edit the script to select only bookmarks with an opening parenthesis in the name?

The script works great. I can copy the table into Excel. I don't use descriptions, so I was able to remove saving them from the script. You've been generous. Can I ask you how to edit the script to select only bookmarks with an opening parenthesis in the name?
jscher2000
  • Top 10 Contributor
8838 solutions 72241 answers

zootsuit said

I don't use descriptions, ... Can I ask you how to edit the script to select only bookmarks with an opening parenthesis in the name?

CSS selectors (the criteria used by querySelectorAll()) cannot read the actual display text of an link, so that needs to be checked for each name. Here's a revised version along those lines:

var aels=document.querySelectorAll('a[href]:not([href^="javascript:"]'); 
var tbl=document.createElement("table");
document.body.appendChild(tbl);
tbl.outerHTML = '<table border="1" cellspacing="0" style="width:1200px; table-layout:fixed;"><thead><tr><th>Name</th><th>URL</th></tr></thead><tbody id="tbod"></tbody></table>';
var i, n, l, d, t=document.getElementById("tbod");
for (i=0; i<aels.length; i++){
  n=aels[i].textContent;
  if (n.length>2 && n.substr(0,1)=='('){
    l=aels[i].href;
    t.insertAdjacentHTML('beforeend', '<tr><td>'+n+'</td><td>'+l+'</td></tr>');
  }
}
t.parentNode.scrollIntoView();

Note: the script is formatted for posting on the forum and may be garbled in email notifications, so please check the site if something seems wrong.

''zootsuit [[#answer-945776|said]]'' <blockquote> I don't use descriptions, ... Can I ask you how to edit the script to select only bookmarks with an opening parenthesis in the name? </blockquote> CSS selectors (the criteria used by querySelectorAll()) cannot read the actual display text of an link, so that needs to be checked for each name. Here's a revised version along those lines: <pre>var aels=document.querySelectorAll('a[href]:not([href^="javascript:"]'); var tbl=document.createElement("table"); document.body.appendChild(tbl); tbl.outerHTML = '&lt;table border="1" cellspacing="0" style="width:1200px; table-layout:fixed;"&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Name&lt;/th&gt;&lt;th&gt;URL&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody id="tbod"&gt;&lt;/tbody&gt;&lt;/table&gt;'; var i, n, l, d, t=document.getElementById("tbod"); for (i=0; i&lt;aels.length; i++){ n=aels[i].textContent; <b>if (n.length&gt;2 && n.substr(0,1)=='(')</b>{ l=aels[i].href; t.insertAdjacentHTML('beforeend', '&lt;tr&gt;&lt;td&gt;'+n+'&lt;/td&gt;&lt;td&gt;'+l+'&lt;/td&gt;&lt;/tr&gt;'); } } t.parentNode.scrollIntoView(); </pre> Note: the script is formatted for posting on the forum and may be garbled in email notifications, so please check the site if something seems wrong.
jscher2000
  • Top 10 Contributor
8838 solutions 72241 answers

Chosen Solution

Hmm, actually, maybe you didn't mean an opening parenthesis at the beginning of the name, but anywhere in the name? In that case:

var aels=document.querySelectorAll('a[href]:not([href^="javascript:"]'); 
var tbl=document.createElement("table");
document.body.appendChild(tbl);
tbl.outerHTML = '<table border="1" cellspacing="0" style="width:1200px; table-layout:fixed;"><thead><tr><th>Name</th><th>URL</th></tr></thead><tbody id="tbod"></tbody></table>';
var i, n, l, d, t=document.getElementById("tbod");
for (i=0; i<aels.length; i++){
  n=aels[i].textContent;
  if (n.indexOf('(')>-1){
    l=aels[i].href;
    t.insertAdjacentHTML('beforeend', '<tr><td>'+n+'</td><td>'+l+'</td></tr>');
  }
}
t.parentNode.scrollIntoView();
Hmm, actually, maybe you didn't mean an opening parenthesis at the ''beginning'' of the name, but ''anywhere'' in the name? In that case: <pre>var aels=document.querySelectorAll('a[href]:not([href^="javascript:"]'); var tbl=document.createElement("table"); document.body.appendChild(tbl); tbl.outerHTML = '&lt;table border="1" cellspacing="0" style="width:1200px; table-layout:fixed;"&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Name&lt;/th&gt;&lt;th&gt;URL&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody id="tbod"&gt;&lt;/tbody&gt;&lt;/table&gt;'; var i, n, l, d, t=document.getElementById("tbod"); for (i=0; i&lt;aels.length; i++){ n=aels[i].textContent; if (n.indexOf('(')&gt;-1){ l=aels[i].href; t.insertAdjacentHTML('beforeend', '&lt;tr&gt;&lt;td&gt;'+n+'&lt;/td&gt;&lt;td&gt;'+l+'&lt;/td&gt;&lt;/tr&gt;'); } } t.parentNode.scrollIntoView(); </pre>

Question owner

That's perfect! I can't thank you enough.

By the way, it handled 867 bookmarks without error.

Thanks a million.

That's perfect! I can't thank you enough. By the way, it handled 867 bookmarks without error. Thanks a million.
cor-el
  • Top 10 Contributor
  • Moderator
17693 solutions 160087 answers

Here are two other versions of the above posted bookmarklet with background color in case someone is interested. You can modify the regular expression to limit what URLs and names to include. Try the second version on this website.


Natural sorting (unsorted):

var d=document;
var stl=d.createElement("style");
d.getElementsByTagName('head')[0].appendChild(stl);
stl.textContent = 
'body{counter-reset:links}td.name:before{content:"["counter(links)"] "; counter-increment:links; background-color:#ff7;}\n'+
'body>h1,body>dl{display:none}\n'+
'table{background-color:#ffb; empty-cells:show;}\n'+
'td{font-family:Verdana,Arial,Sans-Serif; font-size: 100%; padding: 1px 2px; vertical-align:top;}\n'+
'.header{background-color:#ffd;}\n'+
'.wrap{table-layout:fixed; width:100%; overflow:hidden; word-wrap:break-word; border-spacing:0;}\n';
var tbl=d.createElement("table");
d.body.appendChild(tbl);
var aels=d.querySelectorAll('a[href]');
tbl.outerHTML='<table border="1" cellspacing="0"><thead><tr class="header"><th>Name</th><th>URL</th><th>Description</th></tr></thead><tbody id="tbod"></tbody></table>';
var i,n,l,c,t=d.getElementById("tbod");
for (i=0;a=aels[i];i++){
  l=a.href;
  n=a.textContent;
  if (/^https?:|^ftps?:/.test(l) && /.+/.test(n)){
   c=a.parentNode.nextElementSibling && a.parentNode.nextElementSibling.nodeName=="DD"?a.parentNode.nextElementSibling.textContent:"";
   t.insertAdjacentHTML('beforeend','<tr><td><table class="wrap"><tr><td class="name">'+n+'</td></tr></table></td><td><table class="wrap"><tr><td class="link">'+l+'</td></tr></table></td><td ><table class="wrap"><tr><td class="desc">'+c+'</td></tr></table></td></tr>');
  }
}
t.parentNode.scrollIntoView();

Sorted list:

var d=document;
function bm(h,t,y,d){with(this){uri=h;title=t;type=y;description=d;}}
bm.prototype={uri:"",title:"",type:"",description:""};
function soh(a,b){return(a.uri>b.uri)}
function sot(a,b){return(a.title.toLowerCase()>b.title.toLowerCase())}
var s='',S=s?new RegExp(s,'i'):/^https?:|^ftps?:/,L=1,O=1;
var BM=[],BS=[null,soh,sot],T=[],ty="text/x-moz-place";
var n=d.querySelectorAll('a[href]'),N;
for(i=0;N=n[i];i++){
 if(S.test(N.href)){
 dd=N.parentNode.nextElementSibling && N.parentNode.nextElementSibling.nodeName=="DD"?N.parentNode.nextElementSibling.textContent:"";
 BM.push(new bm(N.href,N.textContent,ty,dd))}
}
if(O){BM=BM.sort(BS[O])}
var stl=d.createElement("style");
d.getElementsByTagName('head')[0].appendChild(stl);
stl.textContent = 
'body{counter-reset:links}td.name:before{content:"["counter(links)"] ";counter-increment:links;background-color:#ff7;}\n'+
'body>h1,body>dl{display:none}\n'+
'table{background-color:#ffb; empty-cells:show;}\n'+
'td{font-family:Verdana,Arial,Sans-Serif; font-size: 100%; padding: 1px 2px; vertical-align:top;}\n'+
'.header{background-color:#ffd;}\n'+
'.wrap{table-layout:fixed; width:100%; overflow:hidden; word-wrap:break-word; border-spacing:0;}\n';
var tbl=d.createElement("table");
d.body.appendChild(tbl);
tbl.outerHTML = '<table border="1" cellspacing="0"><thead><tr class="header"><th>Name</th><th>URL</th><th>Description</th></tr></thead><tbody id="tbod"></tbody></table>';
var i,n,l,t=d.getElementById("tbod");
for (i=0; b=BM[i]; i++){
  n = b.textContent;
  if (/.+/.test(n)){
   l=b.uri;
   t.insertAdjacentHTML('beforeend','<tr><td><table class="wrap"><tr><td class="name">'+b.title+'</td></tr></table></td><td><table class="wrap"><tr><td class="link">'+b.uri+'</td></tr></table></td><td ><table class="wrap"><tr><td class="desc">'+b.description+'</td></tr></table></td></tr>');
  }
}
t.parentNode.scrollIntoView();
Here are two other versions of the above posted bookmarklet with background color in case someone is interested. You can modify the regular expression to limit what URLs and names to include. Try the second version on this website. ---- Natural sorting (unsorted): <pre><nowiki>var d=document; var stl=d.createElement("style"); d.getElementsByTagName('head')[0].appendChild(stl); stl.textContent = 'body{counter-reset:links}td.name:before{content:"["counter(links)"] "; counter-increment:links; background-color:#ff7;}\n'+ 'body>h1,body>dl{display:none}\n'+ 'table{background-color:#ffb; empty-cells:show;}\n'+ 'td{font-family:Verdana,Arial,Sans-Serif; font-size: 100%; padding: 1px 2px; vertical-align:top;}\n'+ '.header{background-color:#ffd;}\n'+ '.wrap{table-layout:fixed; width:100%; overflow:hidden; word-wrap:break-word; border-spacing:0;}\n'; var tbl=d.createElement("table"); d.body.appendChild(tbl); var aels=d.querySelectorAll('a[href]'); tbl.outerHTML='<table border="1" cellspacing="0"><thead><tr class="header"><th>Name</th><th>URL</th><th>Description</th></tr></thead><tbody id="tbod"></tbody></table>'; var i,n,l,c,t=d.getElementById("tbod"); for (i=0;a=aels[i];i++){ l=a.href; n=a.textContent; if (/^https?:|^ftps?:/.test(l) && /.+/.test(n)){ c=a.parentNode.nextElementSibling && a.parentNode.nextElementSibling.nodeName=="DD"?a.parentNode.nextElementSibling.textContent:""; t.insertAdjacentHTML('beforeend','<tr><td><table class="wrap"><tr><td class="name">'+n+'</td></tr></table></td><td><table class="wrap"><tr><td class="link">'+l+'</td></tr></table></td><td ><table class="wrap"><tr><td class="desc">'+c+'</td></tr></table></td></tr>'); } } t.parentNode.scrollIntoView(); </nowiki></pre> ---- Sorted list: <pre><nowiki>var d=document; function bm(h,t,y,d){with(this){uri=h;title=t;type=y;description=d;}} bm.prototype={uri:"",title:"",type:"",description:""}; function soh(a,b){return(a.uri>b.uri)} function sot(a,b){return(a.title.toLowerCase()>b.title.toLowerCase())} var s='',S=s?new RegExp(s,'i'):/^https?:|^ftps?:/,L=1,O=1; var BM=[],BS=[null,soh,sot],T=[],ty="text/x-moz-place"; var n=d.querySelectorAll('a[href]'),N; for(i=0;N=n[i];i++){ if(S.test(N.href)){ dd=N.parentNode.nextElementSibling && N.parentNode.nextElementSibling.nodeName=="DD"?N.parentNode.nextElementSibling.textContent:""; BM.push(new bm(N.href,N.textContent,ty,dd))} } if(O){BM=BM.sort(BS[O])} var stl=d.createElement("style"); d.getElementsByTagName('head')[0].appendChild(stl); stl.textContent = 'body{counter-reset:links}td.name:before{content:"["counter(links)"] ";counter-increment:links;background-color:#ff7;}\n'+ 'body>h1,body>dl{display:none}\n'+ 'table{background-color:#ffb; empty-cells:show;}\n'+ 'td{font-family:Verdana,Arial,Sans-Serif; font-size: 100%; padding: 1px 2px; vertical-align:top;}\n'+ '.header{background-color:#ffd;}\n'+ '.wrap{table-layout:fixed; width:100%; overflow:hidden; word-wrap:break-word; border-spacing:0;}\n'; var tbl=d.createElement("table"); d.body.appendChild(tbl); tbl.outerHTML = '<table border="1" cellspacing="0"><thead><tr class="header"><th>Name</th><th>URL</th><th>Description</th></tr></thead><tbody id="tbod"></tbody></table>'; var i,n,l,t=d.getElementById("tbod"); for (i=0; b=BM[i]; i++){ n = b.textContent; if (/.+/.test(n)){ l=b.uri; t.insertAdjacentHTML('beforeend','<tr><td><table class="wrap"><tr><td class="name">'+b.title+'</td></tr></table></td><td><table class="wrap"><tr><td class="link">'+b.uri+'</td></tr></table></td><td ><table class="wrap"><tr><td class="desc">'+b.description+'</td></tr></table></td></tr>'); } } t.parentNode.scrollIntoView(); </nowiki></pre>

Modified by cor-el