mozilla

Εφαρμογή

Non-standard
This feature is non-standard and is not on a standards track. Do not use it on production sites facing the Web: it will not work for every user. There may also be large incompatibilities between implementations and the behavior may change in the future.

Στο JavaScript API των Ανοιχτών εφαρμογών Ιστού, ένα αντικείμενο App είναι ένα αντικείμενο JavaScript που αντιπροσωπεύει μια εφαρμογή που έχει ή θα μπορούσε να έχει εγκατασταθεί στην αποθήκη της εφαρμογής του χρήστη.

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

Μέθοδοι

Μέθοδος Περιγραφή
launch() Εκκινεί την εφαρμογή. Δεν επιστρέφει καμία τιμή.
checkForUpdate()

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

Για συσκευασμένες εφαρμογές: ελέγξτε για ενημερώσεις και επισημάνετέ το ως downloadavailable εάν χρειαστεί.

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

Παράδειγμα αντικειμένου Εφαρμογής

{
  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"]
}

Document Tags and Contributors

Contributors to this page: JimSP472
Last updated by: JimSP472,