Baidu shares a solution that does not support HTTPS

Source: Internet
Author: User
Tags to domain

Site since the start of HTTPS, Baidu sharing can not be used! But there is no substitute for Baidu to share.

What do we do? How to solve Baidu share does not support the problem of HTTPS,

Follow Bo Initiative, let you share Baidu can still use under HTTPS ~

Hand Party

First on the party's solution ~

Blogger modified the sharing code (below two links to download one of them)

http://pan.baidu.com/s/1pLnHk4j Password: pfr7 (the file is not complete in the following two addresses)

    • HTTP://VDISK.WEIBO.COM/LC/2WTONQTT2CVFL8909YP Password: q0a1
    • Alternate address: http://pan.baidu.com/s/1i4c1hnn Password: 0KJW

Static decompression and drop to the site root directory.

Then the corresponding Baidu share code, the http://bdimg.share.baidu.com/changed to/

123 . Src= http://bdimg.share.baidu.com/static/api/js/share.js?v= 89860593.js?cdnversion= ' +~ ( -new Date (/36e5) ]; </script> .src= '/static/api/js/share.js?v= 89860593.js?cdnversion= ' +~ (-new Date ()/36e5)]; </SCRIPT>

DIY, clothed

Well, what if a bad-looking person wants to do a trick just by dropping the root directory? If you get an XSS, you're screwed.

Of course, bloggers are not such people. So Bo Master to change the process, give people to fish than give people to fishing, but also let the safety of high-minded children's shoes to do their own, relax the heart ^ ^

Get Baidu to share files

You can directly use Chrome–f12–source to see what files, and then save (note that you need to first click, the corresponding CSS will come out)

You can also directly see the bloggers share the file, corresponding to the download.

Change the domain name to http://bdimg.share.baidu.com/plus the corresponding path.

Modify some files

It's going to be a problem if you drop it right away, and the little green lock in your address bar will disappear t^t

That is, although you are HTTPS site, but the request of HTTP resources, this mixed mode is not good drop

Repair method:

    1. Static\api\js\share.js
      • Domain: {staticurl: "http://bdimg.share.baidu.com/"} modified to domain: {staticurl: "/"}
      • Nsclick: "Http://nsclick.baidu.com/v.gif" modified to Nsclick: "/",
    2. Static\api\js\trans\logger.js
      • Erase the contents, but keep the empty file.

Seems to be these two steps, bloggers should not miss out

Modify the Evernote icon

Bloggers are using theme 1 (obviously better than theme 0, theme 0 is not an Evernote icon),

But because the following one more with the theme 0 of the picture, will cause the loading of two pictures, let me slightly uncomfortable (the same no Evernote icon!) )

The changes are as follows:

    1. Static\api\css\share_popup.css
      • Finally Add. popup_evernotecn{background-position:4px-3190px;}
    2. Static\api\css\share_style0_16.css
      • Finally Add. bds_evernotecn{background-position:0 -3195px}
    3. Rename the icons_1_16.png to Icons_0_16.png
      • Optional: Use Tinypng to compress the picture, Bo master now this picture is 7.81KB

Written in the last

OK, let's try the effect.

If there is no clear place, please leave a message.

You can also look at the results of my changes to see ~


Transferred from: https://www.hrwhisper.me/baidu-share-not-support-https-solution/

Baidu shares a solution that does not support HTTPS

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.