Holy-Unblocker/public/expr/pmbp.js
QuiteAFancyEmerald 8f50d37393 Updated Links
2020-10-30 20:19:27 +00:00

30 lines
No EOL
877 B
JavaScript

function $(id) {
return document.getElementById(id);
};
//PM Load
$('pmprox').onclick = function() {
var url = $('url').value;
var det = document.domain;
var domain = det.replace('www.', '').split(/[/?#]/)[0];
window.location.href = "https://c." + domain + "/prox?url=" + url;
document.cookie = 'oldsmobile=1; expires=' + (Date.now() + 259200) + '; SameSite=Lax; domain=.' + auth + '; path=/; Secure;';
return false;
};
// Cookie Auth
var host = location.hostname.split('.');
var auth = location.hostname;
if (host.length == 3) {
auth = `${host[1]}.${host[2]}`;
}
Array.from(document.getElementsByTagName('button')).forEach(e => {
e.addEventListener('click', () => {
document.cookie = 'session; max-age=259200; SameSite=None; domain=' + auth + '; path=/; Secure;';
});
});
window.onload = function() {
$('url').focus();
}