问题
Given that we have the below hyperlink in the word add in HTML page (e.g. Home.html):
<a href="www.google.com" target="_blank">Go to google</a>
Clicking on "Go to google" opens www.google.com
using Internet Explorer outside the Word add-in.
The problem is the default browser is set to Google Chrome and we wish to open all the external links using the default browser set by the user.
How can we achieve this?
回答1:
As Marc points out, it’s not possible today. That being said, there is an API being developed that will do just that. I can’t comment on the timing yet, but it is “soon”. I recommend you ping this thread in a few weeks, and there may be more info to share.
回答2:
It isn't possible to define which browser opens a link. When you open a new window using target="_blank"
you are simply asking the current browser to open that destination in a new window within the same browser application.
Since Office for Windows hosts add-ins in an embedded IE 11 instance, this will always be Internet Explorer.
来源:https://stackoverflow.com/questions/46906863/how-to-set-the-default-browser-in-word-addin