Note that there are some explanatory texts on larger screens.

plurals
  1. POHow do I trigger the action on this element on plus.google.com via a userscript using jQuery?
    primarykey
    data
    text
    <p>I'm using Google+ quite heavily and one thing I find myself doing extremely frequently is clicking the 'More' button in the left-hand sidebar to access my circles that are hidden from view. I'm trying to write a user script that will activate the "More" link for me on page load. This is the DOM structure of the sidebar upto the "More" element:</p> <pre><code>&lt;div class="a-b-la-A"&gt; &lt;h2 class="a-za"&gt;Navigation&lt;/h2&gt; &lt;a href="/welcome" target="_top" class="d-h a-b-h-Jb a-la-h a-la-aH "&gt;Welcome&lt;/a&gt; &lt;div class="a-la-Dd"&gt;&lt;/div&gt; &lt;a href="/stream" target="_top" class="d-h a-b-h-Jb a-la-h a-la-aH a-la-h-Pa"&gt;Stream&lt;/a&gt; &lt;div class="a-la-h-ga"&gt;&lt;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"&gt;Friends&lt;/a&gt;&lt;/div&gt; &lt;span role="button" class="d-h a-b-la-gc-h a-la-h a-la-hA" tabindex="0"&gt;More&lt;span class="a-b-la-bw a-la-tb-q"&gt;▾&lt;/span&gt;&lt;/span&gt; </code></pre> <p>...and here's the snippet I'm working on:</p> <pre><code>$('div.a-b-la-A span').filter('[role="button"]:contains("More")').trigger('click'); </code></pre> <p>I can select and manipulate the 'More' element just fine and <a href="http://i.stack.imgur.com/Qp6Js.png" rel="nofollow">here's the bg-color set to yellow</a> with:</p> <pre><code>$('div.a-b-la-A span').filter('[role="button"]:contains("More")').css({'background-color': 'yellow'}); </code></pre> <p>...but I still can't activate the function tied to the element. Things I've tried:</p> <ol> <li>tried using .click() instead of trigger('click')</li> <li>tried to identify the function getting triggered on click, using Firebug and Event Spy with no success</li> <li>tried .mousedown() and trigger('mousedown') instead of triggering the 'click' event</li> </ol> <p>Any other ideas?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload