tabalinas / jssocials

Social Network Sharing jQuery Plugin

Home Page:http://js-socials.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

The resource from “https://www.linkedin.com/countserv/count/share?format=jsonp&…ack=...” was blocked due to MIME type (“text/html”) mismatch (X-Content-Type-Options: nosniff)

MikeAlhayek opened this issue · comments

First of all, thank you for this amazing plugin! I am using it on my website, but getting the following error in the console.

The resource from “https://www.linkedin.com/countserv/count/share?format=jsonp&…ack=jQuery33103800949475974904_1571936242760&_=1571936242761” was blocked due to MIME type (“text/html”) mismatch (X-Content-Type-Options: nosniff).

X-Content-Type-Options: nosniff

Also, when looking in the "network" tab of the "developer tools", OI see 4 http requests to linkedin.com that return 404 errors.

Is this an issue with the plugin, or is there something on my end that needs to change for this issue to be fixed?

Additionally, this script seems to issue HTTP requests for social media url when the page is loaded. Can't I configure it to only issue the HTTP request when the user clicks on the share? It sounds to me lots of extra/unnecessary round trips which increase the page load and bandwith usage. My thought, when a user clicks on "Facebook" share button, then issue the HTTP request to facebook and then show the share window, so the HTTP is not called until the user really want to share the page. This could help with increasing page load and reduce bandwith usage specially when a user is on a mobile device.

Any updates on this issue?

modifying line 475 in dist/jssocials.js seems to correct the error

linkedin: {
   label: "Share",
   logo: "fa fa-linkedin",
   shareUrl: "https://www.linkedin.com/shareArticle?mini=true&url={url}",
   countUrl: ""
},

so it's line 47 in src/jssocials.shares.js

Any updates on this issue?

commented

the fix proposed by @lohic is correct: linkedin stopped (years ago) with providing these counts, so fetching the counts from linkedin returns an error because.
When looking at the last time a change was made in this repo and the lack of communication around issues from the maintainer it is safe to conclude that this repo is abandoned: so the software still works, but fixes etc. need to be done by yourself.