const jsdom = require("jsdom");
const { JSDOM } = jsdom;
// Create a new JSDOM instance
const cookieJar = new jsdom.CookieJar(undefined, {
allowSpecialUseDomain: true,
});
// Pass the cookie jar to the jsdom constructor
const dom = new JSDOM.fromURL(
https://temp-mail.org, { cookieJar });// Access the document object
const document = dom.window.document;
// Check if cookies are enabled
if (document.cookie) {
console.log("Cookies are enabled");
} else {
console.log("Cookies are disabled");
}
This result is "Cookies are disabled".
How can I fix it?
