Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

120
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!