JSFiddle - React, Tailwind, and code Playground
by Kevin Pliester
HTML
<iframe id="cookieScanner" src="https://pixelbuben.de" height="260" width="100%"></iframe>
JavaScript
(function($) {
function getCookie(cookie, name) {
function escape(s) {
return s.replace(/([.*+?\^${}()|\[\]\/\\])/g, '\\$1');
};
var match = cookie.match(RegExp('(?:^|;\\s*)' + escape(name) + '=([^;]*)'));
return match ? match[1] : null;
}
setTimeout(function() {
var cookie = $("#cookieScanner").contentDocument.cookie.split(';');
console.log(cookie);
}, 2500);
})(jQuery);