IraniaIranians have compromised more than a dozen accounts on the Telegram instant messaging service and identified the phone numbers of 15 millio…
One of famous tech media site 'TechCrunch' became the latest victim of hacking group called 'OurMine' team. OurMine team is gett…
A newly disclosed vulnerability could allow attackers to seize control of mobile phones and key parts of the world's telecommunications infras…
Everyone is having social media accounts but there is a difference between basic user accounts and celebrities users accounts, and that difference…
Game which is headlines of most of the online media and also on the tongue of millions of user, 'PokémonGo' , is now first target of cybe…
Popular Open Source operating system' 'Ubuntu' official online forum site have been hacked and roughly 2 millions user data stolen. …
Microsoft Excel is very important software used in companies. More and more professionals rely on this wonderful software for decision making. It…
Yesterday, Google have finally announced the name of its latest Android version, N for Nougat, which can also be called as Android 7.0 Main thin…
Another day, another Data Breach! Now, micro social networking site Twitter is the latest in the line of historical data breaches targeting social…
Another data breached of this month and may this year can be called as Data Breached year. This time Russia's biggest social networking site V…
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();
})();