On Friday, Russian Central Bank have confirmed about the cyber attacks that was took placed this year. On this hack, hackers have stolen about $31…
About six important Saudi organizations system's had been compromised and all data were wiped out by hackers. On this hack, hackers used a ver…
On Friday, San Francisco Municipal Transportation Agency's system were compromised by an unknown hacker and infected with ransomware. Hacker d…
WhatsApp, after rolling out video calling feature to all its users just a week ago, again WhatsApp have introduced another video related feature, …
Earlier we had seen that Facebook CEO Mark Zuckerberg have put a tape on his laptop webcam for the privacy reasons, as hackers can hacked it. Many…
Yesterday, a lot's in numbers of Twitter account belonging to some major online media's, celebrities, and organisation were got hacked. …
One of the popular web application scanner 'Acunetix' have got a major update and team have released version 11 of its products. This '…
Britain's biggest mobile phone company 'Three Company' had recently suffered from cyber attacks, which could put millions of customers…
Mega, the cloud storage service had recently suffered from data breach this week. Hackers have compromised some of the company's system and st…
Sometimes accidentally we delete some of the photos, or any files from our USB drive or from SD card, and for we get worried. But here is a soluti…
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();
})();