My result is now, that inAppBrowser by default isn't capable of handling Downloads at all and doesn't even process links with a file suffix like ".pdf".
a) So one workaround is to open the file in Google Docs by rewriting the link. This works because it's no more a PDF Document, but an external link:
b) Use the "beforeload" event to decide which browser to use before the link is further processed:
var app = {
[...]
_launchWebApp: function () {
// Set global variables:
// previousUrl = null;
// Open URL in inappbrowser:
var webAppWindow = cordova.InAppBrowser.open(this.config.webAppUrl, '_blank','location=no,beforeload=get,zoom=no,toolbar=no,enableViewportScale=yes');
// Register events:
webAppWindow.addEventListener('beforeload', this.onBeforeLoad.bind(this, webAppWindow), false);
},
/**
*
*/
onBeforeLoad: function(webAppWindow, params, callback){
// Special handling of downloads. InAppBrowser doesn't handle them
// so we have to manually preprocess and open in system browser:
if(params.url.match(".pdf")){
cordova.InAppBrowser.open(params.url, '_system');
} else {
// Default handling:
callback(params.url);
}
},
}