michael@0: /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this file, michael@0: * You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: /* michael@0: * Constant flags that describe how a document is sandboxed according to the michael@0: * HTML5 spec. michael@0: */ michael@0: michael@0: #ifndef nsSandboxFlags_h___ michael@0: #define nsSandboxFlags_h___ michael@0: michael@0: /** michael@0: * This flag prevents content from navigating browsing contexts other than michael@0: * itself, browsing contexts nested inside it, the top-level browsing context michael@0: * and browsing contexts that it has opened. michael@0: * As it is always on for sandboxed browsing contexts, it is used implicitly michael@0: * within the code by checking that the overall flags are non-zero. michael@0: * It is only uesd directly when the sandbox flags are initially set up. michael@0: */ michael@0: const unsigned long SANDBOXED_NAVIGATION = 0x1; michael@0: michael@0: /** michael@0: * This flag prevents content from navigating their top-level browsing michael@0: * context. michael@0: */ michael@0: const unsigned long SANDBOXED_TOPLEVEL_NAVIGATION = 0x2; michael@0: michael@0: /** michael@0: * This flag prevents content from instantiating plugins, whether using the michael@0: * embed element, the object element, the applet element, or through michael@0: * navigation of a nested browsing context, unless those plugins can be michael@0: * secured. michael@0: */ michael@0: const unsigned long SANDBOXED_PLUGINS = 0x4; michael@0: michael@0: /** michael@0: * This flag forces content into a unique origin, thus preventing it from michael@0: * accessing other content from the same origin. michael@0: * This flag also prevents script from reading from or writing to the michael@0: * document.cookie IDL attribute, and blocks access to localStorage. michael@0: */ michael@0: const unsigned long SANDBOXED_ORIGIN = 0x8; michael@0: michael@0: /** michael@0: * This flag blocks form submission. michael@0: */ michael@0: const unsigned long SANDBOXED_FORMS = 0x10; michael@0: michael@0: /** michael@0: * This flag blocks script execution. michael@0: */ michael@0: const unsigned long SANDBOXED_SCRIPTS = 0x20; michael@0: michael@0: /** michael@0: * This flag blocks features that trigger automatically, such as michael@0: * automatically playing a video or automatically focusing a form control. michael@0: */ michael@0: const unsigned long SANDBOXED_AUTOMATIC_FEATURES = 0x40; michael@0: michael@0: /** michael@0: * This flag blocks the document from acquiring pointerlock. michael@0: */ michael@0: const unsigned long SANDBOXED_POINTER_LOCK = 0x80; michael@0: michael@0: /** michael@0: * This flag blocks the document from changing document.domain. michael@0: */ michael@0: const unsigned long SANDBOXED_DOMAIN = 0x100; michael@0: michael@0: /** michael@0: * This flag prevents content from creating new auxiliary browsing contexts, michael@0: * e.g. using the target attribute, the window.open() method, or the michael@0: * showModalDialog() method. michael@0: */ michael@0: const unsigned long SANDBOXED_AUXILIARY_NAVIGATION = 0x200; michael@0: #endif