Skip to content

Instantly share code, notes, and snippets.

@charrismatic
Forked from JoelBesada/README.md
Last active July 19, 2017 01:31
Show Gist options
  • Save charrismatic/161b5101dd33cafbe5b1e4805646f8a8 to your computer and use it in GitHub Desktop.
Save charrismatic/161b5101dd33cafbe5b1e4805646f8a8 to your computer and use it in GitHub Desktop.
Backtick Example Command

Backtick is a customizable command command pallete for chrome letting you run your own javascript snippets easily in a live browsing session.

Backtick

To createa a command:

  1. Create a new Gist with a command.js and command.json file, or simply fork this one.

  2. Write your JavaScript in command.js. This will be injected into and executed on the page the user is currently on when they run it.

  3. Add some metadata to the command.json file:

  • name: The name of the command.
  • description: A short description about what the command does.
  • icon (optional): A link to a 60x60 PNG icon.
  • link (optional): A link to a related home page.
  1. Copy the ID of your Gist from the URL. (The ID of this example command is 6859173)

  2. Paste the ID into the custom commands field in the Backtick settings. access the settings by clicking the Backtick icon on the command execution console. 22 Access the settings by clicking the Backtick icon or by pressing the ` key

You can suggest to add one of your own commands to the list of predefined commands that are included with Backtick, just contact me on Twitter (@JoelBesada) with a link to your command Gist.

/* A SCRIPT TO REVEAL ALL SCRIPT FILES ON A PAGE AND ANY INLINE JAVASCRIPT. */
javascript: (function() {
s = document.getElementsByTagName('SCRIPT');
tx = '';
sr = [];
for (i = 0; i < s.length; i++) {
with (s.item(i)) {
t = text;
if (t) {
tx += t;
} else {
sr.push(src)
};
}
};
var viewer = '<textarea id="t">'+(sr.join("\n"))+"\n\n-----\n\n" + tx + '</textarea>';
viewer += '<script>with(document.getElementById("t")){';
viewer += 'value=js_beautify(value);with(style){width="99%";height="99%";borderStyle="none";}};
viewer += '</script>';
with (window.open()) {document.write(viewer); document.close();}})();OrganizeOrganize
viewer1{
"name": "Show Scripts on Page",
"description": "Opens a window showing all on page scripts and includes",
"icon": "https://backtickio.s3.amazonaws.com/icons/backtick.png",
"link": "http://backtick.io"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment