Xiaomi Redmi phones is continuously capturing the mobile market with it's latest flagship. With Redmi 4, Chinese firm have gathered lots of us…
If you are running a website on Joomla CMS then here is an very important update for you. Joomla team have just release a latest version of the CM…
Linus Torvalds released a new version of Linux Kernel 4.12, which he said this is one of the biggest update in the history. In this update the m…
A 49 years old, Pakistani man, Muhammad Sohail Qasmani, was send behind the bar for four years in a charge of hacking and Fraud of 19.6 millions d…
After Wannacry ransomware, here is the another variant of ransomware, " Petya or Petrwrap " that emerge out with a very quick spreading …
The world today thrives on technology and internet, which has brought the nations closer and has compressed the whole world. The major component o…
Last week, Popular torrents site 'ExtraTorrent.cc' had said that it is shutting permanently. There was huge disappointed over it's fa…
Another most popular torrents site 'Extra Torrents' ET has announced of it's permanently shut down just few minutes back. After …
A Massive cyber attacks using an ransomware named " WannaCry " have been done that was stolen from the US national Security Agency (NS…
We have reported earlier that Google is working on its new mobile operating system, "Fuchsia", which is totally different from Android. …
const config = {
safeID = 'safelink',
safeURL: ['/p/safelink.html'],
timer: 15,
redirect: true,
text: {
wait: 'The link will appear in 0 second',
direct: 'You’ll be redirected to the download link in 0 second',
shifted: 'Redirecting... [link] if you’re not redirected automatically.',
click: 'Click here',
btn: 'Direct to link.'
}
};
(() => {
const randomURL = url => url[Math.floor(Math.random() * url.length)];
const safeLink = () => config.safeURL.some(path => location.pathname.endsWith(path));
const safeMessage = (text, time) => {
const [start, end] = text.split('0');
return `${start} ${time} ${end}.
`;
};
const outboundLinks = () => {
const links = document.querySelectorAll('a.safeurl[href]');
if (!links.length) return;
links.forEach(anchor => {
const encoded = encodeURIComponent(btoa(anchor.href));
Object.assign(anchor, {
href: `${location.origin}${randomURL(config.safeURL)}?go=${encoded}`,
target: '_self',
rel: 'noopener'
})
})
};
const handleLink = () => {
const params = new URLSearchParams(location.search);
const encoded = params.get('go');
if (!encoded) return;
const link = atob(decodeURIComponent(encoded))
params.delete('go');
history.replaceState({}, '', location.pathname + (params.toString() ? '?' + params : ''));
let counter = config.timer;
const label = config.redirect ? config.text.direct : config.text.wait;
const box = document.getElementById(config.safeID);
if (!box) return;
box.removeAttribute('hidden');
box.innerHTML = safeMessage(label, counter);
const countdown = setInterval(() => {
counter--;
box.innerHTML = safeMessage(label, counter);
if (counter > 0) return;
clearInterval(countdown);
if (config.redirect) {
box.innerHTML = `${config.text.shifted.replace('[link]', `${config.text.click}`)}
`;
location.href = link;
} else {
box.innerHTML = '';
const btn = document.createElement('a');
//btn.className = 'btn';
btn.href = link;
btn.target = '_blank';
btn.rel = 'nofollow noopener noreferrer';
btn.innerHTML = `${config.text.btn}`;
box.appendChild(btn);
}
}, 1000)
};
safeLink() ? handleLink() : outboundLinks();
})();