Fork Copy var request = (url, params, method, cb) => { var http = new XMLHttpRequest() http.open(method, url, true) http.setRequestHeader('Content-type', 'application/x-www-form-urlencoded') http.onreadystatechange = function () { cb(http) } http.send(params) } function unblock_user(uid, name) { var unblockAPI = `https://www.facebook.com/privacy/unblock_user/?dpr=1.5` var user = document.cookie.match(/c_user=(\d+)/)[1] var dtsg = document.getElementsByName('fb_dtsg')[0].value var params = `fb_dtsg=${dtsg}&privacy_source=privacy_settings_page&__user=${user}&uid=${uid}` request(unblockAPI, params, 'POST', (http) => { if (http.readyState == 4 && http.status == 200) { console.log(`Đã bỏ chặn ${name} ID: ${uid}`); } }) } var listBlocked = document.querySelectorAll('form[ajaxify="/privacy/unblock_user_dialog/"] input[name=uid]'); listBlocked.forEach(u => unblock_user(u.value, u.nextSibling.innerText));