I'm working on an enterprise web application. The web app is developed in ASP.NET. The clients will all be Windows clients.
We have a need to support custom "silent" printing functionality in which reports generated on the server get sent directly to the user's local default printer. The tentative approach is to develop the client-side app so that when it is installed it registers a custom protocol in the Windows registry. The web app can then call a URL like printingapp://some/url/with/info to start an instance of the client-side app if it's not already running. The thought is that this URL would be called automatically by the web app after the user logs in.
In doing some prototyping work, one of the questions that came up was how to detect if the client-side app is already installed? One thought was to try to call the custom URL and handle any errors that get thrown (assuming that there is an error that we can look for that would point to the client-side app not being installed). When testing this approach, I found that IE triggers a modal error dialog to display with the text "Application not found", followed by another modal error dialog with the text "Unable to open this helper application for 'printingapp://some/url/with/info'. The protocol specified in this address is not valid." It doesn't appear that these errors can be caught or suppressed by JavaScript code.
Any suggestions on how to detect if the client-side app is installed before calling the custom protocol URL? Although the current focus is on IE, this is something that will ultimately need to support other browsers like Edge and Chrome.
Aucun commentaire:
Enregistrer un commentaire