ADsafe
ADsafe

Explore the historic ADsafe JavaScript subset, widget structure and DOM interface through independent, newly written guides.

What should a third-party widget be allowed to read or change? ADsafe explored a restricted language and a limited interface to the page. This independent reference revisits the historic project associated with Douglas Crockford.

How did language checks and the runtime work together? Start with the widget model and its DOM interface, then compare that design with browser isolation today.

ADsafe widget · guest code
// Illustrative historical pattern
ADSAFE.go('DEMO_', function (dom) {
  'use strict';
  dom.q('#DEMO_MESSAGE').value('Started.');
});

Conceptual example, not a validated widget.

Read the historical template →
Conceptual ADsafe boundary: restricted guest code, a limited DOM interface and host context. Illustrative only.
ADsafe widget · guest code
// Illustrative historical pattern
ADSAFE.go('DEMO_', function (dom) {
  'use strict';
  dom.q('#DEMO_MESSAGE')
     .value('Started.');
});

// See the full widget template.
Restricted language + limited DOM interface.
Conceptual example, not a validated widget.
Read the historical template →
Menu
AI-generated illustration of pale sage interface panels connected across a warm cream tabletop.

JavaScript, with boundaries.

Learn how a restricted language limited guest code. Follow its controlled interface to the page.

Understand the boundary
AI-generated editorial image of a light programming desk with a cream laptop and sage reference sheets.

Read the reference

AI-generated editorial image of an open cream research notebook, pencil and sage diagram notes.

From the notebook

Explore the reference

  • Getting started with ADsafe

    Read the historical ADsafe workflow: the JavaScript subset, a DIV wrapper, shared ID prefixes, validation and approved libraries.

  • ADsafe API reference

    Reference for ADSAFE.go, id, lib, get and set, DOM queries, bunch objects, events and restricted names, checked against the bundled runtime.

  • ADsafe security model and limits

    Understand ADsafe’s trusted host, restricted language, mediated DOM, capability leakage, prototype assumptions and historical limitations.

  • ADsafe examples, step by step

    Walk through a bounded text update, an event handler and local widget state, then read the Roman, Bats and Sudoku examples with their limits in view.

  • JavaScript sandboxing explained

    Learn the object-capability idea behind ADsafe and compare its historical subset with Caja, SES compartments and browser sandboxed iframes.

  • A short history of ADsafe

    A source-led account of Douglas Crockford’s historical ADsafe project, its original documentation, the bundled runtime and this independent edition.

  • ADsafe questions and answers

    Answers about ADsafe validation, guest widgets, DIV identifiers, approved libraries, dynamic properties, events and the limits of this historical reference.

  • ADsafe glossary

    Definitions of ADsafe terms: guest, host, widget, capability, verifier, bunch, hunters, peckers, mediated DOM, library and interceptor.