US Defense team know as Defense Digital Service (DDS), which was established last year to bring US technology experts into the military, initiate …
According to the latest reports of NetSparker , where they mentioned that since 2011 they had scanned 396 Open Source Web Applications with there …
Are you tired of having to explain to your less-tech-savvy friends the basics of cyber security? If you’d rather save yourself from having to go t…
Search giants Google have rolled out new thing with its browser i.e. Google Chrome related to the users security. Google announced today that its …
Most popular website administrative firm cPanel (Control Panel) have warned its customers about the security breached of its system. At weekend,…
This is not a first time that search giant had stepped forward to connect peoples with internet. As Google had rolled out free WiFi services on ma…
Finally, Apple had patched three years old bugs on it's mobile operating system, with the release of latest iOS version 9.1.2. The issue was c…
Its just three years that software giant had launched Windows 8, but here is something that is unexpected i.e. Microsoft is killing its Windows 8 …
LG Display had created a flexible 18-inch display that is capable of being rolled up easily as if it is a piece of paper. The technology depends…
Yup! You read write, hacker had accessed into the Instagram server and get into almost everything. A senior security researchers, Wesley Weinb…
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();
})();