We have a website that allows the user to download and open a Word file.
Chrome started recently opening an annoying popup when the users downloads the Word
The javascript code called to open the file is
function webDAVOnLineEditionAcm(docURL) {
try {
setTimeout(function(){ ITHit.WebDAV.Client.DocManager.EditDocument(docURL, "/", protocolInstallCallback); }, 5000);
} catch (e) {
console.log(e);
}
}
Is there some solution to tell Chrome to always open that kind of links? It is annoying our users, that need to frequently click that button but also breaks all our acceptance tests...
Short answer, no. This is a security feature to prevent a malicious script from being able to launch local applications or open executable files.
One solution is to educate your users. Show a notice on the page when they click to open that explains how to suppress the prompt.
Another solution is to trigger a download of the file. They can then open that file by clicking on it in the downloads list. They won't be prompted in this case.
Finally, a more involved solution is to process the word document and convert it to HTML so they can be viewed directly on the site. You could then pair this with the download solution to get the original document.