chrome.cookies.getAll({}, function(cookies) {
var count = cookies.length;
console.log('Найдено Cookie '+count+' шт.');
console.dir(cookies);
for (var n = 0; n < cookies.length; n++) {
var details = {
'name': cookies[n]['name'],
'storeId': cookies[n]['storeId'],
'url': 'https://' + cookies[n]['domain'] + cookies[n]['path']
};
chrome.cookies.remove(details, function(result) {
count--;
if (count === 0) {
console.log('Cookie успешно очищены:');
chrome.cookies.getAll({}, function(cookies) { console.dir(cookies); });
}
});
}
});
iframe_document = document.querySelector('iframe#id1').contentWindow.document.querySelector('iframe#id2').contentWindow.document;
span_text = iframe_document.querySelector('span').innerText;
console.log(span_text);