Skip to content

A Chrome/Firefox extension for running CoffeeScript from the Web Inspector

Notifications You must be signed in to change notification settings

brewingcode/CoffeeScriptConsole

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 

Repository files navigation

CoffeeScript Console 4

A Chrome/Firefox extension to allow writing of CoffeeScript within the Web Inspector and run it within the context of the current window, just like the built-in console.

Installation

Chrome

Enable Developer mode via the toggle in the upper-right corner at chrome://extensions/, and load the unpacked extension from the src directory from disk.

Firefox

Enable Temporary Add-ons at about:debugging#/runtime/this-firefox, and load the src/manifest.json file from disk.

Features

  • Write CoffeeScript in ACE editor:
    • Vim keybindings (in Chrome)
    • Syntax highlighting
    • Follows the devtools theme for dark mode
    • Command+Enter or Shift+Enter to run the current script
  • Included libraries for convenience:
  • Helper functions from custom-helpers.js:
    • $.flattext() added to jQuery to flatten whitespace
    • branch() and nodes() to help crawl around the DOM
    • commify() to place commas as thousands separators

Example

A table of the most recent HN posts

This uses jQuery to parse out pairs of <tr> elements into an array of objects, which is then chained through lodash before being fed to mdtable(). Sorting is done by date, which requires parsing humanized date strings with sugar.js (ie, parsing "2 hours ago" to a sortable time value).

example: most recent HN posts

Credits

Based on CoffeeScript Console 3, CoffeeConsole 2, and CoffeeConsole

About

A Chrome/Firefox extension for running CoffeeScript from the Web Inspector

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 99.6%
  • HTML 0.3%
  • CSS 0.1%
  • LiveScript 0.0%
  • Makefile 0.0%
  • Zeek 0.0%