This may not be strictly related to online marketing, but in the course of my work, I often have to count the number of words and characters in a given text (like page titles and descriptions). If you’ve ever used Microsoft Word, you know how that works.
Well, before Firefox 4.0, there was a nice add-on to do it, but it’s not compatible with the new version (how annoying). So I’ve had to resort to desperate measures.
Thanks to as post by Joe Maller and another one by Media College, I had everything I needed. The code is this:
To install this “button”, drag the WordCount link to your Firefox or Chrome bookmarks area and you’re done. Just select some text, click the “button” (you can test now by clicking the link above) and a message will pop up with those numbers for you.
Note: when selecting text, make sure there are no trailing spaces or you will get an extra word and, of course, an extra character (this may happen when you double-click or triple-click).
Edit (13/02/2010): To select text within iframes, try this code, posted by Thelizardreborn:
Or drag this WordCount link to your bookmark bar.
20 responses to “Word Count for Firefox & Chrome”
Excellent work! I need this function. Great job!
Thanks from Lima, Perú
I have been looking for this ever since WordCount-Plus became incompatible
with FFox5. Thank you so much, Mr. Baras. Come to Berlin, and we will treat you for lunch.
OK, I’ll just go get me a flight, then 🙂
Glad you liked it. I use it often.
Great! I wasn’t updating my ffx until i read this work around 🙂
doens’t work in google sites with hebrew
Give me an example, because it certainly works on Hebrew content on Walla.
Great tool – thanks! Will share and spread the love.
Also, this snippet was something I developed for my personal use when I was using FF4. Since then, I’ve switched to Chrome and have no plans to go back.
Thanks for the reply Gal.
Based on some experiments, it appears that the web sites on which your script fails are all sites which use iframes. I think that the basic idea of your script could be extended to include iframes… but I don’t know yet if it’s worth the effort. I’ll tinker with the idea of scanning all of the document’s iframes for selected text.
I’m having the same problem trying to use the link in the Blackboard-based online courseroom I teach in (which is why I installed it). I’m in FF 3.6.23 because Blackboard doesn’t support any of the FF updates…. I’d love to know if the script gets updated because that’s the one place I really need it, so I can do quick checks on how long student discussion posts are.
This modification should take one level of frames into account. If text is selected in multiple frames (or in a frame(s) and the main document) it will only count the first selection it comes to.
awesome add-on, most of the firefox add-ons were not working for me…this one isn’t a addon, but is good anyway. I wanted this coz i enter lots of competitions (25 words or less…), so it comes in handy if the page doesn;t provide a counter
Thanks a bunch
It’s really verry good! Thank a lot!
Thanks: really needed this.
I suggest a word count add-on that might help your writing if you use Firefox:
if you want a fast & reliable solution, you can go to its web version:
Thank you, Harry. The above works on every browser and I’ve moved to Chrome, but die-hard Firefox users may prefer a proper add-on.
It’s difficult to find out
the word count in the Firefox browser though its good in chrome. it does not
seem unreasonable to suggest that every single guided process flows are very
much productive as well as effective in terms of précising the current
situation of actual word counts in the progression in all the way. Therefore
every one should guide to make the best uses in chrome other than Firefox using
@lopi, I hope I understand you correctly. Firefox has changed a lot since the publication of this post and this may have affected the word count function. On Chrome, the code still works well and I offer no guarantees or maintenance of it.
See Harry’s alternative suggestions.