Counts - Counting bookmarks history links and other data - Firefox: Difference between revisions

From MozillaZine Knowledge Base
Jump to navigationJump to search
(→‎Tabs: Images for extension How Many Times Can I Back?)
 
(44 intermediate revisions by 4 users not shown)
Line 1: Line 1:
{{cleanup}}
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.
 
   
This article addresses obtaining various Counts from Firefox concerning Firefox features (bookmarks, history) and counts of such things (links) within active page, along with some calculation features.   Currently this is just a framework as there is lot of information needed to fill in items without links. (For items specifically not covered see [[Talk:Counts]] page.)
==Bookmarks and links==
 
===Bookmarks===
==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 <i>://</i> or <i>http</i>.
Don't have complete answers for several count items.


'''Sub-folders restriction:'''  Counting bookmarks with a search is rather limited since the search is not looking at "All Bookmarks" and does not search sub-folders, see bug reports.  In the meantime you may have to work with an exported bookmarks listing (bookmarks.html) and use the  '''href:count''' bookmarklet described in this article.
'''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


===Bookmarks===
By searching for "javascript:" you can limit any of the above to bookmarklets (contain JavaScript).
Bookmarks are available with Ctrl+B,  Ctrl+Shift+B can show "'''visit count'''" per item but not a summary, unless you do a search such as including "://"  or  "http"    (see '''sub-folders restriction''' above)
<br>By searching for "%S" you can limit any of the above to those that that have keyworded Firefox substitution.
* Bookmarks
<br>Note the searches are not case-sensitive.
* Bookmarks with keywords, all, in a folder (1st level of a folder, all levels within)
* Bookmarks with tags,  Total # of defined tags (1st level of a folder, all levels within)
* Bookmarks with description


===Bookmark Folders===
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.
Goal is to be able to get a total on all bookmark, within a folder,  within a folder and sub-folders (see '''sub-folders restriction''' above).
* Bookmarks in folder: 1st level, all
: will get 1st level within a folder in Library List (Ctrl+Shift+B, but not sub folders. There is no count in bookmarks sidebar (Ctrl+B)
* Folders in folder:  1st level, all


<span style="font-size:85%; color:#008;">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.</span>
To get a better overview of the displayed results install the [https://addons.mozilla.org/firefox/addon/7372 Show Parent Folder] and [https://addons.mozilla.org/firefox/addon/7377 Go Parent Folder] add-ons. Include the "Parent folder" column in the library listing through the <em>View</em> menu (or the context menu of the column headers). You can't sort entries using that column, though.


===History===
===History===
History is available with Ctrl+HCtrl+Shift+H can show "visit count" per item but not a summary, unless you do a search
History is available with "Ctrl+H". "Ctrl+Shift+H" can show "visit count" per item but not a summary, unless you do a search (<i>://</i> or <i>http</i>).
* Number of visits to current page (Ctrl+Shift+H, your own history)
* Number of visits to current page ("Ctrl+Shift+H", your own history)
* Number of bookmarks pointing to this page (Ctrl+Shift+B, your own bookmarks), Note older versions converted to version 3 may have to use Organize Bookmarks if shortcut is not available.  
<!--* Number of bookmarks pointing to this page ("Ctrl+Shift+B", your own bookmarks), Note older versions converted to version 3 may have to use Organize Bookmarks if shortcut is not available.  
|||||@>-,----------- I don't get this. Why would entries point to the history? Is this "Visit Date"?-->


===Library===
===Links===
Library list is obtained from Bookmarks (menu), Organize Bookmarks  (version 3 non upgraded users can use Ctrl+Shift+B 
* [https://addons.mozilla.org/firefox/addon/425 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.
* [http://snaplinks.mozdev.org/ Snap Links Plus]  (??KB), or [https://addons.mozilla.org/en-US/firefox/addon/13494 Multi Links 1.0.0.12 :: 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.
* [https://addons.mozilla.org/firefox/addon/5887 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|Bookmarks]] (above), and [[#Bookmarklets|Bookmarklets]] (below).


See ''sub-folders restriction''  near top.
===Page size===
*Size of current page, subject to server response. "Tools -> Page Info -> General (tab)"
*The [https://addons.mozilla.org/firefox/addon/60 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.


Bring up the Library window and do a search on "://that should pick up both "html://" and "htmls//". If you want to include bookmarklets perhaps search on " " (space) instead.   To restrict to bookmarklets try "Javascript".
===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 )
:([[https://addons.mozilla.org/en-US/firefox/addon/798 Extended Link Properties]] (7KB), ver 1.2.4 available,  [[http://kb.mozillazine.org/Extensions.checkCompatibility extensions.checkCompatibility.3.6b]] or .3.7a)


There will be a count at the bottom, if the fixed portion at the bottom prevents that display, just move the vertical scrollbar a little bit and the total will appear in the properties area. If too few for vertical scrollbar to appear then count them, or  right-click on empty space on the main area on the right side.  If an item in the list is already selected redo the search then do the right-click.
===Position===
* [[https://addons.mozilla.org/firefox/addon/743 CustomizeGoogle :: Add-ons for Firefox]] (290KB), provides option for item position counter in Google web search (not available in groups search).


You will have to do this for each major folder, and it will not pick up from  All Bookmarks, and it will not include sub-folders.   (see '''sub-folders restriction''' near top of this article).  The scope of search will be fixed for Firefox 3.1 (bug [https://bugzilla.mozilla.org/show_bug.cgi?id=451151 451151]) so that subfolders are also included (recursive).
==Tabs==
* [https://addons.mozilla.org/firefox/addon/4346 '''Tab Counter''' :: Firefox Add-ons] (22KB), counts the number of open tabs per window and displays the count in a ''toolbar''.  <span style="border:1px gray solid">&nbsp;22&nbsp;</span>
* [https://addons.mozilla.org/firefox/addon/6391 TabCounter :: Firefox Add-ons] (9KB), tab counters on status bar (separate boxes). Provides some historical stats as well<span style="border:1px black solid">&nbsp;22|25&nbsp;</span>&nbsp; <span style="border:1px black solid">&nbsp;3|25&nbsp;</span>
* [https://addons.mozilla.org/firefox/addon/8363 Open Tab Count :: Firefox Add-ons] (4KB), displays the number of open tabs for each window and the total number of open tabs (in all windows) in the status bar. <span style="border:1px black solid">&nbsp;22/25&nbsp;</span>&nbsp; <span style="border:1px black solid">&nbsp;3/25&nbsp;</span>
* [https://addons.mozilla.org/firefox/addon/4422 TabCount :: Firefox Add-ons] (6KB), status bar panel to display the number of currently open tabs both in the active window and across all windows. <span style="border:1px black solid">&nbsp;22/25&nbsp;</span>&nbsp; <span style="border:1px black solid">&nbsp;3/25&nbsp;</span>
* [https://addons.mozilla.org/firefox/addon/how-many-times-can-i-back/ '''How Many Times Can I Back?''' :: Add-ons for Firefox] (13.3KB), Count of  items available using BACK/FORWARD buttons [[image:BackForwardCounts.png]] and/or page number within total pages shown for each tab [[image:WithinTabCount.png]].
Items shown with borders are as shown on statusbar, toolbars, or in dialog boxes, or a selected button.


To get a better idea of what you are actually looking at in your results, suggest installing the [https://addons.mozilla.org/firefox/7372 Show Parent Folder]" extensionInclude the "Parent folder" column in the library listing through View menu (or context menu of column headers). Sorting on that column will show the hierarchy of the results.
==Addons==
* [https://addons.mozilla.org/firefox/addon/7976 Count Em All :: Firefox Add-ons] (8KB), Counts your addons, plugins, themes, cookies, downloads, and error console messages! Count [Experimental]
* [https://addons.mozilla.org/firefox/addon/7299 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 "[--&nbsp;javascript:".
* [https://addons.mozilla.org/firefox/addon/mouseless-browsing/#id=879 Mouseless Browsing ] (132.1 KB) adds small boxes with unique ids behind every link and/or form element.
* [https://addons.mozilla.org/firefox/addon/3735 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]
* [https://addons.mozilla.org/firefox/addon/4718 Word Count Plus] (9KB), status bar counts for words in current selection,  and a running total.


===Links===
==Usage Statistics==
* [https://addons.mozilla.org/firefox/425 Linky :: Firefox Add-ons], 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 which links you choose to open.
* [https://addons.mozilla.org/firefox/addon/13681 about:me] (46KB), (graphs) personalized patterns in browser usage, including trends in browsing history and download activity.  
* [https://addons.mozilla.org/firefox/5887 Links Counter :: Firefox Add-ons] count links inside a page (External, No follow, Internal). It is
* [http://surfmind.com/lab/mozilla/aboutsearch/ about:search] (42KB), (graphs) statistical analysis (graphs) of the user's search history
* Count of Links by type
* (also see bookmarks, below)


==Tabs==
==Body==
* [https://addons.mozilla.org/firefox/4346<b>Tab Counter</b> :: Firefox Add-ons], counts the number of open tabs per window and displays the count in a ''toolbar''. (22KB) <span style="border:1px gray solid">&nbsp;22&nbsp;</span>
* [https://addons.mozilla.org/firefox/addon/8664 Quick Calculator :: Firefox Add-ons] (44KB), Show SUM MIN MAX AVERAGE and QUANTITY of selected items in status bar.  <nowiki>[Experimental]</nowiki>
* [https://addons.mozilla.org/firefox/6391 TabCounter :: Firefox Add-ons], tab counters on status bar (separate boxes). Provides some historical stats as well.  (9KB) <span style="border:1px black solid">&nbsp;22|25&nbsp;</span>&nbsp; <span style="border:1px black solid">&nbsp;3|25&nbsp;</span>
* [https://addons.mozilla.org/firefox/8363 Open Tab Count :: Firefox Add-ons], displays the number of open tabs for each window and the total number of open tabs (in all windows) in the status bar.  (4KB)  <span style="border:1px black solid">&nbsp;22/25&nbsp;</span>&nbsp; <span style="border:1px black solid">&nbsp;3/25&nbsp;</span>  
* [https://addons.mozilla.org/firefox/4422 TabCount :: Firefox Add-ons] status bar panel to display the number of currently open tabs both in the active window and across all windows. (6KB) <span style="border:1px black solid">&nbsp;22/25&nbsp;</span>&nbsp; <span style="border:1px black solid">&nbsp;3/25&nbsp;</span>
* Count of History items within current tab (back/forward key) and all tabs,  not a count of the links within the active page.


==Addons==
* [http://timmyminer.mozdev.org/ timmyminer - mozdev.org] (399KB), word &amp; expressions frequency counts
* [https://addons.mozilla.org/firefox/7976 Count Em All :: Firefox Add-ons] Counts your addons, plugins, themes, cookies, downloads, and error console messages! Count  [Experimental]


==Body==
* [https://addons.mozilla.org/firefox/addon/3735 Text Area Word Counter :: Firefox Add-ons] (10 KB), [http://ginatrapani.org/workshop/firefox/textareawordcounter/ Gina Trapani], total number of words, total characters with and without spaces not counting HTML. Total of all the text areas in a document.
* [https://addons.mozilla.org/firefox/8664 Quick Calculator :: Firefox Add-ons], Show SUM MIN MAX AVERAGE and QUANTITY of selected items in status bar.  44KB) <nowiki>[Experimental</nowiki>
* [https://addons.mozilla.org/firefox/3735 Text Area Word Counter :: Firefox Add-ons] Counts the number of words and characters in a web page textareas. (10 KB)
* [http://timmyminer.mozdev.org/ timmyminer - mozdev.org] word &amp; expressions frequency counts
* [https://addons.mozilla.org/firefox/4718 Word Count Plus :: Firefox Add-ons] Counts number of words in selected text (browser content pane). Can add the count to a running total. Shown on status bar (space hog).  <nowiki>[</nowiki>[http://wordcountplus.mozdev.org/betarelease.html Beta with shortcuts] (13KB)<nowiki>]</nowiki> (9KB) <span style="border:1px black solid">&nbsp;22|25&nbsp;</span> <span style="border:1px black solid">&nbsp;2 words | 128 total&nbsp;</span>
* [https://addons.mozilla.org/en-US/firefox/addon/3735 Text Area Word Counter :: Firefox Add-ons], [http://ginatrapani.org/workshop/firefox/textareawordcounter/ Gina Trapani],   total number of words, total characters with and without spaces not counting HTML.   Total of all the text areas in a document.


* [https://addons.mozilla.org/firefox/addon/4718 Word Count Plus :: Firefox Add-ons] (9KB), Counts number of words in selected text (browser content pane). Can add the count to a running total. Shown on status bar (statusbar hog). <nowiki>[</nowiki>[http://wordcountplus.mozdev.org/betarelease.html Beta with shortcuts] (13KB)<nowiki>]</nowiki> (9KB) <span style="border:1px black solid">&nbsp;22|25&nbsp;</span> <span style="border:1px black solid">&nbsp;2 words | 128 total&nbsp;</span>


===Bookmarklets===
===Bookmarklets===
If not found below most are in [http://www.mvps.org/dmcritchie/firefox/lessons/intro/k.html k.html] for folders to install on bookmarks toolbar.
Bookmarklets below show a suggested keyword in '''boldface'''.  If not found below most are in [http://www.mvps.org/dmcritchie/firefox/lessons/intro/k.html k.html] for folders to install on bookmarks toolbar.
* [https://www.squarefree.com/bookmarklets/forms.html#character_count '''Character Count''' :: Form Bookmarklets] (F), Displays a running count of the characters in each textbox.&nbsp;  <nowiki>[ keyword: character:count ]</nowiki>
* '''character:count'''&nbsp; Displays a running count of the characters in each textbox.&nbsp;  ([https://www.squarefree.com/bookmarklets/forms.html#character_count Character Count :: Form Bookmarklets] (F),<nowiki>[ keyword: character:count ]</nowiki>
:: <nowiki>javascript:(function(){var%20D=document,i,f,j,e;for(i=0;f=D.forms[i];++i)for(j=0;e=f[j];++j)if(e.type=="text"||e.type=="password"||e.tagName.toLowerCase()=="textarea")S(e);function%20S(e){if(!e.N){var%20x=D.createElement("span"),s=x.style;s.color="green";s.background="white";s.font="bold%2010pt%20sans-serif";s.verticalAlign="top";e.parentNode.insertBefore(x,e.nextSibling);function%20u(){x.innerHTML=e.value.length;}u();e.onchange=u;e.onkeyup=u;e.oninput=u;e.N=x;}else{e.parentNode.removeChild(e.N);e.N=0;}}})()</nowiki>
:: <code><nowiki>javascript:(function(){var%20D=document,i,f,j,e;for(i=0;f=D.forms[i];++i)for(j=0;e=f[j];++j)if(e.type=="text"||e.type=="password"||e.tagName.toLowerCase()=="textarea")S(e);function%20S(e){if(!e.N){var%20x=D.createElement("span"),s=x.style;s.color="green";s.background="white";s.font="bold%2010pt%20sans-serif";s.verticalAlign="top";e.parentNode.insertBefore(x,e.nextSibling);function%20u(){x.innerHTML=e.value.length;}u();e.onchange=u;e.onkeyup=u;e.oninput=u;e.N=x;}else{e.parentNode.removeChild(e.N);e.N=0;}}})()</nowiki></code>
* '''count strings on a page'''  (ID), provides a dialog "Search for what string?" <span style="border:1px black solid">&nbsp;lowercase &nbsp;</span> -- <span style="border:1px black solid">&nbsp;Found 7 occurrences of "lowercase".&nbsp;</span>
* '''strings:count'''&nbsp; count strings on a page (ID), provides a dialog "Search for what string?"  
:: <nowiki>javascript:void%20new%20Function(%22var%20c=0,w=prompt('Search%20for%20what%20string?',''),y=pageYOffset;if(w){while(find(w))c++;scrollBy(0,y-pageYOffset);alert('Found%20'+c+'%20occurrence'+(c==1?'':'s')+'%20of%20\%22'+w+'\%22.')}%22).call()</nowiki>
:: <span style="border:1px black solid">&nbsp;lowercase &nbsp;</span> -- <span style="border:1px black solid">&nbsp;Found 7 occurrences of "lowercase".&nbsp;</span>
* '''href:''' (not a count), expands all links on a page to show the url or JavaScript code with href="..." of anchor tags, read about at [http://www.mvps.org/dmcritchie/ie/bookmarklets.htm Bookmarklets (JavaScript Favelets)] ,  modified by [[User:Dmcritchie | D.McRitchie]] from “Paren Tips” ('''parentips:''') found at [https://www.squarefree.com/bookmarklets/sitespecific.html Squarefree.com] <span style="background-color:#FFEE99"><nowiki>[-- https://www.squarefree.com/bookmarklets/sitespecific.html --]</nowiki></span> <span style="background-color:#EEECB9"><nowiki>(example of a TITLE statement made visible by "paren tips")</nowiki></span>
:: <code><nowiki>javascript:void%20new%20Function(%22var%20c=0,w=prompt('Search%20for%20what%20string?',''),y=pageYOffset;if(w){while(find(w))c++;scrollBy(0,y-pageYOffset);alert('Found%20'+c+'%20occurrence'+(c==1?'':'s')+'%20of%20\%22'+w+'\%22.')}%22).call()</nowiki></code>
* '''words:'''&nbsp; word count, get bookmarklet at [http://www.mvps.org/dmcritchie/firefox/lessons/intro/k.html k.html] test by selecting a few words, or if you seleted the entire page you might see something like
:: <span style="border:1px black solid">&nbsp;words&nbsp;in&nbsp;selection:&nbsp;11615&nbsp;</span>  
:: <code><nowiki>javascript:alert('words%20in%20selection:%20'%20+%20document.getSelection().split('%20').length)</nowiki></code>


:: Colors shown above are as generated by the bookmarklets described.
====Bookmarklets related to web page constructions====
:: Items shown with borders are as shown on statusbar or in message boxes.
* '''bml:'''&nbsp;  mark/count bookmarklet to identify and count '''JavaScript links''' in bookmarks.html list,  test examples in [http://www.mvps.org/dmcritchie/firefox/lessons/intro/k.html k.html] which has all bookmarklets and can be used to test.   Such links will appear like -- <span style="background-color:#eee; color:#006400; border:1px  outset #333; text-decorator:none; padding:1px; font-weight:normalfont-family:sans-serif; font-size:80%line-height:120%;vertical-align:3px;">bml:&nbsp;mark/count&nbsp;bookmarket&nbsp;links&nbsp;in&nbsp;bookmarks.html&nbsp;list</span> along with a message similar to <span style="border:1px black solid">Counted/formatted&nbsp;200&nbsp;Bookmarklets&nbsp;within&nbsp;830&nbsp;bookmarks</span>
:: <code><nowiki>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');})() </nowiki></code>


:: 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(%22%20[--\u00A0%22+N.href+%22%20--]%22);%20tc=document.createElement(%22span%22);%20tc.style.color=%22green%22;%20tc.style.background=%22#FFEE99%22;%20tc.appendChild(href);%20N.parentNode.insertBefore(tc,N.nextSibling);%20N.parentNode.insertBefore(document.createTextNode(%22%20%22),tc);%20}})();
* '''bullets:#'''&nbsp; (not a count),&nbsp; [https://www.squarefree.com/bookmarklets/pagedata.html bullets to numbers], converts list item bullets to numbered list
* '''href:count''',  Count of HREF in HTML anchor tags, You can see this in action by clicking on link that has "href:count" within [http://www.mvps.org/dmcritchie/firefox/lessons/intro/k.html k.html] works on an exported bookmarks.html file  produces a box like <span style="border:1px black solid">&nbsp;Href count: 585 [OK]&nbsp;</span> -- modified by D.McRitchie from keywords:count example by dickvl  -- goal would be for this to work from a selection
:: <code><nowiki>javascript:uls=document.getElementsByTagName('ul');
:: <nowiki>javascript:(function(){var%20c='red',e=document.getElementsByTagName('a'),E,k=0,n,t;%20for(i=0;E=e[i];i++){t=E.getAttribute('HREF');%20if(t&&t!=''){n=document.createElement('span');%20n.style.color=c;n.innerHTML='['+t+']';%20E.appendChild(n);k++}}%20alert('HREF%20count:%20'+k);})()</nowiki>
%20for%20(i=uls.length-;%20i>=0;%20--i)%20{%20oldul%20=%20uls[i];
* '''keywords:count''', Count keywords example  by dickvl  in http://forums.mozillazine.org/viewtopic.php?f=8&t=635673&start=0&st=0&sk=t&sd=a  -- You can see this in action by clicking on link that has "keywords:" within [http://www.mvps.org/dmcritchie/firefox/lessons/intro/k.html k.html] works on an exported bookmarks.html file  produces a box like <span style="border:1px black solid">&nbsp;Keywords found: 417 [OK]&nbsp;</span> -- goal would be for this to work from a selection
%20newol%20=%20document.createElement("ol");%20for(j=0;
:: <nowiki>javascript:(function(){var%20c='red',e=document.getElementsByTagName('a'),E,k=0,n,t;%20for(i=0;E=e[i];i++){t=E.getAttribute('SHORTCUTURL');%20if(t&&t!=''){n=document.createElement('span');%20n.style.color=c;n.innerHTML='['+t+']';%20E.appendChild(n);k++}}%20alert('shortcuts%20found:%20'+k);})()</nowiki>
<oldul.childNodes.length;++j)%20newol.appendChild(oldul.childNodes[j].cloneNode(true));
* [https://www.squarefree.com/bookmarklets/seo.html#word_frequency '''word frequency''' :: SEO Bookmarklets] Lists the words in the page and how many times each word appears.
%20oldul.parentNode.replaceChild(newol,%20oldul);%20}%20void%200</nowiki></code>
:: <nowiki>javascript:(function(){var%20T={},W=[],C=0,s,i;%20function%20F(n){var%20i,x,a,w,t=n.tagName;if(n.nodeType==3){a=n.data.toLowerCase().split(/[\s\(\)\:\,\.;\<\>\&\'\"]/);for(i%20in%20a)if(w=a[i]){w="%20"+w;T[w]=T[w]?T[w]+1:1;++C;}}if(t!="SCRIPT"&&t!="STYLE")for(i=0;x=n.childNodes[i];++i)F(x)}F(document);for(i%20in%20T)W.push([T[i],i]);W.sort(function(a,b){var%20x=b[0]-a[0];return%20x?x:((b[1]<a[1])?1:-1)});%20s="<h3>"+C+"%20words</h3>";for(i%20in%20W)s+=W[i][0]+":"+W[i][1]+"<br>";with(open().document){write(s);close()}})()</nowiki>
* '''href:'''&nbsp; (not a count),&nbsp; expands all links on a page to show the url or JavaScript code with href="..." of anchor tags ([http://www.mvps.org/dmcritchie/firefox/kws.htm#k" HREF visible], keyword: '''href:''') based on “Paren Tips” (keyword: '''parentips:''') makes Title with HTML visible ([https://www.squarefree.com/bookmarklets/sitespecific.html])
* '''words:''' word count, get bookmarklet at [http://www.mvps.org/dmcritchie/firefox/lessons/intro/k.html k.html] test by selecting a few words, or if you seleted the entire page you might see something like    <span style="border:1px black solid">&nbsp;words in selection: 11615&nbsp;</span>
:: <code><nowiki>javascript:(function(){%20var%20z=],N,href,tc,j;
:: <nowiki>javascript:alert('words%20in%20selection:%20'%20+%20document.getSelection().split('%20').length)</nowiki>
%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.style.color=%22green%22;
%20tc.style.background=%22#FFEE99%22;%20tc.appendChild(href);
%20N.parentNode.insertBefore(tc,N.nextSibling);
%20N.parentNode.insertBefore(document.createTextNode(%22%20%22),tc);%20}})();</nowiki></code>
* '''href:count''',&nbsp; &nbsp; Count of HREF in HTML anchor tags, You can see this in action by clicking on link that has "href:count" within [http://www.mvps.org/dmcritchie/firefox/lessons/intro/k.html k.html] works on an exported bookmarks.html file produces a box like <span style="border:1px black solid">&nbsp;Href count: 585 [OK]&nbsp;</span> (similar to '''keywords:count''')
:: <code><nowiki>javascript:(function(){var%20c='red',e=document.getElementsByTagName('a'),E,k=0,n,t;%20for(i=0;E=e[i];i++){t=E.getAttribute('HREF');%20if(t&&t!=''){n=document.createElement('span');%20n.style.color=c;n.innerHTML='['+t+']';%20E.appendChild(n);k++}}%20alert('HREF%20count:%20'+k);})()</nowiki></code>
* '''images:count''',&nbsp; Count images on page. Counts only image for which you can use "View Image".  <span style="border:1px black solid">&nbsp;this&nbsp;document&nbsp;contains&nbsp;13&nbsp;images&nbsp;[OK]&nbsp;</span>  [http://www.manni-heumann.de/soft/misc/bookmarklets.html]
:: <code><nowiki>javascript:function%20bookmarklet_count_all_images(){alert%20('this%20document%20contains%20'%20+%20document.images.length%20 +%20'%20images');}bookmarklet_count_all_images();</nowiki></code>
* '''keywords:count''',&nbsp; Count keywords example ([http://forums.mozillazine.org/viewtopic.php?f=8&t=635673&start=0&st=0&sk=t&sd=a]) &ndash; You can see this in action by clicking on [http://www.mvps.org/dmcritchie/firefox/lessons/intro/k.html k.html link] that has "keywords:" within an exported bookmarks.html file produces a box like <span style="border:1px black solid">&nbsp;Keywords found: 417 [OK]&nbsp;</span> -- goal would be for this to work from a selection
:: <code><nowiki>javascript:(function(){var%20c='red',e=document.getElementsByTagName('a'),E,k=0,n,t;%20for(i=0;E=e[i];i++){t=E.getAttribute('SHORTCUTURL');%20if(t&&t!=''){n=document.createElement('span');%20n.style.color=c;n.innerHTML='['+t+']';%20E.appendChild(n);k++}}%20alert('shortcuts%20found:%20'+k);})()</nowiki></code>
* '''trows:'''&nbsp;  Number Rows in Tables, places row number at beginning of each row ([http://saraswaticlasses.net/sites/links4.php Number Row])
::<code><nowiki>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');}}})()</nowiki></code>
* '''word:freq''' &nbsp; [https://www.squarefree.com/bookmarklets/seo.html#word_frequency '''word frequency''']&nbsp; Lists the words in the page and how many times each word appears.
:: <code><nowiki>javascript:(function(){var%20T={},W=[],C=0,s,i;%20function%20F(n){var%20i,x,a,w,t=n.tagName;if(n.nodeType==3){a=n.data.toLowerCase().split(/[\s\(\)\:\,\.;\<\>\&\'\"]/);for(i%20in%20a)if(w=a[i]){w="%20"+w;T[w]=T[w]?T[w]+1:1;++C;}}if(t!="SCRIPT"&&t!="STYLE")for(i=0;x=n.childNodes[i];++i)F(x)}F(document);for(i%20in%20T)W.push([T[i],i]);W.sort(function(a,b){var%20x=b[0]-a[0];return%20x?x:((b[1]<a[1])?1:-1)});%20s="<h3>"+C+"%20words</h3>";for(i%20in%20W)s+=W[i][0]+":"+W[i][1]+"<br>";with(open().document){write(s);close()}})()</nowiki></code>


===Tables===
===Tables===
* [https://addons.mozilla.org/firefox/2637 TableTools :: Firefox Add-ons] sorts, filters or copies any HTML table. (thought this did totaling, perhaps not)
* [https://addons.mozilla.org/firefox/addon/2637 TableTools :: Firefox Add-ons] sorts, filters or copies any HTML table. (thought this did totaling, perhaps not)
* [[https://addons.mozilla.org/firefox/8664 Quick Calculator :: Firefox Add-ons]Show SUM MIN MAX AVERAGE and QUANTITY of selected items in status bar. <nowiki>[Experimental]</nowiki>
* [https://addons.mozilla.org/firefox/addon/8664 Quick Calculator :: Firefox Add-ons] Show SUM MIN MAX AVERAGE and QUANTITY of selected items in status bar. <nowiki>[Experimental]</nowiki>


==External links==
==External links==
* [https://bugzilla.mozilla.org/show_bug.cgi?id=451151 Bug 451151] - Search box In Places Organizer (Library) not behaving correctly (this is the primary problem with searches, and is marked as a blocker for 3.1)
* [http://groups.google.com/group/mozilla.support.firefox/browse_frm/thread/38a921dc54df664a Counting bookmarks in folders in Fx3 - mozilla.support.firefox] using [https://addons.mozilla.org/firefox/addon/5817 SQLite Manager :: Add-ons for Firefox]
:: Note also the disappearing/reappearing scope at the top of the Library listing, only appears after first doing a search.  
* [http://charcount.appspot.com/ Count Bookmarklet] (appspot.com)  counts for characters/words/lines based on dynamic selection, requires access to an external site.  Works on webpage, text areas, but not in form areas.  [suggest keyword of  "cnt:"]
:: Search: &nbsp; <span style="border: 1px solid;">&nbsp;Selected Folder&nbsp;</span> &nbsp; All Bookmarks &nbsp; History  
* [http://bytes.com/topic/javascript/answers/149648-html-table-row-count HTML table row count - JavaScript / Ajax / DHTML answers], counts the rows in the ''identified table'' - not also the rows of the tables inside the table, place Javascript code after end of table  -- ''document.write(document.getElementById('ext_table'). rows.length)''
* [http://www.webdeveloper.com/forum/archive/index.php/t-44333.html Count Lines in a Text Area] (webdeveloper.com), How to build counting lines text area lines into a webpage.
* [https://bugzilla.mozilla.org/show_bug.cgi?id=451151 Bug 451151] - Search box In Places Organizer (Library) not behaving correctly (this is the primary problem with searches, and is marked as a blocker for 3.1)
:: Note also the disappearing/reappearing scope at the top of the Library listing, only appears after first doing a search.
:: Search: &nbsp; <span style="border: 1px solid;">&nbsp;Selected Folder&nbsp;</span> &nbsp; All Bookmarks &nbsp; History  
* [https://bugzilla.mozilla.org/show_bug.cgi?id=469436 Bug 469436] - In the context bar when searching in the library &quot;selected folder&quot; should be the actual folder name  
* [https://bugzilla.mozilla.org/show_bug.cgi?id=469436 Bug 469436] - In the context bar when searching in the library &quot;selected folder&quot; should be the actual folder name  
* [https://bugzilla.mozilla.org/show_bug.cgi?id=469437 Bug 469437] - Searches in bookmarks sub-folders of the Library window should default to the context of All Bookmarks (&quot;Search Bookmarks&quot;)
* [https://bugzilla.mozilla.org/show_bug.cgi?id=469437 Bug 469437] - Searches in bookmarks sub-folders of the Library window should default to the context of All Bookmarks (&quot;Search Bookmarks&quot;)
* [https://bugzilla.mozilla.org/show_bug.cgi?id=479837 Bug 479837 – (Enhancement) - Clear up scope ambiguity of Library Searches and include counts]
* [https://bugzilla.mozilla.org/show_bug.cgi?id=479837 Bug 479837 – (Enhancement) - Clear up scope ambiguity of Library Searches and include counts]
:: Search: &nbsp; Selected Folder (only) &nbsp; <span style="border: 1px solid;">&nbsp;Selected Folder & all subfolders&nbsp;</span> &nbsp; All Bookmarks &nbsp; History
:: Search: &nbsp; Selected Folder (only) &nbsp; <span style="border: 1px solid;">&nbsp;Selected Folder & all subfolders&nbsp;</span> &nbsp; All Bookmarks &nbsp; History
 
 
<!-- Need to put this article in an appropriate Firefox category and maybe come up with a better title, once it's cleaned up. --  IS IT ACCEPTABLE  NOW,  Basically one of a kind article  -->




[[Category:Bookmarks]]
[[Category:Bookmarks]]
[[Category:History]]
[[Category:History]]
<!-- There is no category for links, if there was would be added to that as well  -->
[[Category:Links]]

Latest revision as of 05:03, 16 February 2014

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

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

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)

Links

  • 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 1.0.0.12 :: 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)

Position

Tabs

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

Addons

  • 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

Body

Bookmarklets

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

javascript:(function(){var%20D=document,i,f,j,e;for(i=0;f=D.forms[i];++i)for(j=0;e=f[j];++j)if(e.type=="text"||e.type=="password"||e.tagName.toLowerCase()=="textarea")S(e);function%20S(e){if(!e.N){var%20x=D.createElement("span"),s=x.style;s.color="green";s.background="white";s.font="bold%2010pt%20sans-serif";s.verticalAlign="top";e.parentNode.insertBefore(x,e.nextSibling);function%20u(){x.innerHTML=e.value.length;}u();e.onchange=u;e.onkeyup=u;e.oninput=u;e.N=x;}else{e.parentNode.removeChild(e.N);e.N=0;}}})()
  • strings:count  count strings on a page (ID), provides a dialog "Search for what string?"
 lowercase   --  Found 7 occurrences of "lowercase". 
javascript:void%20new%20Function(%22var%20c=0,w=prompt('Search%20for%20what%20string?',''),y=pageYOffset;if(w){while(find(w))c++;scrollBy(0,y-pageYOffset);alert('Found%20'+c+'%20occurrence'+(c==1?'':'s')+'%20of%20\%22'+w+'\%22.')}%22).call()
  • 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 
javascript:alert('words%20in%20selection:%20'%20+%20document.getSelection().split('%20').length)

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.style.color=%22green%22; %20tc.style.background=%22#FFEE99%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)
javascript:(function(){var%20c='red',e=document.getElementsByTagName('a'),E,k=0,n,t;%20for(i=0;E=e[i];i++){t=E.getAttribute('HREF');%20if(t&&t!=''){n=document.createElement('span');%20n.style.color=c;n.innerHTML='['+t+']';%20E.appendChild(n);k++}}%20alert('HREF%20count:%20'+k);})()
  • 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
javascript:(function(){var%20c='red',e=document.getElementsByTagName('a'),E,k=0,n,t;%20for(i=0;E=e[i];i++){t=E.getAttribute('SHORTCUTURL');%20if(t&&t!=''){n=document.createElement('span');%20n.style.color=c;n.innerHTML='['+t+']';%20E.appendChild(n);k++}}%20alert('shortcuts%20found:%20'+k);})()
  • 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.
javascript:(function(){var%20T={},W=[],C=0,s,i;%20function%20F(n){var%20i,x,a,w,t=n.tagName;if(n.nodeType==3){a=n.data.toLowerCase().split(/[\s\(\)\:\,\.;\<\>\&\'\"]/);for(i%20in%20a)if(w=a[i]){w="%20"+w;T[w]=T[w]?T[w]+1:1;++C;}}if(t!="SCRIPT"&&t!="STYLE")for(i=0;x=n.childNodes[i];++i)F(x)}F(document);for(i%20in%20T)W.push([T[i],i]);W.sort(function(a,b){var%20x=b[0]-a[0];return%20x?x:((b[1]<a[1])?1:-1)});%20s="<h3>"+C+"%20words</h3>";for(i%20in%20W)s+=W[i][0]+":"+W[i][1]+"<br>";with(open().document){write(s);close()}})()

Tables

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