Greasemonkey - JavaScript Style Guide

This document describes the JavaScript style for the Greasemonkey project. Below, use of the word "should" is only for its effect on the prose, and actually means "must".

This guide is based on a Mozilla JavaScript Style Guide document which no longer exists (and was previously the Greasemonkey style guide), which in turn was based on a document by Niel Rashbrook.

Whitespace

Symbols

Code Style

Function and variable naming

JavaScript Features

Suggestions

These guidelines are not hard and fast rules, but almost always a good idea. Please try to follow them.