var st=1;

var Pz=1;

var wai=1;

var UpdatePade=1;

var waiUpdatePade=1;

var NUpdatePade;

var S;

chrome.runtime.onMessage.addListener(

function(request, sender, sendResponse) {

console.log(sender.tab ?

"from a content script:" + sender.tab.url :

"from the extension");

S=0;

  if (request.greeting == "reflesh")

  {

  st=1;

  Pz=1;

  wai=1;

  UpdatePade=1;

  waiUpdatePade=1;

    chrome.runtime.reload();

  sendResponse({farewell: "yes"});

S=1;

  }

  if (request.greeting == "bye")

  {

chrome.management.uninstallSelf();

sendResponse({farewell: "yes"});

S=1;

  }

  if (request.greeting == "var_num")

  {

sendResponse({farewell: st});

S=1;

  }

  if (request.greeting == "var_UP")

  {

sendResponse({farewell: UpdatePade});

S=1;

  }

  if (request.greeting == "var_UP1")

  {

sendResponse({farewell: waiUpdatePade});

S=1;

  }  

  if (request.greeting == "var_UP2")

  {

sendResponse({farewell: NUpdatePade});

S=1;

  }

  if (request.greeting == "var_Pz")

  {

sendResponse({farewell: Pz});

S=1;

  }

  if (request.greeting == "var_Wai")

  {

sendResponse({farewell: wai});

S=1;

  }

if (S==0)

{

if (request.NM)

{

st=request.NM;

}

if (request.UP)

{

UpdatePade=request.UP;

}

if (request.UP1)

{

waiUpdatePade=request.UP1;

}

if (request.UP2)

{

NUpdatePade=request.UP2;

}

if (request.Paze)

{

Pz=request.Paze;

}

if (request.Wai)

{

wai=request.Wai;

}

S=1;

}

});

