Languages

Menu
Sites
Language
Block Internet Access by App/Process ID

I would like to change an app privilege on runtime. Suppose an application has internet access privilege. Now i want to change the privilege blocked so that this application can not use internet.

I am waiting for a response to find a way to block the privilege after application is installed. If there is no way. How can i approach to block interner access by process/app id.

Thank in advanced.

Edited by: Hissain Khan on 16 Jun, 2015

Responses

4 Replies
colin Rao

I think the privilege can't be removed/disabled at runtime. 

Marco Buettner

To make block internet actions you can maybe use localStorage.

Something like that?

var allowInternet = localStorage.getItem('allowInternet') || null;

if(allowInternet)
{
    //TODO: Do you internet stuff here
}
else
{
    //TODO: Do you non-internet stuff here
}

index.html

<input type="checkbox" id="allow-internet">Allow internet access</a>
var checkbox = document.querySelector('#allow-internet');

function changeInternetAccess() {
    var checked = this.checked;

    if(checked)
    {
        localStorage.setItem('allowInternet', "1");
    }
    else
    {
        localStorage.removeItem('allowInternet');
    }
}

checkbox.addEventListener('change', changeInternetAccess);

 

AVSukhov

Hello,

You cannot change app privileges on runtime due security reason.

Palitsyna

Hello,

As privileges are used to protect user privacy and system stability they can't be removed or modified at runtime.