Skip to content

Instantly share code, notes, and snippets.

@codeanpeace
Forked from JoelBesada/README.md
Last active August 29, 2015 13:57
Show Gist options
  • Save codeanpeace/9547132 to your computer and use it in GitHub Desktop.
Save codeanpeace/9547132 to your computer and use it in GitHub Desktop.

This is an example custom command for Backtick. A Backtick command consists of two files, a JavaScript command.js and a JSON command.json file.

The contents of the JavaScript file is injected into the DOM of the current page when the command is run. This works just like any bookmarklet, you have full access to everything in the page that the script is injected into. In this example, we're just show an alert box saying "Hello World", but you can of course do much more interesting things with your command.

The JSON file is metadata for the command, including the command name and description. You can also optionally include an icon of size 60x60 and a link.

Custom commands can be used privately or shared with others, all you need to do is grab the id of the Gist (usually the last part of the Gist URL) and add it through the Backtick settings page. You can access the settings page by clicking the Backtick icon on the console where all commands are executed from, or by right clicking the icon in the Chrome extension toolbar.

alert("Hello World");
{
"name": "Example Command",
"description": "A Backtick Hello World example command.",
"icon": "http://icons.backtick.io.s3.amazonaws.com/backtick.png",
"link": "http://backtick.io"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment