问题
I'm calling the DavProtocolEditDocument() function in javascript to open the documents on the client:
ITHit.WebDAV.Client.DocManager.DavProtocolEditDocument(sDocumentUrl, null, protocolInstallCallback);
The first time it's called on a workstation, it calls the protocolInstallCallback() function and the plugin is installed. After that, on many workstations, the protocolInstallCallback() function continues to be called everytime another document is being opened. The document still opens as desired, but the confirm window called from the protocolInstallCallback() function is still opened.
How do I get it to recognize that the plugin is already installed?
回答1:
First of all make sure that you have the latest WebDAV Ajax Library version. Web browsers are updated rapidly and some functionality may not work with newer web browsers. Download the latest IT Hit WebDAV Ajax Library build here.
If you are using protocol application (in case of cookies authentication or if you open non-MS-Office documents or using DavProtocolEditDocument() JS function):
- Verify that a Web Browser extension is installed and enabled. See the Protocol Application Detection and Installation article for details about each web browser specifics.
- Reload a web page after installing protocol app and enabling the extension.
- Verify that the WebDAV Ajax Library JavaScript file on your web page and a protocol application have the same version (or at least use the same protocol version).
- The WebDAV Ajax Library Version and protocol used by JavaScript are returned by WebDavSession.Version and WebDavSession.ProtocolVersion static properties respectively.
- You can find the version of the protocol application installed on your machine: a) On Windows: in 'Add or remove programs' panel. b) On Mac OS X: in 'Applications' folder.
If you do not have a protocol application installed and are using Chrome, Internet Explorer or Safari. You may need to increase the timeout using ProtocolTimeoutMs property. Note that this is relatively rear case that typically appears on a slow machines.
来源:https://stackoverflow.com/questions/36413189/protocol-install-callback-function-is-called-even-after-the-protocol-plugin-is-i