How To Make Safelink On Main Blog | Blogger | Working With Median Ui 1.6 | Easy Steps

Auto safelink on the main blog

Hello, guys welcome to AsksLedge, today we are going to learn how to create an auto safelink on your main blog. Many of you are using the safe link on your blogger website, some of you are using a third party safe link website and some of you created your own safelink website on a different domain, but today I am going to explain that how to create a safe link on your main blog. If you want to use a safelink then you don’t have to create it different safelink website you don’t have to use third-party websites for safelink.

Auto Safelink
Auto Safelink

Advantages of the auto safelink on the main blog

See in this way, that if you want to create a safe link for that you have to get a new blog with a different domain for creating a safe link, and whenever you want to convert a link in safelink then you have to go on that blog or third party website to sort your Link every time. But in the safe link on the main blog, you don’t have to even short any link and don’t have to go to any other website to shorten your links, it will automatically short every link on your website.

Disadvantages Of Auto Safelink
Disadvantages Of Auto Safelink

Disadvantages of the auto safelink on the main blog

In my view, I can’t send a disadvantage in it, but it can affect your revenue if your website is not approved by AdSense, then you have to use third-party advertisers, and they can’t give you that much revenue, so if you don’t have AdSense approval on your main blog, then you should prefer to go with third-party link shortener website that gives you more revenue than other third-party advertisers.

Read More:

How to make auto safelink
How to make auto safelink

How to make auto safelink on blogger on main blog

It’s very easy and simple to create a safe link on your main blog, you just have to follow the simple process given below.

Step 1 – Creating a Safelink Page:

  1. Go to blogger.com
  2. Click on pages
  3. Create a new page
  4. Give the title (ex.“Safelink”)
  5. And paste the HTML code given below
<div class='separator' style='text-align:center'>
<div class='ads-top'><!-- Fill AdSense code here--></div>
<div class='safelink' id='safelink'>
<center>
<div class='askbutton outline' id='daplong'>
Wait a minute...</div>
<script>/*<![CDATA[*/ var currentURL=location.href; var str = currentURL; var res = str.replace('https://www.yourblog.com/p/safelink.html' + '?url=', ""); function changeLink(){var decodedString = Base64.decode(res); window.open(decodedString,'_blank')}; document.write('<a href="#go-link" id="download-safelink" class="askbutton outline">Click to go to the link</a>'); var linkDL = document.getElementById("download-safelink"); var notif = document.getElementById("daplong"); var waktu = 20; var teks_waktu = document.createElement("span"); linkDL.parentNode.replaceChild(teks_waktu, linkDL); var id; id = setInterval(function () { waktu--; if (waktu < 0) { teks_waktu.parentNode.replaceChild(linkDL, teks_waktu); clearInterval(id); notif.style.display = "none"; linkDL.style.display = "inline-block"; } else { teks_waktu.innerHTML = "Link will appear in " + waktu.toString() + " second"; }}, 1000); /*]]>*/</script></center>
</div>

<div class='separator-text'><!-- Write your article content here --></div>

<div class='blockLink' style='text-align:center'>
<div id='ads-left' class='ads-left'><!-- Fill AdSense code here --></div>

<div id='go-link'>
<a class='askbutton outline' href='javascript:void(0)' onclick='changeLink();' rel='nofollow noreferrer'><i class ='icon demo'> </i>Go to the link</a>
</div>

<div id='ads-right' class='ads-right'><!-- Fill AdSense code here --></div>
</div>
  1. After this don’t forget to change the color link with your safelink page link.
  2. Then Save the page.

Step 2 – Last Step

1. Add CSS

  1. Then Go to Edit HTML
  2. Then Find  ]]></b:skin>
  3. Then copy CSS code given below and paste above ]]></b:skin>
/* Safelink */
.askbutton.outline{display: inline-flex;display: -webkit-inline-flex;flex-wrap: wrap;-webkit-flex-wrap: wrap;align-items: center;-webkit-align-items: center;margin-bottom: 10px;padding: 9px 20px;border-radius: 10px;font-size: .8rem;line-height: 1.3rem;background-color: #282828;color: #fff;border: 1px solid #fff;}
.askbutton.outline{background-color:#282828;box-shadow: 0 2px 5px 0 rgba(0,0,0,.1);}
.safelink span{display: block;font-size: 12px}
.blockLink{display: flex;display: -webkit-flex;flex-wrap: wrap;-webkit-flex-wrap: wrap;align-items: center;-webkit-align-items: center}
.blockLink > div{display: block;width: 35%;}
.blockLink > div#go-link{width: 30%;}
.blockLink > div#go-link a{display: none;margin: 0}
.blockLink > div#go-link:target a{display: inline-flex}
.ads-top{margin: 0 0 20px 0;text-align: center}
#HTML99,#HTML99 .widget-content{border: 0 !important;margin: 0 !important;padding: 0 !important}
/* Responsive */
@media screen and (max-width: 768px){.blockLink > div{width: 100% !important;margin: 0 0 15px;text-align: center}.blockLink > div:last-child{margin: 0}}

2. Add Javascript

  1. Now find  </head> or ( <!–[ </head> close ]–> )
  2. And then paste this given javascript above it.
<b:if cond='data:blog.pageType == &quot;static_page&quot;'>
<script>/*<![CDATA[*/ var uri = window.location.toString(); 
if (uri.indexOf("%3D","%3D") > 0) { var clean_uri = uri.substring(0, uri.indexOf("%3D")); 
window.history.replaceState({}, document.title, clean_uri);} var uri = window.location.toString(); 
if (uri.indexOf("%3D%3D","%3D%3D") > 0) { var clean_uri = uri.substring(0, uri.indexOf("%3D%3D")); 
window.history.replaceState({}, document.title, clean_uri);} var uri = window.location.toString(); 
if (uri.indexOf("&m=1","&m=1") > 0) { var clean_uri = uri.substring(0, uri.indexOf("&m=1")); 
window.history.replaceState({}, document.title, clean_uri); } var uri = window.location.toString(); 
if (uri.indexOf("?m=1","?m=1") > 0) { var clean_uri = uri.substring(0, uri.indexOf("?m=1")); 
window.history.replaceState({}, document.title, clean_uri);}; var protocol=window.location.protocol.replace(/\:/g,''); if(protocol=='http'){ var url=window.location.href.replace('http','https'); 
window.location.replace(url);} /*]]>*/</script>
</b:if>
  1. Now find  </body> or ( <!–[ </body> close ]–> )
  2. And then paste this given javascript above it.
<script>/*<![CDATA[*/ var Base64 = {_keyStr: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=", encode: function (input) {var output = ""; 
      var chr1, chr2, chr3, enc1, enc2, enc3, enc4; var i = 0; input = Base64._utf8_encode(input); 
      while (i < input.length) {chr1 = input.charCodeAt(i++); 
      chr2 = input.charCodeAt(i++); chr3 = input.charCodeAt(i++); enc1 = chr1 >> 2; enc2 = ((chr1 & 3) << 4) | (chr2 >> 4); enc3 = ((chr2 & 15) << 2) | (chr3 >> 6); enc4 = chr3 & 63; 
      if (isNaN(chr2)) {enc3 = enc4 = 64;} else if (isNaN(chr3)) {enc4 = 64;} output = output + this._keyStr.charAt(enc1) + this._keyStr.charAt(enc2) + this._keyStr.charAt(enc3) + this._keyStr.charAt(enc4);} return output; }, decode: function (input) {var output = ""; var chr1, chr2, chr3; 
      var enc1, enc2, enc3, enc4; var i = 0; input = input.replace(/[^A-Za-z0-9\+\/\=]/g, ""); while (i < input.length) {enc1 = this._keyStr.indexOf(input.charAt(i++)); enc2 = this._keyStr.indexOf(input.charAt(i++)); enc3 = this._keyStr.indexOf(input.charAt(i++)); enc4 = this._keyStr.indexOf(input.charAt(i++)); chr1 = (enc1 << 2) | (enc2 >> 4); chr2 = ((enc2 & 15) << 4) | (enc3 >> 2); chr3 = ((enc3 & 3) << 6) | enc4; output = output + String.fromCharCode(chr1); 
      if (enc3 != 64) {output = output + String.fromCharCode(chr2);} if (enc4 != 64) {output = output + String.fromCharCode(chr3);} } output = Base64._utf8_decode(output); return output;}, _utf8_encode: function (string) {string = string.replace(/\r\n/g, "\n"); var utftext = ""; for (var n = 0; n < string.length; n++) {var c = string.charCodeAt(n); 
      if (c < 128) {utftext += String.fromCharCode(c);} else if ((c > 127) && (c < 2048)) {utftext += String.fromCharCode((c >> 6) | 192); 
      utftext += String.fromCharCode((c & 63) | 128);} else {utftext += String.fromCharCode((c >> 12) | 224); utftext += String.fromCharCode(((c >> 6) & 63) | 128); utftext += String.fromCharCode((c & 63) | 128); }} return utftext;}, _utf8_decode: function (utftext) {var string = ""; var i = 0; var c = c1 = c2 = 0; while (i < utftext.length) {c = utftext.charCodeAt(i); if (c < 128) {string += String.fromCharCode(c); i++;} else if ((c > 191) && (c < 224)) {c2 = utftext.charCodeAt(i + 1); string += String.fromCharCode(((c & 31) << 6) | (c2 & 63)); i += 2;} else {c2 = utftext.charCodeAt(i + 1); c3 = utftext.charCodeAt(i + 2); string += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63)); i += 3;}} return string; }}; var encode = document.getElementById('encode'), decode = document.getElementById('decode'), output = document.getElementById('output'), input = document.getElementById('input'); 
      var User_ID = ""; var protected_links = ""; var a_to_va = 0; var a_to_vb = 0; var a_to_vc = ""; function auto_safelink() {auto_safeconvert();}; function auto_safeconvert() {var a_to_vd = window.location.hostname; if (protected_links != "" && !protected_links.match(a_to_vd)) {protected_links += ", " + a_to_vd;} else if (protected_links == "") {protected_links = a_to_vd;} var a_to_ve = ""; 
      var a_to_vf = new Array(); var a_to_vg = 0; a_to_ve = document.getElementsByTagName("a"); a_to_va = a_to_ve.length; a_to_vf = a_to_fa(); a_to_vg = a_to_vf.length; var a_to_vh = false; var j = 0; 
      var daftarPostingan = [ "https://www.yourblog.com/p/safelink.html" ]; 
      var randomPostingan = daftarPostingan[Math.floor(Math.random()*daftarPostingan.length)]; var a_to_vi = ""; for (var i = 0; i < a_to_va; i++) {a_to_vh = false; j = 0; while (a_to_vh == false && j < a_to_vg) {a_to_vi = a_to_ve[i].href; if (a_to_vi.match(a_to_vf[j]) || !a_to_vi || !a_to_vi.match("https")) {a_to_vh = true;} j++; } if (a_to_vh == false) {var encryptedUrl = Base64.encode(a_to_vi); a_to_ve[i].href = randomPostingan + "?url=" + encryptedUrl; a_to_ve[i].rel = "nofollow noreferrer"; a_to_vb++; a_to_vc += i + ":::" + a_to_ve[i].href + "\n"; }} var a_to_vj = document.getElementById("anonyminized"); var a_to_vk = document.getElementById("found_links"); if (a_to_vj) {a_to_vj.innerHTML += a_to_vb;} if (a_to_vk) {a_to_vk.innerHTML += a_to_va;} }; function a_to_fa() {var a_to_vf = new Array(); protected_links = protected_links.replace(" ", ""); a_to_vf = protected_links.split(","); return a_to_vf; }; /*]]>*/</script>
      <script>/*<![CDATA[*/ protected_links = "facebook.com,instagram.com";auto_safelink(); /*]]>*/</script>
  1. Most important: don’t forget to change the color link with your Safelink page link.
  2. Now Save the Template. Its Done

Add More Than 1 Safelink Pages

You can slightly modify the script above in order to display more than two safelink pages to be selected randomly. The trick is to change the code section:

var daftarPostingan = [ "https://www.yourblog.com/p/safelink.html" ];

Add a new URL separated by a comma( , ) so that the code becomes as below; You can also add some other safelink pages

var daftarPostingan = [ "https://www.yourblog.com/p/safelink.html", "https://www.yourblog.com/p/safelink2.html" ];

Must Read:

Please follow the instructions very carefully…After you paste this code, Don’t forget to change the safelink page link, If you don’t change it, it will not work at all. In case you don’t want to, short link from any particular domain then enter your domain after facebook marked with color, And After entering your domain don’t forget to put a ” , ” after that domain. Now it is ready to use,

And if you face any error then just let me know in the comment box, Or you can contact me on telegram at any time.

Conclusion

Creating a safe link on the main blog is a very easy and simple process I hope you understand all the steps. If you have done all the steps in the right way then I assure you that your safelink on the main blog will work perfectly. But if you are still facing any issues then just let me know the comment box.

Read More:

Leave a Comment