user2650277
user2650277

Reputation: 6749

Detect if my extension is in control of proxy settings

My extension takes control of a user proxy settings.However if the user has recently install another proxy/vpn extension then that extension has control of the user proxy settings instead of mine.

In case my extension don't have priority i will then send a message to the user

How can i detect if my extension is in control of proxy settings

Upvotes: 1

Views: 2307

Answers (1)

Haibara Ai
Haibara Ai

Reputation: 10897

Take a look at chrome.proxy.settings, you could call chrome.proxy.settings.get(object details, function callback) to get the chrome browser setting info, and the parameter for the callback is object details, you could check details.levelOfControl, its values is

enum of "not_controllable", "controlled_by_other_extensions", "controllable_by_this_extension", or "controlled_by_this_extension"

chrome.proxy.settings.get(function(details) {
    if(details.levelOfControl === 'controlled_by_other_extensions') {
        // 
    }
});

Upvotes: 2

Related Questions