var st=1;
var wai=1;
var Pz=1;
var UpdatePade=1;
var waiUpdatePade=1;
var NUpdatePade;
var element, elements, index, strE, nS;
var Alls;
var var_input;
var Run_button;
var Refresh_button;
SUpdatePade();
Num();
Paus();
WPaus();
CreateButton();
var T_OBN=0;
if (document.readyState != "complete")T_OBN=1;
var T=0;
var T_Pz=Date.now();
setInterval(function() {
setTimeout (Tim, 100);
},100);
function Tim(){
if (T==0) {
setTimeout (Run, 100);
}}
function Run()
{
}
//EndRun()
function Stop()
{
chrome.runtime.sendMessage({greeting: "bye"}, function(response) {
console.log(response.farewell);});
st=500;
addNum();
Run_button.innerHTML = "Отключено";
Refresh_button.innerHTML = "--";
var_input.value = "Отключено";
throw new Error('Stop');
}
function Refresh()
{
chrome.runtime.sendMessage({greeting: "reflesh"}, function(response) {
console.log(response.farewell);});
location.reload();
}
function addNum()
{
chrome.runtime.sendMessage({NM: st}, function(response) {
var tst=response.farewell;});
}
function Num()
{
chrome.runtime.sendMessage({greeting: "var_num"}, function(response) {
st=response.farewell;});
}
function SUpdatePade()
{
chrome.runtime.sendMessage({greeting: "var_UP"}, function(response) {
UpdatePade=response.farewell;});
chrome.runtime.sendMessage({greeting: "var_UP1"}, function(response) {
waiUpdatePade=response.farewell;});
chrome.runtime.sendMessage({greeting: "var_UP2"}, function(response) {
NUpdatePade=response.farewell;});
}
function addUpdatePade()
{
chrome.runtime.sendMessage({UP: UpdatePade}, function(response) {
var tst=response.farewell;});
chrome.runtime.sendMessage({UP1: waiUpdatePade}, function(response) {
var tst=response.farewell;});
chrome.runtime.sendMessage({UP2: NUpdatePade}, function(response) {
var tst=response.farewell;});
}
function addPz()
{
chrome.runtime.sendMessage({Paze: Pz}, function(response) {
var tst=response.farewell;});
}
function Paus()
{
chrome.runtime.sendMessage({greeting: "var_Pz"}, function(response) {
Pz=response.farewell;});
}
function addWai()
{
chrome.runtime.sendMessage({Wi: wai}, function(response) {
var tst=response.farewell;});
}
function WPaus()
{
chrome.runtime.sendMessage({greeting: "var_Wai"}, function(response) {
wai=response.farewell;});
}
function Pause()
{
alert("Пауза");
}
function Copy()
{
let html = new XMLSerializer().serializeToString(document);

navigator.clipboard.writeText(html);
}
function CreateButton()
{
Refresh_button = document.createElement("Button");
Refresh_button.innerHTML = "Обновить";
Refresh_button.className = "RefreshClassName";
Refresh_button.style = "top:0px; left:0px; position:fixed; z-index: 999999; background-color:gray; color:white; font-size:16px";
Refresh_button.onclick = function(){ Refresh();};
document.body.appendChild(Refresh_button);
Run_button = document.createElement("Button");
Run_button.innerHTML = "Отключить";
Run_button.className = "RunButtonClassName";
Run_button.style = "top:0px; right:0px; position:fixed; z-index: 999999; background-color:gray; color:white; font-size:16px";
Run_button.onclick = function(){ Stop();};
document.body.appendChild(Run_button);
var Pause_button = document.createElement("Button");
Pause_button.innerHTML = "Пауза";
Pause_button.className = "PauseButtonClassName";
Pause_button.style = "top:30px; right:0px; position:fixed; z-index: 999999; background-color:gray; color:white; font-size:16px";
Pause_button.onclick = function(){ Pause();};
document.body.appendChild(Pause_button);
var Copy_button = document.createElement("Button");
Copy_button.innerHTML = "Копировать";
Copy_button.className = "CopyButtonClassName";
Copy_button.style = "top:60px; right:0px; position:fixed; z-index: 999999; background-color:gray; color:white; font-size:16px";
Copy_button.onclick = function(){ Copy();};
document.body.appendChild(Copy_button);
var_input = document.createElement("input");
var_input.type = "text";
var_input.className = "VarInputclassName";
var_input.style = "top:30px; left:0px; position:fixed; z-index: 999999; background-color:white; color:gray; font-size:16px";
document.body.appendChild(var_input);
}