69

Screenshot

Use /command shortcuts to perform common chat tasks:
/star command example

See message history inline:
chat message history viewed inline

Easily preview replied-to messages:
previewed replied-to chat message

And much, much more...

About

Legends tell of a prolific Meta Stack Overflow chatter who despised using their mouse above all things. In an effort to keep their hands firmly on the keyboard, this chatter set out to make a userscript that would bring all of chat's functionality within a few keystrokes' reach.

To make this possible, the userscript provides the following features:

  • /command shortcuts to perform many different chat tasks, such as starring, flagging, and loading older messages, as well as some non-native chat tasks, like Vimeo pseudo-oneboxes and in-chat note taking
  • Keyboard navigation to select and take action on specific messages without ever having to reach for the mouse
  • Extensible interface for writing custom commands, key bindings, and pseudo-onebox generators in your own userscripts

To learn more about the specific commands and key bindings, please see the comprehensive list of functionality in the SEChatModifications section of the README.

License

The script makes use of the livequery plugin and therefore must be used in a way consistent with that plugin's dual MIT/GPLv2 license.

Download

install / update scriptview source

Platform

The script should work under all major userscript-supporting browsers. Please file a bug if you encounter any issues.

Contact

Rebecca Chernoff *, Yi Jiang, and Tim Stone actively maintain this script, with additional code contributions from Benjol and Michael Mrozek.

Feedback can be given on GitHub, or by "@lerting" one of the maintainers on Meta Stack Overflow chat.
*This script is in no way associated with Stack Exchange Inc.

Code

In addition to forking the GitHub repository, you can write your own userscripts that leverage this script's functionality by using the ChatExtension object.

For example, you can create new /command actions:

// Will be called on /myCommand
ChatExtension.define('myCommand', function () {
    console.log("This is my own command");

    return ChatExtension.CommandState.SucceedDoClear;
});

Or, you may want to add in support for a custom pseudo-onebox, like the one for Vimeo that comes built-in:

// Will be called on /ob vimeo.com/path
ChatExtension.associate('vimeo.com', function (domain, path) {
   // Perform Vimeo pseudo-onebox magic by calling the Vimeo API
   // and submitting messages on behalf of the users
});

To learn more, check the source code, or explore the ChatExtension object in your developer console of choice. Additional documentation will hopefully be made available in the near future.

17
  • 15
    I LOVE THIS USERSCRIPT!!!!
    – Josh
    Feb 21, 2011 at 21:20
  • Quick question... when you define a custom command, is there a way for it to receive arguments? For example: '/dosomething arg1 arg2' ? Feb 23, 2011 at 1:27
  • @GeorgeEdison Your function will be called so that arguments will be everything after the command, broken up at whitespace. So you can get arg1 via arguments[0], and so on. For cases where you want everything after the command as a single string, we current do $.makeArray(arguments).join(' ').
    – Tim Stone
    Feb 23, 2011 at 2:39
  • Hmm, these commands really need some kind of builtin description mechanism... thinks...
    – Benjol
    Feb 24, 2011 at 10:51
  • 1
    @Ben: What you need is: /help Feb 27, 2011 at 3:59
  • @George, I know about that :) What I mean is that there should be not just a list of commands, but that /help command should show some more information. I'm (sort of) working on it...
    – Benjol
    Feb 27, 2011 at 9:47
  • @Benjol: Sounds good! Feb 27, 2011 at 19:39
  • There's now pseudo-onebox support for Stack Exchange comments through the /ob command. To easily get URLs for comment oneboxing, please see the SE Modifications script.
    – Tim Stone
    May 7, 2011 at 3:04
  • Note: Chat upgraded from jQuery 1.4 -> 1.5, which caused several things to unexpectedly break. Updating the script to the latest version will resolve these problems.
    – Tim Stone
    Oct 21, 2011 at 17:35
  • Updates to chat today broke this script. Dec 22, 2011 at 18:15
  • @NullUserException Updating to the latest should fix the issue for the moment.
    – Tim Stone
    Dec 22, 2011 at 18:42
  • Any way this could be a browser extension? (The benefit would be that the browser could be set to search for updates automatically.)
    – msh210
    Mar 18, 2013 at 4:09
  • 1
    @msh210 Yeah, we had considered that before, we just never quite got around to looking into it. I'll make a note and see what I can do, though.
    – Tim Stone
    Mar 18, 2013 at 4:13
  • So chrome is now blocking this. support.google.com/chrome/answer/…
    – durron597
    Jul 7, 2014 at 15:45
  • 2
    @durron597 Yeah, that's an unfortunate and terrible policy they've taken on. You can use TamperMonkey to work around it, but I'll consider turning this into an actual extension so it can be posted on the Chrome Web Store.
    – Tim Stone
    Jul 7, 2014 at 15:49

4 Answers 4

6

2 ideas for drastically simplifying some command inputs:

A bare command such as /edit or /delete should assume "the last message I sent". Note that it will not necessarily be the highest id, because that could be one of another user.

Alternatively, if that implementation is too hard, avoiding the id number when the intent is obvious is still a nice idea, so perhaps instead of a bare command, something such as /edit last or /edit -1 could be used to indicate "my last message".

3
  • 2
    This makes sense, I'll put it on my to-do list. Note that using the Up Arrow in the input box will already allow you to edit your most recent message (this is native chat functionality).
    – Tim Stone
    May 26, 2011 at 22:25
  • Holy cow I did not know that... Thanks! Not that I need to argue my point further, but I'd say to that: There should still be an easy way to delete the last message, which is not accomplished by editing the last message and deleting the entire text of the message. So if you implement /delete -1, I would highly suggest /edit -1 for consistency.
    – VxJasonxV
    May 26, 2011 at 23:23
  • 1
    This was actually such a good idea that we had already done it, but there was a bug later on that was preventing it from allowing an undefined parameter through. ;) In any case, /del and /edit with nothing after them should both work for your most recent message now after updating.
    – Tim Stone
    May 29, 2011 at 3:52
2

I think there is a bug: I was trying out the Clipboard feature, but I don't seem to be able to Delete/Paste items from the clipboard. If I try to delete an item, it always comes back if I click again on the "clipboard" button. and if I click Paste, nothing happens.

I'm using Firefox 37.0.1 and Windows 7.

In case it matters: I installed the following add-ons:

2

Seems like the keyboard navigation broke since the jQuery version was upgraded while fixing the scrolling bug.

CTRL+Up will now both navigate upwards with the extension, and move the edited message marker (as though you pressed Up without CTRL).

3
  • 1
    If you reinstall the latest that should be fixed, I need to look into what options are available for alerting people to updates
    – Tim Stone
    Sep 11, 2017 at 12:57
  • 1
    Making sure the version isn't always 0.0 is probably a good start :) Sep 11, 2017 at 13:21
  • Very fair point :P
    – Tim Stone
    Sep 11, 2017 at 13:22
1

I to remember reporting this before and the problem being solved, but it's back:

When I navigate through messages with CTRL+UP/DOWN, message by ignored users are silently traversed.

3
  • Hm, I can't reproduce this. Are you sure you're running the latest?
    – Tim Stone
    Jun 5, 2014 at 2:31
  • @TimStone There is no version number in the script but Greasemonkey's "Update" does not do anything, so yea, I guess.
    – Raphael
    Jun 5, 2014 at 6:43
  • @TimStone Anyway, can't reproduce it now so maybe it was a temporary change in chat, or I don't know what. Thanks for checking!
    – Raphael
    Jun 5, 2014 at 6:44

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .