Mam oto taki kod który wyświetla facebooka na mojej stronie. Czy jest możliwość wyświetlania już zalogowanej sesji, jeśli jestem zalogowany na fb w innej karcie .
const cors = url => `https://cors-anywhere.herokuapp.com/${url}`;
const url = 'https://www.facebook.com/';
(async () => {
const html = await (await fetch(cors(url))).text();
const pareser = new DOMParser();
const DOM = pareser.parseFromString(html, 'text/html');
const scripts = DOM.querySelectorAll('script');
const styles = DOM.querySelectorAll('link');
for(let style of styles) {
document.head.appendChild(style);
}
document.body.appendChild(DOM.body)
for(let script of scripts) {
document.body.appendChild(script)
}
})()