Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

154
Views
local queue on YouTube

This might be a little bit of a weird question but I'm trying to make an extension that updates the youtube queue when you add a video from another window. I was thinking of just remaking the queue for youtube (I know that this would be a large task). How would I manually add a video to this queue?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

There are two main problems that need to be solved to add a this feature.

  1. Storing and synchronizing the queue.
  2. Knowing when a user adds or removes a video in the queue.

Both Firefox and chrome provide extension storage for this purpose and this should solve the first problem.
https://developer.chrome.com/docs/extensions/reference/storage/
https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/storage

For the second problem you need to write a content script that will either add your own button to YouTube or override the original add to watch queue button functionality. So that when clicked the url of the video will be added to extension storage.

You could then display the queue in the extension popup and when a video is played a message can be sent to the active window changing the location to the new video like so.

// popup.js
chrome.storage.sync.get(['queue'], (result) => {
    const firstInQueue = result.queue.shift();
    chrome.tabs.query({active: true, currentWindow: true}, function(tabs) {
        chrome.tabs.sendMessage(tabs[0].id, {video: firstInQueue}, function(response) {
           chrome.storage.sync.set({queue: result.queue}, () => {
              console.log(`${result.queue.length} videos in queue`);
           });
        });
    });
});


// content.js
chrome.runtime.onMessage.addListener((request, sender, sendResponse) => {
    document.location.href = request.video;
});

Overriding functionality on an existing site can be difficult and short-lived as if YouTube chooses to update its UI it may break you feature.

Looking at the network tab when adding a video to the queue reveals that a post request is made to https://www.youtube.com/youtubei/v1/playlist/create this may be another area to look.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!