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

121
Visualizações
stop chrome extension if identity check fails

I am trying to implement an identity check for my chrome extension since I want to sell it to some users. The code below is usig the chrome.identity API to get the unique OpenID in combination with the email that is logged in. Then it is fetching data from a pastebin and checks if the id is included or not. If not I would want to block the user from using the extension. What would be the best approach?

My code:

// license check
chrome.identity.getProfileUserInfo({ 'accountStatus': 'ANY' }, async function (info) {
    email = info.email;
    console.log(info.id);

    let response = await fetch('https://pastebin.com/*****');
    let data = await response.text();

    console.log(data.indexOf(info.id));

    if (data.indexOf(info.id) !== -1) {
        console.log('included');
    } else {
        console.log('not included');
        // block chrome extension usage;
    }
});
about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

I found a pretty simple solution that should work for most cases.

// license check
chrome.identity.getProfileUserInfo({ 'accountStatus': 'ANY' }, async function (info) {
    email = info.email;
    console.log(info.id);

    let response = await fetch('https://pastebin.com/*****');
    let data = await response.text();

    console.log(data.indexOf(info.id));

    if (data.indexOf(info.id) !== -1) {
        console.log('included');
    } else {
        console.log('not included');
        // block chrome extension usage;
        chrome.browserAction.setPopup({ popup: 'index.html' }); // index.html has to 
                                                                   be in the 
                                                                   extension folder and can have e. g. a <h1> which says "Invalid license"

    }
});
about 4 years ago · Juan Pablo Isaza Relatório
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