Add-on to implement character count

User avatar
ChrisGreaves
PlutoniumLounger
Posts: 15585
Joined: 24 Jan 2010, 23:23
Location: brings.slot.perky

Add-on to implement character count

Post by ChrisGreaves »

I'm on a roll!
We need an add-on to display the count of characters currently selected in a browser window.
makes tweeting so much easier if we know the count prior to Ctrl-C
There's nothing heavier than an empty water bottle

User avatar
Leif
Administrator
Posts: 7208
Joined: 15 Jan 2010, 22:52
Location: Middle of England

Re: Add-on to implement character count

Post by Leif »

Leif

User avatar
agibsonsw
SilverLounger
Posts: 2403
Joined: 05 Feb 2010, 22:21
Location: London ENGLAND

Re: Add-on to implement character count

Post by agibsonsw »

A bookmarklet

Code: Select all

javascript:q=""+(window.getSelection?window.getSelection():document.getSelection?document.getSelection():document.selection.createRange().text);window.alert("Characters%20"+q.length);
"I'm here to save your life. But if I'm going to do that, I'll need total uninanonynymity." Me Myself & Irene.

User avatar
ChrisGreaves
PlutoniumLounger
Posts: 15585
Joined: 24 Jan 2010, 23:23
Location: brings.slot.perky

Re: Add-on to implement character count

Post by ChrisGreaves »

Leif wrote:Anything in ... Firefox Support Forum | Firefox Help of use?
Thanks Leif.
I think it should have been the first button, "Character Count" but I couldnot get it working, so ... (reply to Andy below)
There's nothing heavier than an empty water bottle

User avatar
ChrisGreaves
PlutoniumLounger
Posts: 15585
Joined: 24 Jan 2010, 23:23
Location: brings.slot.perky

Re: Add-on to implement character count

Post by ChrisGreaves »

agibsonsw wrote:A bookmarklet
Another 'andy one.
Thanks Andy.

I used the "Character Count" button from Leif's reference and replaced the code within it with your superior method (grin)
Works just FINE.

What do i owe you now?
There's nothing heavier than an empty water bottle

User avatar
agibsonsw
SilverLounger
Posts: 2403
Joined: 05 Feb 2010, 22:21
Location: London ENGLAND

Re: Add-on to implement character count

Post by agibsonsw »

This one's on the house :)

It will count a line break as a character - don't know how that applies to tweeting. My character count for tweeting is 0. Andy.
"I'm here to save your life. But if I'm going to do that, I'll need total uninanonynymity." Me Myself & Irene.

User avatar
ChrisGreaves
PlutoniumLounger
Posts: 15585
Joined: 24 Jan 2010, 23:23
Location: brings.slot.perky

Re: Add-on to implement character count

Post by ChrisGreaves »

agibsonsw wrote:This one's on the house :)
Thanks Andy.
My character count for tweeting is 0. Andy.
OK. So I just tweeted about you.
There's nothing heavier than an empty water bottle