How do I trigger the action on this element on plus.google.com via a userscript using jQuery? -
i'm using google+ quite heavily , 1 thing find myself doing extremely clicking 'more' button in left-hand sidebar access circles hidden view. i'm trying write user script activate "more" link me on page load. dom structure of sidebar upto "more" element:
<div class="a-b-la-a"> <h2 class="a-za">navigation</h2> <a href="/welcome" target="_top" class="d-h a-b-h-jb a-la-h a-la-ah ">welcome</a> <div class="a-la-dd"></div> <a href="/stream" target="_top" class="d-h a-b-h-jb a-la-h a-la-ah a-la-h-pa">stream</a> <div class="a-la-h-ga"><a href="/stream/circles/p5653c3hhy60aadf997" target="_top" class="d-h a-b-h-jb a-la-h a-la-rb-h a-b-la-rb-h">friends</a></div> <span role="button" class="d-h a-b-la-gc-h a-la-h a-la-ha" tabindex="0">more<span class="a-b-la-bw a-la-tb-q">▾</span></span> ...and here's snippet i'm working on:
$('div.a-b-la-a span').filter('[role="button"]:contains("more")').trigger('click'); i can select , manipulate 'more' element fine , here's bg-color set yellow with:
$('div.a-b-la-a span').filter('[role="button"]:contains("more")').css({'background-color': 'yellow'}); ...but still can't activate function tied element. things i've tried:
- tried using .click() instead of trigger('click')
- tried identify function getting triggered on click, using firebug , event spy no success
- tried .mousedown() , trigger('mousedown') instead of triggering 'click' event
any other ideas?
use low-level code fire js link. should work:
var clickevent = document.createevent ("htmlevents"); clickevent.initevent ("click", true, true); var jnode = $('div.a-b-la-a span').filter('[role="button"]:contains("more")'); if (jnode.length != 1) alert ('oops! found many (or no) "more" links'); jnode[0].dispatchevent (clickevent);
Comments
Post a Comment