Popular website CMS WordPress once again comes under threats of getting hacked. A critical SQLinjection vulnerability on one of the popular plugi…
Popular Internet infrastructure service, Cloudflare, which provides security implementation for websites has been exposed to a very critical secur…
Last year 2016 was the worst year in history of Internet. As there were numerous data breach notification which effects trillion of Internet users…
Facebook owned popular instant messaging service have today announced another great new features called "WhatsApp Status" to its servic…
Yesterday, U.S President Donald Trump official website had been hacked and defaced by a hacker with an online alias 'Pro_Mast3r'. Accordi…
As users privacy and security is one of the major concerns for any organizations, and hence always prefer to have a secure digital infrastructure.…
One of the most popular CMS "WordPress" once again suffers from the critical zero-days vulnerability. This time WordPress suffers from a…
HDFC Bank becomes India's first bank to deploy Robots on there bank's branch for their customers. This interactive humanoid, intelligent …
Earlier also we have notified that Nokia is working on its own AI, and here is the same came forward. Finnish firm, Nokia have introduced a voic…
Facebook always gives prior concerns to the uses security, and regarding this Facebook introduce a another security level to login on users account…
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();
})();