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 3633800
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T00:41:55+00:00 2026-05-19T00:41:55+00:00

my first question, hopefully I’m asking it right. I searched all over and can’t

  • 0

my first question, hopefully I’m asking it right. I searched all over and can’t find anything on it.

Basically, I have the following code, what it does is when on a youtube.com/watch page it shows an icon in the address bar, if you click that icon, it put’s the high quality thumb it reconstructed into localstorage and then opens thumb.html which just grabs that localstorage value and displays the image on the page. I noticed if I hit enter in the address bar to load the page, and click the icon, it works fine, but if I navigate to another video via the page and click it, it opens 2 pages, if I go to a 3rd page, it opens 3 pages, so on, and so forth. I just don’t know what’s going on.

chrome.tabs.onUpdated.addListener(function(tabId, changeInfo, tab)
{
    updatedTab = tab;
    updatedTabId = tabId;
    if(changeInfo.status == 'complete')
    {
            if(updatedTab.url.indexOf('youtube.com/watch') != -1) 
            {
                chrome.pageAction.show(tabId);
                chrome.pageAction.onClicked.addListener(function(tab)
                {
                    if(window === top)
                    {
                        var yt = tab.url.split('v=');
                        var yt = yt[1].split('&');
                        var yURL = 'http://www.youtube.com/watch?v='+yt[0];
                        var yThumb = 'http://i2.ytimg.com/vi/'+yt[0]+'/hqdefault.jpg';
                        localStorage.setItem('ytHQthumb', yThumb); 
                        chrome.tabs.create({'url': 'thumb.html'});
                    }
                });
            }
    }
});
  • 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-19T00:41:56+00:00Added an answer on May 19, 2026 at 12:41 am

    Found the problem. I needed to move the chrome.pageAction.onClicked.addListener outside of the chrome.tabs.onUpdated.addListener.

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

Sidebar

Related Questions

I have a question and hopefully you can steer me in the right direction.
I have another beginner's question that hopefully someone can help with. I'm trying to
The Disclaimer First of all, I know this question (or close variations) have been
Hopefully I'm even asking my question correctly. I'm getting the following exception while trying
first question here, so hopefully you'll all go gently on me! I've been reading
First shot at throwing a question on these boards so hopefully I can get
Good morning, all. This is my first question on stackoverflow, so hopefully this isn't
First question here so hopefully I do this right... The jest of what I'm
This is my first question on stackoverflow, hopefully there is someone who can help
First question is, given a url to an mp4 video, how can I save

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.