0

Background

I'm writing an excel app using the Javascript API for Office. (Office 2013). Inside that app, I have several links to folders on my computer/server, which I want to access from the app using the file protocol.

I've tested the file protocol with a dummy HTML file, using this link:

<a href="file:///C:\Users\User\Desktop">C:\Users\User\Desktop</a>

It works perfectly, opening up the Desktop folder. I've also tested using a networked drive, and it works as well.

Problem

When I add this dummy link into an HTML page in my Excel web app, clicking on it does nothing. When I right click -> Open, IE11 opens a new instance (which doesn't happen with mailto: links), and asks if I'd like to give permission. After I do give permission, the folder is opened.

Goal

I want a single left click to open the folder location without the permissions box ever popping up. Worst case, I want to be able to have the user open a dummy link once during app setup and then once permission is given avoid having to right click -> open.

Question

How can I accomplish the goal here? Is Office just locking down the links?


Update

The primary issue I've found out is that the site I'm hosting the app on wasn't a trusted site. Links using the file protocol only work on intranet and trusted sites. So the only question now is whether the Office store location is trusted.

4

1 回答 1

0

这里的问题在于 Office Apps 的工作方式。清单文件存储在 Office 应用商店中,用户可以下载该文件。该清单指向应用程序开发人员指定的服务器位置,即提供应用程序的位置。这是必须添加到 IE 中的受信任站点的位置。

在此处输入图像描述

因此,为了使文件协议顺利运行,我需要在我的应用程序中包含有关将我的托管服务器添加到受信任站点域的说明,并且我必须避免不断更改域。

于 2014-10-29T12:24:31.957 回答