Counts - Counting bookmarks history links and other data - Firefox

From MozillaZine Knowledge Base
Jump to navigationJump to search

This article addresses obtaining various counts from Firefox concerning Firefox features (bookmarks, history) and counts of such things as links within active page, along with some calculation features.

Bookmarks and links


Bookmarks are available with "Ctrl+B". "Ctrl+Shift+B" can show "visit count" per item. For a summary with all items search for :// or http.

Counting Bookmarks in the Library List

  • Count of Bookmarks
    • search Bookmarks Library List with  : (colon) to find all bookmarks
    • count of bookmarks will be visible after slight movement of scrollbar
  • Count of Bookmarks with keywords
    • search Bookmarks Library List with  : (colon) to find all bookmarks
    • click on keyword column header
    • select only bookmarks with keywords
    • count bookmarks with keywords will be visible after slight movement of scrollbar
  • Count of Bookmarks with tags
    • search Bookmarks Library List with  : (colon) to find all bookmarks
    • click on tag column header
    • select only bookmarks with tags
    • count of bookmarks with tags will be visible after slight movement of scrollbar
  • Count of Bookmarks with descriptions
    • search Bookmarks Library List with  : (colon) to find all bookmarks
    • click on Description column header
    • select only bookmarks with descriptions
    • count of bookmarks with descriptions will be visible after slight movement of scrollbar

By searching for "javascript:" you can limit any of the above to bookmarklets (contain JavaScript).
By searching for "%S" you can limit any of the above to those that that have keyworded Firefox substitution.
Note the searches are not case-sensitive.

Note "Ctrl+Shift+B" gets you Organize Bookmarks, but if you have converted from older bookmarks the keyboard shortcut may not work, in which case use "Ctrl+Shift+H" for History then select All Bookmarks.

To get a better overview of the displayed results install the Show Parent Folder and Go Parent Folder add-ons. Include the "Parent folder" column in the library listing through the View menu (or the context menu of the column headers). You can't sort entries using that column, though.


History is available with "Ctrl+H". "Ctrl+Shift+H" can show "visit count" per item but not a summary, unless you do a search (:// or http).

  • Number of visits to current page ("Ctrl+Shift+H", your own history)


  • Linky :: Firefox Add-ons (32KB), total number of links and images on the page is provided before continuing from main context menu, extension provides for opening many tabs from a selection of selected page links into new tabs but if your selection count exceeds 99 links you must reduce the selection area or the number of check-marked links and work from there to get usable counts.
  • Snap Links Plus (??KB), or Multi Links :: Firefox Add-ons (16 KB), allow you to open, copy or bookmark links using a drawable selection area. Snap Links Plus allows you to see a count of the selected links in the status bar.
  • Links Counter :: Firefox Add-ons (13KB), counts external links without 'nofollow', external links with 'nofollow' and domain internal links in a page (status bar hog, no option to hide). (Has not been updated for current versions of Firefox)
  • Also see Bookmarks (above), and Bookmarklets (below).

Page size

  • Size of current page, subject to server response. "Tools -> Page Info -> General (tab)"
  • The Web Developer (399KB), Firefox add-on provides total page weight, size including all images, stylesheets. "Web Developer -> Information -> View Document Size". The report can be expanded to show size of each item.

Download size

  • Download sizes are provided on addons pages
  • Link size provided in "Properties" context menu subject to server response. Firefox 3.6 and up needs an extension.
(Bug 515368 - missing page and image "Properties" menu item -- marked Won't Fix )
([Extended Link Properties] (7KB), ver 1.2.4 available, [extensions.checkCompatibility.3.6b] or .3.7a)



Items shown with borders are as shown on statusbar, toolbars, or in dialog boxes, or a selected button.


  • Count Em All :: Firefox Add-ons (8KB), Counts your addons, plugins, themes, cookies, downloads, and error console messages! Count [Experimental]
  • Find All (33KB) addition to Find Bar, includes a count of find hits displayed on Find Bar.
Example to find links with Javascript use the "href:" bookmarklet followed by a Find all search for "[-- javascript:".
  • Mouseless Browsing (132.1 KB) adds small boxes with unique ids behind every link and/or form element.
  • Text Area Word Counter (10KB), Counts the number of words and characters in a web page textarea - great for bloggers who want to word count their posts. [Experimental]
  • Word Count Plus (9KB), status bar counts for words in current selection, and a running total.

Usage Statistics

  • about:me (46KB), (graphs) personalized patterns in browser usage, including trends in browsing history and download activity.
  • about:search (42KB), (graphs) statistical analysis (graphs) of the user's search history



Bookmarklets below show a suggested keyword in boldface. If not found below most are in k.html for folders to install on bookmarks toolbar.

  • strings:count  count strings on a page (ID), provides a dialog "Search for what string?"
 lowercase   --  Found 7 occurrences of "lowercase". 
  • words:  word count, get bookmarklet at k.html test by selecting a few words, or if you seleted the entire page you might see something like
 words in selection: 11615 

Bookmarklets related to web page constructions

  • bml:  mark/count bookmarklet to identify and count JavaScript links in bookmarks.html list, test examples in k.html which has all bookmarklets and can be used to test. Such links will appear like -- bml: mark/count bookmarket links in bookmarks.html list along with a message similar to Counted/formatted 200 Bookmarklets within 830 bookmarks
javascript:(function(){var%20s,i,k=0,l=document.links;for(i=0;i<l.length;i++){if(l[i].href.indexOf('javascript:')!=0)continue;k=k+1;s=l[i].style;s.backgroundColor='#eee';s.color='#006400';s.border='1px%20outset%20#333';s.textDecoration='none';s.padding='1px';s.fontWeight='normal';fontFamily='sans-serif';whiteSpace=%22nowrap%22;s.fontSize='80%';s.lineHeight='120%';verticalAlign=%223px%22;}%20alert('Counted/formatted%20'+k+ '%20Bookmarklets%20within%20'+document.links.length+'%20Bookmarks');})()
  • bullets:#  (not a count),  bullets to numbers, converts list item bullets to numbered list
javascript:uls=document.getElementsByTagName('ul'); %20for%20(i=uls.length-;%20i>=0;%20--i)%20{%20oldul%20=%20uls[i]; %20newol%20=%20document.createElement("ol");%20for(j=0; <oldul.childNodes.length;++j)%20newol.appendChild(oldul.childNodes[j].cloneNode(true)); %20oldul.parentNode.replaceChild(newol,%20oldul);%20}%20void%200
  • href:  (not a count),  expands all links on a page to show the url or JavaScript code with href="..." of anchor tags (" HREF visible, keyword: href:) based on “Paren Tips” (keyword: parentips:) makes Title with HTML visible ([1])
javascript:(function(){%20var%20z=],N,href,tc,j; %20function%20r(N)%20{%20if%20(N.href)%20z.push(N);%20var%20C=N.childNodes,i;for(i=0;i<C.length;++i)r(C[i]);%20}%20r(document.body);%20for%20(j%20in%20z)%20{%20N=z[j]; %20href=document.createTextNode(%2220[--\u00A0%22+N.href+22%20--]%22); %20tc=document.createElement(%22span%22);;;%20tc.appendChild(href); %20N.parentNode.insertBefore(tc,N.nextSibling); %20N.parentNode.insertBefore(document.createTextNode(%22%20%22),tc);%20}})();
  • href:count,    Count of HREF in HTML anchor tags, You can see this in action by clicking on link that has "href:count" within k.html works on an exported bookmarks.html file produces a box like  Href count: 585 [OK]  (similar to keywords:count)
  • images:count,  Count images on page. Counts only image for which you can use "View Image".  this document contains 13 images [OK]  [2]
javascript:function%20bookmarklet_count_all_images(){alert%20('this%20document%20contains%20'%20+%20document.images.length%20 +%20'%20images');}bookmarklet_count_all_images();
  • keywords:count,  Count keywords example ([3]) – You can see this in action by clicking on k.html link that has "keywords:" within an exported bookmarks.html file produces a box like  Keywords found: 417 [OK]  -- goal would be for this to work from a selection
  • trows:  Number Rows in Tables, places row number at beginning of each row (Number Row)
javascript:(function(){function%20has(par,ctag){for(var%20k=0;k<par.childNodes.length;++k)if(par.childNodes[k].tagName==ctag)return%20true;} %20function%20add(par,ctag,text)var%20c=document.createElement(ctag); %20c.appendChild(document.createTextNode(text));%20par.insertBefore(c,par.childNodes[0]);} %20var%20i,ts=document.getElementsByTagName('TABLE');%20for(i=0;<ts.length;++i)%20{%20var %20n=0,trs=ts[i].rows,j,tr;%20for(j=0;<trs.length;++j)%20{tr=trs[j];%20if(has(tr,'TD'))add(tr,'TD',++n); %20else%20if(has(tr,'TH'))add(tr,'TH','Row');}}})()
  • word:freq   word frequency  Lists the words in the page and how many times each word appears.


External links

Note also the disappearing/reappearing scope at the top of the Library listing, only appears after first doing a search.
Search:    Selected Folder    All Bookmarks   History
Search:   Selected Folder (only)    Selected Folder & all subfolders    All Bookmarks   History