Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

180
Visualizações
In JavaScript, what are the frequently used parameters "info" & "tab"?

While developing a Chrome extension and reading through the documentation found at https://developer.chrome.com/docs/extensions, I have seen the following syntax used and have been unable to find an explanation as to what the "info" or "tab" parameters(?) are for quite some time;

chrome.contextMenus.onClicked.addListener((info, tab) => {

"Info" and "tab" are then used like the below in various ways like they were a parent object or an interface;

var EncodedSelectedText = encodeURIComponent(info.selectionText).toString();

or

chrome.tabs.create({
    url: 'https://example.com/path?fragment'+EncodedSelectedText, index: tab.index + 1
});

They are not part of an interface, per the list of interfaces found on MDN here: https://developer.mozilla.org/en-US/docs/Web/API#interfaces (Unless I am missing something?)

This must have a simple explanation that I have been unable to find. Please, if someone could provide a link to the documentation about this on MDN or some other authoritative resource, it would be so very helpful.

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda