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

130
Visualizações
Move Firefox add-on icon to the open a new tab position

I created a Firefox add-on called New Tab Plus:

https://addons.mozilla.org/en-US/firefox/addon/newtabplus/

Currently the [+] icon is located at the very right portion of the tabstrip. I would like the [+] icon to be in the same position as the default Firefox "open a new tab" position, it's located next to the last tab. Is there any way do this?

manifest.json

{
    "manifest_version": 2,
    "name": "New Tab Plus",
    "version": "1.0",
    "description": "Adds a [+] icon which opens a new tab to a specified URL.",

    "icons": {
        "48": "page-48.svg"
    },

    "developer": {
        "name": "Andy Bajka"
    },  

    "background": {
        "scripts": ["background.js"]
    },

    "browser_action": {
        "default_icon": {
          "48": "page-48.svg"
        },
        "default_area": "tabstrip"
    },

    "permissions": [
        "storage",
        "tabs"
    ],

    "options_ui": {
        "page": "options.html"
    },

    "browser_specific_settings": {
        "gecko": {
            "id": "bcd339e2-fee5-40fd-8acd-2021a8815b95@bajka.com",
            "strict_min_version": "102.0"
        }
    }
}

background.js

function openPage() {
    browser.storage.local.get(['preferred_URL'], function(result) {
        console.log(result);
        browser.tabs.create({
            "url": result.preferred_URL
        })
    });
}

function onGot(item) {
    let preference_url = "https://www.google.com/";
    if (item.preference_url) {
        preference_url = item.preference_url;
    }
    browser.storage.local.set({ "preferred_URL" : preference_url });
}

function onError(error) {
    console.log(`Error: ${error}`);
}

browser.browserAction.onClicked.addListener(openPage);

console.log(browser.browserAction.onClicked.addListener);

let getting = browser.storage.sync.get("preference_url");
getting.then(onGot, onError);

How can I get the icon ID? Perhaps with the icon ID I could use CSS or other code to move it.

about 4 years ago · Santiago Trujillo
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