Как открыть новое окно на JS, если adblock блокирует?
нужно чтобы открывалось новое окно со списком элементов из localStorage при нажатии на кнопку. Проблема в том, что adblock это блокирует. Можно ли как-то добиться подобного поведения по-другому?
showList.addEventListener('click', function () {
if (JSON.parse(localStorage.getItem('items')) == null){
alert ("Список пустой");
return;
}
function urlSiteCrop(url) {
let output = url.replace(/^/, `"`).replace(/$/, `",`);
return output;
};
let itemsArray = JSON.parse(localStorage.getItem('items'));
let output = [];
for (let i = 0; i < itemsArray.length; i++) {
output[i] = urlSiteCrop(itemsArray[i]) + ("<br>");
}
window().open.document.write(output.join(""));
})