Skip to content

Instantly share code, notes, and snippets.

@Radagaisus
Created November 11, 2012 23:41
Show Gist options
  • Select an option

  • Save Radagaisus/4056748 to your computer and use it in GitHub Desktop.

Select an option

Save Radagaisus/4056748 to your computer and use it in GitHub Desktop.
like
reverse = (fn, args...) ->
fn.apply(this, args.slice(0).reverse())
times = (step, times, fn, args...) ->
checks = 0
interval = reverse setInterval, 1500, ->
if fn.apply(this, args) or checks++ >= times
clearInterval(interval)
detect_facebook_like = ->
return false unless FB?
# edge.create is a like
FB.Event.subscribe 'edge.create', (e, fb) ->
# Hide Ads!
FB.Event.subscribe 'edge.remove', (e, fb) ->
# Show Ads again!
return true
$ ->
times 1500, 20, detect_facebook_like
@LeonFedotov
Copy link

var all = document.all;
for(var i in all) {
    if(parseInt(i, 10) == i) {
        all[i].className && /google.*ads/.test(all[i].className) && console.log(all[i].className);
        all[i].id && /google.*ads/.test(all[i].id) && console.log(all[i].id);
    } 
}

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