-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path1shortlink.min.js
1 lines (1 loc) · 2 KB
/
1shortlink.min.js
1
var adlinkfly_url="https://1shortlink.com/",adlinkfly_api_token="9453c8f226946d87888855576207edf568c9572f",adlinkfly_advert=2,adlinkfly_domains=["chrome.google.com","mshare.io","user.mshare.io","drive.google.com","www.google.com","i.imgur.com","www.mediafire.com","bit.ly","ajmt-my.sharepoint.com"];function adlinkfly_get_url(e){var n=document.createElement("a");return n.href=e,n}function adlinkfly_get_host_name(e){return null==e||""===e||e.match(/^\#/)?"":-1===(e=adlinkfly_get_url(e)).href.search(/^http[s]?:\/\//)?"":e.href.split("/")[2].split(":")[0].toLowerCase()}function adlinkfly_base64_encode(e){return btoa(encodeURIComponent(e).replace(/%([0-9A-F]{2})/g,function(e,n){return String.fromCharCode("0x"+n)}))}document.addEventListener("DOMContentLoaded",function(e){if(void 0!==adlinkfly_url&&void 0!==adlinkfly_api_token){var n=1;void 0!==adlinkfly_advert&&(2==adlinkfly_advert&&(n=2),0==adlinkfly_advert&&(n=0));var l=document.getElementsByTagName("a");if(void 0===adlinkfly_domains)if("undefined"==typeof adlinkfly_exclude_domains);else for(a=0;a<l.length;a++){var o=adlinkfly_get_host_name(l[a].getAttribute("href"));0<o.length&&-1===adlinkfly_exclude_domains.indexOf(o)?l[a].href=adlinkfly_url+"api/v1/full-pages?api_key="+encodeURIComponent(adlinkfly_api_token)+"&url="+adlinkfly_base64_encode(l[a].href)+"&type="+encodeURIComponent(n):"magnet:"===l[a].protocol&&(l[a].href=adlinkfly_url+"api/v1/full-pages?api_key="+encodeURIComponent(adlinkfly_api_token)+"&url="+adlinkfly_base64_encode(l[a].href)+"&type="+encodeURIComponent(n))}else for(var a=0;a<l.length;a++)0<(o=adlinkfly_get_host_name(l[a].getAttribute("href"))).length&&-1<adlinkfly_domains.indexOf(o)?l[a].href=adlinkfly_url+"api/v1/full-pages?api_key="+encodeURIComponent(adlinkfly_api_token)+"&url="+adlinkfly_base64_encode(l[a].href)+"&type="+encodeURIComponent(n):"magnet:"===l[a].protocol&&(l[a].href=adlinkfly_url+"api/v1/full-pages?api_key="+encodeURIComponent(adlinkfly_api_token)+"&url="+adlinkfly_base64_encode(l[a].href)+"&type="+encodeURIComponent(n))}});