이 문서는 아직 자원 봉사자들이 한국어로 번역하지 않았습니다. 참여해서 번역을 마치도록 도와 주세요!
English (US)의 문서도 읽어보세요.

The indexedDB API is typically used to store data in the user's browser from content JavaScript.  (See Using IndexedDB for an overview.)  However, the APIs can also be accessed from system-privileged JavaScript using the Components.utils.importGlobalProperties() function:

Components.utils.importGlobalProperties(["indexedDB"]);

// From here on, it's like using IndexedDB from content
var req = indexedDB.open("my-database");
// ...

If you are creating a sandbox, and want indexedDB to be available in it, use the wantGlobalProperties option in the Sandbox constructor:

var options = {
  "wantGlobalProperties": ["indexedDB"]           
}
var principal = Cc["@mozilla.org/systemprincipal;1"].createInstance(Ci.nsIPrincipal);
var sandbox = Components.utils.Sandbox(principal, options);

// The sandbox will have access to indexedDB
var sandboxScript = 'var req = indexedDB.open("my-database");';
Components.utils.evalInSandbox(sandboxScript, sandbox);

Before Firefox 33, you would access indexedDB from chrome code using the initWindowless method of the nsIIndexedDatabaseManager service. This method was removed in Firefox 33.

문서 태그 및 공헌자

최종 변경자: mdnwebdocs-bot,