Код: Выделить всё
javascript:(function() {
function checkServer(url) {
const options = { method: 'HEAD', mode: 'no-cors' };
return fetch(url, options)
.then(response => console.log('Check server response:', response.ok))
.catch(error => console.error('Check server error:', error.message));
}
checkServer('https://www.reddit.com');
})();
Подробнее здесь: https://stackoverflow.com/questions/794 ... with-fetch
Мобильная версия