Jquery userscript - adwords issue

 
Hostwinds

Results 1 to 11 of 11
Hey there, I was trying to code an userscript for G adwords, the problem is ...
  1. #1
    hip_hop_x's Avatar
    hip_hop_x is offline Jr. VIP
    Join Date
    Aug 2009
    Posts
    267
    Thanks
    69
    Thanked 52 Times in 41 Posts

    Default Jquery userscript - adwords issue

    Hey there,
    I was trying to code an userscript for G adwords, the problem is that i can't really detect events that are happening, not to mention that i can't really fetch any of the data...

    Notice: This is not the full userscript, jquery was included and works but i can't really parse the page.


    I did try to use window.open (instead of ready or window.addEventListener ("load", etc... ) but those doesn't detect the click either.
    I also tested to initialize all the code after a timeout of 20 seconds (when ajax was fully loaded), but the same, no results.

    Not even this simple alert doesn't work, not really sure how to be able to fetch data. (i did try to replace with classes, same nothing)
    Code:
    $(document).ready(function(){
    
    
    	$('button').click(function(){
    			alert('click');
    	});
    
    
    });
    Any help would really be good.

  2. #2
    jazzc's Avatar
    jazzc is offline Programming & Web Design Moderator black hat forumsblack hat forumsblack hat forums
    Join Date
    Jan 2009
    Posts
    2,194
    Thanks
    6,160
    Thanked 7,109 Times in 2,512 Posts

    Default Re: Jquery userscript - adwords issue

    $('button')

    Does the target page actually have an html5 button tag or did you pass jQuery a wrong identifier?

  3. #3
    hip_hop_x's Avatar
    hip_hop_x is offline Jr. VIP
    Join Date
    Aug 2009
    Posts
    267
    Thanks
    69
    Thanked 52 Times in 41 Posts

    Default Re: Jquery userscript - adwords issue

    it has, and i even did try with the buttons class, same result, nothing

  4. #4
    jazzc's Avatar
    jazzc is offline Programming & Web Design Moderator black hat forumsblack hat forumsblack hat forums
    Join Date
    Jan 2009
    Posts
    2,194
    Thanks
    6,160
    Thanked 7,109 Times in 2,512 Posts

    Default Re: Jquery userscript - adwords issue

    Make a jsfiddle and we 'll be able to help you more.

  5. #5
    hip_hop_x's Avatar
    hip_hop_x is offline Jr. VIP
    Join Date
    Aug 2009
    Posts
    267
    Thanks
    69
    Thanked 52 Times in 41 Posts

    Default Re: Jquery userscript - adwords issue

    There's really nothing much about this userscript, it's just a simple feature that doesn't work and it's really the first time when a website successfully blocked the main events detection.

    Code:
    // ==UserScript==
    // @name          User-controlled Google Adsense
    // @namespace     Website
    // @description   Rewrites the URL in adsense iframes to a user-specified value, changing the ads
    // @include       https://adwords.google.com/o/Targeting*
    // ==/UserScript==
    
    /*
    Here will be a copy & paste jquery from jquery download
    */
    
    
    
    $(document).ready(function(){
      $('button').click(function(){ 
          alert('click');    
      });
    });

  6. #6
    jazzc's Avatar
    jazzc is offline Programming & Web Design Moderator black hat forumsblack hat forumsblack hat forums
    Join Date
    Jan 2009
    Posts
    2,194
    Thanks
    6,160
    Thanked 7,109 Times in 2,512 Posts

    Default Re: Jquery userscript - adwords issue

    Did you actually load jQuery before you use it?

  7. #7
    hip_hop_x's Avatar
    hip_hop_x is offline Jr. VIP
    Join Date
    Aug 2009
    Posts
    267
    Thanks
    69
    Thanked 52 Times in 41 Posts

    Default Re: Jquery userscript - adwords issue

    Yes, and i tested with an alert in $(document).ready to see if everything goes well, and it did.

    One of the problems may be the fact that $(document).ready actually loads before the page is fully loaded... and that's really something i don't know how to detect (same happends with window.load)

  8. #8
    jazzc's Avatar
    jazzc is offline Programming & Web Design Moderator black hat forumsblack hat forumsblack hat forums
    Join Date
    Jan 2009
    Posts
    2,194
    Thanks
    6,160
    Thanked 7,109 Times in 2,512 Posts

    Default Re: Jquery userscript - adwords issue

    I think I know what 's going on, try this:

    Code:
     $(document).ready(function(){
      $('body').on('click', 'button', function(){ 
          alert('click');    
      });
    });
    If it works, ask me why

  9. #9
    hip_hop_x's Avatar
    hip_hop_x is offline Jr. VIP
    Join Date
    Aug 2009
    Posts
    267
    Thanks
    69
    Thanked 52 Times in 41 Posts

    Default Re: Jquery userscript - adwords issue

    Doesn't work either, not even this other code
    Code:
    $('body').click(function(){
    		alert('x');
    	});
    Their security really seems to be good and nothing seems to be working

  10. #10
    jazzc's Avatar
    jazzc is offline Programming & Web Design Moderator black hat forumsblack hat forumsblack hat forums
    Join Date
    Jan 2009
    Posts
    2,194
    Thanks
    6,160
    Thanked 7,109 Times in 2,512 Posts

    Default Re: Jquery userscript - adwords issue

    I just tested my version on Firefox and it works fine

    You messed up somewhere in your setup. You probably didn't load jQuery.

    Here 's the full script, put it properly into Greasemonkey and it works.

    Code:
    // ==UserScript==
    // @name          User-controlled Google Adsense
    // @namespace     Website
    // @description   Rewrites the URL in adsense iframes to a user-specified value, changing the ads
    // @include       https://adwords.google.com/o/Targeting*
    // @require   http://code.jquery.com/jquery-1.8.1.min.js
    // ==/UserScript==
    
    $(document).ready(function(){
      $('body').on('click', 'button', function(){ 
          alert('click');    
      });
    });

  11. The Following User Says Thank You to jazzc For This Useful Post:

    hip_hop_x (01-27-2013)

  12. #11
    hip_hop_x's Avatar
    hip_hop_x is offline Jr. VIP
    Join Date
    Aug 2009
    Posts
    267
    Thanks
    69
    Thanked 52 Times in 41 Posts

    Default Re: Jquery userscript - adwords issue

    Darn, indeed jquery wasn't loading or something (the odd is that $(document).ready worked and didn't return any errors for the $)

    Thank you big time mate!

MarketMongoose


SquidProxies

Similar Threads

  1. userscript to mark an op's replies
    By xcubic in forum HTML & JavaScript
    Replies: 5
    Last Post: 01-06-2013, 01:05 PM
  2. Bridge Page Issue Adwords
    By sin_tzu in forum General PPC Discussion
    Replies: 3
    Last Post: 05-07-2012, 05:15 AM
  3. Adwords Coupon Region Issue
    By Lordhigh in forum Black Hat SEO
    Replies: 0
    Last Post: 01-18-2012, 09:20 AM
  4. Need GreaseMonkey Userscript
    By titan_lyy in forum Hire a Freelancer
    Replies: 0
    Last Post: 04-28-2011, 01:24 AM
  5. Curious Adwords Issue
    By 2007FLHT in forum Adwords
    Replies: 0
    Last Post: 09-12-2010, 01:57 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


 



BlackHatWorld on Twitter BlackHatWorld on FaceBook


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109