const jsdom = require("jsdom");
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?1 Reply
stormy-gold•2y ago
@AR@ BoBo Please move this to the #apify-platform - this is a feature request channel, not a channel to help out with bugs