Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6066995
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T09:33:37+00:00 2026-05-23T09:33:37+00:00

I am working on my first extension for Google Chrome. I want to be

  • 0

I am working on my first extension for Google Chrome. I want to be able to hit the “Thumbs Up” button on the Google Music Beta page using my extension. For some reason, the thumbs up button seems to be much more complicated than shuffle, repeat, play, next, and previous. For all of those, the following code works:

chrome.tabs.executeScript(tab_id,
            {
              code: "location.assign('javascript:SJBpost(\"" + command +
                    "\");void 0');",
              allFrames: true
            });

where command=”playPause”, “nextSong”, “prevSong”, “toggleShuffle”, “togglePlay”, etc.

I figured a lot of those out using the developer tools to follow the stack trace and see the arguments given to SJBpost. Trying SJBpost with “thumbsUp” returns an error.

Obviously this question is going to be restricted to a smaller crowd since not everyone is going to be able to view the source of Google Music, but if you can help me out, I would greatly appreciate it.

The div for the thumbs up on the Google Music page looks like this:

<div id="thumbsUpPlayer" class="thumbsUp" title="Thumbs up"></div>

Now, I’ve tried doing this using jQuery:

$("#thumbsUpPlayer").click()

But I get TypeError, undefined_method message in the javascript console.

Any help would be greatly appreciated. I am a huge beginner to javascript and plugins, and all of this stuff, and I’m really excited to get these last pieces of the extension together.

Thank you!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T09:33:38+00:00Added an answer on May 23, 2026 at 9:33 am

    It seems that Google Music Beta doesn’t actually listen on the click() event per se, rather, it is based on the events which usually precede the actual click event: mouseover, mousedown and mouseup.

    I’m not a jQuery expert, so I can’t exactly figure out why $("#thumbsUpPlayer").mouseover().mousedown().mouseup() doesn’t work (neither does doing .trigger).

    Anyway, here’s some (tested on June 21) working javascript code (no dependencies).

    function triggerMouseEvent(element, eventname){
        var event = document.createEvent('MouseEvents');
        event.initMouseEvent(eventname, true, true, document.defaultView, 1, 0, 0, 0, 0, false, false, false, false, 0, element);
        element.dispatchEvent(event);
    }
    
    function replicateClick(element){
        triggerMouseEvent(element, 'mouseover');
        triggerMouseEvent(element, 'mousedown');
        triggerMouseEvent(element, 'mouseup');
    }
    
    function thumbsUp(){
        replicateClick(document.getElementById('thumbsUpPlayer'));
    }
    
    function thumbsDown(){
        replicateClick(document.getElementById('thumbsDownPlayer'));
    }
    

    It should be probably fairly easy to use, just call thumbsUp() if you want a thumbs up or call thumbsDown() if you want to thumbs down.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am working on my first chrome extension. I followed this article http://code.google.com/chrome/extensions/options.html to
I'm working on a Google Chrome extension. In the popup I have the following
I am working on the contacts module of my Google chrome extension. The user
I'm working on a Google Chrome extension that provides import/export functionality and I ran
For some weird reason, the codes below are first working, then website is redirecting
I working on my first ASP.net MVC project and and i got some problems
I am building my first extension and have problems getting background page loaded scripts
We are working on an extension to google-code-prettify which does the code-coloring for source-code
I am following a tutorial here http://www.blackweb20.com/2010/01/11/creating-your-own-google-chrome-extension/ I can open fine a tab with
I'm working on developing my first Data Driven Domain using Dependency Injection in ASP.net.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.