问题
I am working for my client and there we have used LinkedIn share plugin (https://developer.linkedin.com/plugins/share) but we have been facing an issue with this plugin while using MS Internet Explorer. When the user clicks on the LinkedIn share plugin on IE, another popup window opens, this popup works fine over other browsers like Firefox, Chrome however on IE (with most users on IE11 and IE Edge), it shows an alert saying: "The webpage you are viewing is trying to close the window." If user clicks on "No" then it redirects to LinkedIn 404/Page not found (https://www.linkedin.com/404). We are looking for your help to investigate the issue to find the root cause and get it addressed.
Any help in fixing this issue will be greatly appreciated.
回答1:
The issue is that you're relying on the SDK and the plugin JS library for making and generating the button. That means all of LinkedIn's JS libs could be do any number of things to make the button appear and behave as it does. To have a URL-sharing link to Linkedin, all you really ought to need is...
https://www.linkedin.com/sharing/share-offsite/?url={url}
Then you can just make any button, using any HTML, CSS, or JavaScript that you like, and hyperlink it to allow sharing of a page. Like so...
<a href="https://www.linkedin.com/sharing/share-offsite/?url={url}" target="_blank">Share on LinkedIn</a>
Source: Microsoft LinkedIn Share URL Documentation.
If you are interested in a regularly maintained github project that keeps track of this so you don't have to, check it out! Social Share URLs
来源:https://stackoverflow.com/questions/49093691/issue-on-ie-with-linkedin-share-plugin