• Skip to main content
  • Select language
  • Skip to search
mozilla
Mozilla Developer Network
  • Sign in
    • Persona
    • GitHub
  • Web Platform
    Technologies
    • HTML
    • CSS
    • JavaScript
    • Graphics
    • APIs / DOM
    • Apps
    • MathML
    References & Guides
    • Learn the Web
    • Tutorials
    • References
    • Developer Guides
    • Accessibility
    • ...more docs
  • Mozilla Docs
    • Add-ons
    • Firefox
    • Firefox Marketplace
    • Firefox OS
    • Persona
  • Developer Tools
  • Feedback
    • Get Firefox help
    • Get web development help
    • Join the MDN community
    • Report a content problem
    • Report a bug
  •  
B2G OS
    • Ελληνικά
    • Français
    • 日本語
    • Add a translation
  • Edit
  • Advanced
    • History
    • Print this article
  1. MDN
  2. Mozilla
  3. B2G OS
  4. Firefox OS APIs
  5. DOMApplication
Your Search Results

    DOMApplication

    In This Article
    1. Properties
    2. Methods
    3. Example App object

    In the Open Web apps JavaScript API, an App object is a JavaScript object that represents an app that is or could be installed in the user's app repository.

    Properties

    Name Description Type
    manifest The currently stored instance of the manifest of the app. object
    manifestURL Where the manifest was found. string
    origin The origin of the app (protocol, host, and optional port number). For example: http://example.com string
    installOrigin The origin of the site that triggered the installation of the app. string
    installTime The time that the app was installed. This is generated using Date().getTime(), represented as the number of milliseconds since midnight of January 1st, 1970. integer
    receipts An object containing an array of one or more receipts. Each receipt is a string. If there are no receipts, this is null. object or null
    state The enabled state of the current application. enabled or disabled

    Methods

    Method Description
    addReceipt() Adds a receipt to the app after an in-app purchase has been made.
    launch() Launches the application. Does not return any value.
    checkForUpdate()

    Check to see if the app has been updated. Returns a DOMRequest object.

    For packaged apps: check for updates and mark it as downloadavailable if needed.

    For hosted apps: check for updates on app manifest and application cache and update it if needed.

    removeReceipt() Removes a receipt from the app after an in-app purchase has been cancelled.
    replaceReceipt() Replaces one receipt with another.

    Example App object

    {
      manifest: {
        name: "Add-on Builder",
        default_locale: "en",
        installs_allowed_from: [
          "https://apps-preview-dev.example.com/",
          "https://apps-preview.example.com/"
        ],
        description: "Add-on Builder makes it easy to write, build and test Firefox extensions using common web technologies.",
        version: "0.9.16.1",
        developer: {
          url: "https://builder.addons.mozilla.org/",
          name: "Mozilla Flightdeck Team"
        }
      },
      origin: "https://builder-addons-dev.example.com",
      installTime: 1321986882773,
      installOrigin: "https://apps-preview-dev.example.com",
      receipts: ["h0dHBzOi8v (most of receipt removed here) Tg2ODtkUp"]
    }
    Share:
    • Twitter
    • Facebook
    • Google+

    Document Tags and Contributors

    Tags: 
    • API
    • Apps
    • Apps API
    • JavaScript
    • manifest
    • Manifest
    • Methods
    • Non-standard
     Contributors to this page: chrisdavidmills, teoli, kscarfone, Dyvik, sabrish, tregagnon, kohei.yoshino, markg, ethertank, Sheppy, lgreco, jswisher
     Last updated by: chrisdavidmills, Feb 11, 2016, 2:55:37 AM
    See also
    1. DOMApplication
    2. Inheritance:
      1. EventTarget
    3. Related pages for Apps
      1. DOMApplicationsManager
      2. DOMApplicationsRegistry
      3. InstallTrigger
      4. Navigator.mozApps

    © 2005-2016 Mozilla Developer Network and individual contributors.

    Content is available under these licenses.

    • About MDN
    • Terms
    • Privacy
    • Cookies
    • Contribute to the code