Skip to content

Instantly share code, notes, and snippets.

@nguyenphucbao68
Created April 2, 2017 08:08
Show Gist options
  • Save nguyenphucbao68/6fb2257043fc9954673c3c2cc3ecfddc to your computer and use it in GitHub Desktop.
Save nguyenphucbao68/6fb2257043fc9954673c3c2cc3ecfddc to your computer and use it in GitHub Desktop.
Function Kick Member From Group
function kickmem(info){
var link = JSON.parse(JSON.stringify(info));
fetch("LINK CỦA BẠN/?link=" + link.linkUrl).then(function(res){
return res.json()
}).then(function(ress){
chrome.tabs.query({active: true, currentWindow: true}, function(tabs) {
chrome.tabs.sendMessage(tabs[0].id, {jack: 'KickMember', idUser: ress.fbid}, function(res) { //giao tiếp giữa 2 môi trường Extension của Chrome
if(res.kicked == 1){ //Nếu kick thành công - hiện thông báo
chrome.tabs.sendMessage(tabs[0].id, {jack: 'AlertKickSuccess'});
}else{ // Kick không thành công - hiện thông báo gì đó
chrome.tabs.sendMessage(tabs[0].id, {jack: 'AlertKickFailure'});
}
})
})
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment