6

Faces Chat Extension

SE-Chat-Faces

Love using faces in chat? Are ASCII faces just a little too boring? Is the unicode entry keystroke too complicated? Tired of having to copy-paste unicode faces from Notepad++ (or SublimeText if you're cool)? Then have I got news for you!

This is a chrome extension designed for StackExchange chat. It uses chrome.storage.sync to store strings of data. The main purpose of this extension is to store Unicode faces using the built-in chrome storage API. It means that you can store these Unicode faces across all of the PC's that you use (yaaay chrome.storage.sync), and you can insert them into chat with only a few mouse clicks.

Moreover, the chrome.storage.sync api doesn't care what it stores. You can save links to your favorite imgur images (or anything else you can think of).

How do I use it?

The interface is extremely simple

  • To remove an item hit the "Remove" button. This is irreversible (apart from just adding it again), and there is no confirmation prompt.

  • To add a new item, hit the "Add" button. The combo box will change into a text box. Paste/type your face/link/whateveryouwant into the textbox, and hit "Ok".

  • To enter an item to chat click the "Ok" button. This will simply append the contents of the combobox to the input text box.

  • Finally, at any time should you wish to stop playing with your items clicking "Cancel" will close the dialog box.

Limitations

There are, however, some limitations to using chrome.storage.sync. Namely, the MAX_ITEMS property. Basically this means that you can have no more than 512 items present in storage, and subsequently means you can only have 511 Unicode faces (extension reserves one item for internal use) for a grand total of QUOTA_BYTES (or 100kiB).

Assuming your faces are composed of 7 characters ex "(ʘ ͜ʖ ʘ)", the first 10 smilies will cost (1 + 14) * 10 = 150 bytes (1 byte for key, 14 bytes for 7 Unicode characters), the next 90 smilies will cost (2 + 14) * 90 = 1440 bytes (2 byte key), and the remaining 411 smilies will cost (3 + 14) * 411 = 6987 bytes for a grand total of 8577 bytes (but this is assuming you won't be creative with your smilies =])

To check your remaining byte count and item count open the background page for the extension, and run the following:

Remaining bytes:

chrome.storage.sync.getBytesInUse(function(count) { console.log("Bytes remaining: " + (102400 - count)); });

Remaining items:

chrome.storage.sync.get("count", function(item) { console.log("Items remaining: " + (511 - item.count)); });

To wipe out all faces and start from scratch:

chrome.storage.sync.clear();

I'll probably implement these into buttons at some point™

Where can I get it?

The extension can be found on the chrome web store. Also, the source for the extension is on github, and there's a packed extension file if you prefer not to use the Chrome Web Store. Please feel free to submit a PR, or leave any comments/suggestions if you feel something should be changed or added.

Issues

  • There is a temporary issue which causes the "Ok" button to stop functioning once you add a face. Simply refresh the page and it'll work again. Fix coming later today. This bug has been fixed, it was an issue with the line of code responsible for appending the item to the textarea.
0

0

You must log in to answer this question.

Browse other questions tagged .