The answer to your direct question is no. Instead you can do one of these things:
Take the file name's extension, and show the file appropriately based on that.
Call chrome.mediaGalleries.getMetadata
to determine the media type, and base the action on that.
The following code, taken from a sample app I put together for my book, doesn't handle the general case, as the files it deals with are only images, video, or audio, but it provides some guidance as to how this API is used:
chrome.mediaGalleries.getMetadata(file, {},
function (metadata) {
if (metadata && metadata.mimeType) {
var element;
var mediaType = metadata.mimeType.split('/')[0];
var elementName = mediaType === 'image' ? 'img' : mediaType;
element = document.createElement(elementName);
element.setAttribute("controls", "controls");
viewDiv.appendChild(element);
element.style['max-width'] = '700px';
element.style['max-height'] = '700px';
element.src = URL.createObjectURL(file);
}
}
);
- (Not tried, so I'm guessing a bit.) Pass the object URL created by
URL.createObjectURL
directly to another window or a webview within the app's window.
Note also that you can't access what you call the Chrome OS standard image viewer from within a Chrome App.