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

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

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 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