Freigeben über


MSApp object

Provides helper functions that enable you to create such things as Blob and MSStream objects.

Syntax

var result = MSApp.member;

Members

The MSApp object has these types of members:

  • Methods

Methods

The MSApp object has these methods.

Method Description
addPublicLocalApplicationUri

Specifies local context URIs for the zone elevation that is allowed.

clearTemporaryWebDataAsync

Clears caches and indexedDB data for the app or WebView.

createBlobFromRandomAccessStream

Creates a Blob from an IRandomAccessStream object. This method should be used when dealing with IRandomAccessStream objects in Apps in order to create a W3C based object from the stream. Once the blob is created, it can be used with the FileReader, URL APIs, and XMLHttpRequest. .

createDataPackage

Converts the user’s or the applications’s specified range to an HTML fragment that can be shared.

createDataPackageFromSelection

Converts the user’s or the applications’s selection to an HTML fragment that can be shared.

createFileFromStorageFile

Converts a standard W3CFile object to its WinRT equivalent StorageFile.

createNewView

Opens the specified URI in a new view.

createStreamFromInputStream

Creates an MSStream from an InputStream.

execAsyncAtPriority

Schedules a callback to be executed at a later time according to the given priority.

execAtPriority

Runs the specified callback function at the given contextual priority.

execUnsafeLocalFunction

Disables script injection validation for the passed function within the local context.

getCurrentPriority

Returns the current contextual priority.

getHtmlPrintDocumentSource

Returns the source content that is to be printed.

getViewOpener

Gets the window (app view) for the current app.

isTaskScheduledAtPriorityOrHigher

Returns a Boolean value indicating whether there is pending work at the given priority level or higher.

suppressSubdownloadCredentialPrompts

Controls whether an app suppresses possible authentication prompts during the download of resources.

terminateApp

Terminates the current application and generates a failure report.

 

Remarks

The MSApp object and its members are supported only for Windows apps using JavaScript (WWAs). Like many WWA objects, the MSApp object only exists in the local context of a WWA (that is, an HTML document in a WWA loaded via the ms-appx URI scheme); otherwise, the object doesn’t exist (and consequently, none of its methods and properties are available).

Note