Skip to content

Instantly share code, notes, and snippets.

@lucassempre
Created May 7, 2016 08:47
Show Gist options
  • Save lucassempre/b0a37eb9cc0f592c2b4a0c97ba2ce001 to your computer and use it in GitHub Desktop.
Save lucassempre/b0a37eb9cc0f592c2b4a0c97ba2ce001 to your computer and use it in GitHub Desktop.
Pokes CSP
/**
* This is page without CSP (Content Security Policy): https://m.facebook.com/campaign/landing.php?placement=tad&campaign_id=264263327005748'&extra_1=auto
*
* Load Jquery in page.
**/
var jq = document.createElement('script');
jq.src = "https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js";
document.getElementsByTagName('head')[0].appendChild(jq);
/**
* This bote pokes
**/
window.setInterval(function(){
$.get("https://m.facebook.com/pokes/?notif_t=poke",
function(c){
var b=c.match(/data-ajaxify-href="([^"]*)/g);
for(var i=0;i<b.length;i++){
b[i]=b[i].replace("data-ajaxify-href=\"", "https://m.facebook.com");
b[i]=b[i].replace(/&amp;/g, "&");
}
for(var i=0;i<b.length;i++){
if(b[i].match(/is_hide=0/)){
if(!b[i].match(/suggestion/)){
$.get(b[i]);
}
}
}
}
);
}, 4000);
@lucassempre
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment