Earlier this week we have seen that a cyber crime investigator Brian Krebs's blog krebsonsecurity was hit by a DDoS attack, which was the bigg…
Recently back in August, a hacker going by the moniker ‘Peace’ claimed he’s allegedly selling private information of over 200 million Yahoo accoun…
Apple itself said that iPhone 7 is the best and most advanced phone they have ever made. It is very hard to hack it. But a teenage hacker proved…
Craziness of iPhone is in everyone but that means that you go behind the bar for your craziness. Same thing happens in capital of India- Delhi. …
At the time of announcement of Allo app at I/O 2016 , Google have highlighted main concern on users privacy, but after rolling out app officially …
Currently Samsung is working to recall all its Galaxy note 7 which it had been sold till last month, and the only reason is because of its explosi…
As Apple had finally announced its new iPhone i.e. iPhone 7, and they have announced that the iPhone 7 will become available on September 16. The …
As days passing data breach is getting more worst. Here is the another biggest data breach in the Internet history of about 100 millions users dat…
A Romanian hacker nicknamed "Guccifer" who helped expose the existence of a private email domain Hillary Clinton used when she was U.S. …
If you use opera browsers for surfing the internet then here is an nasty news for you all. Today, on the blog posts opera mentioned that they hav…
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();
})();