Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

157
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda