var myradio=2;
document.addEventListener('DOMContentLoaded', function() {
hello();
document.getElementById('elem').addEventListener('click',function(){
clikclik();
});
document.getElementById('elemfavorite').addEventListener('click',function(){
clikclikelemfavorite();
});
document.getElementsByName('dzen')[0].addEventListener('change',function(){
favorites();
});
document.getElementsByName('dzen')[1].addEventListener('change',function(){
management();
});
document.getElementsByName('dzen')[2].addEventListener('change',function(){
hello();
myradio=2;
});
});
function clikclikelemfavorite(){
whritepromise();
chrome.runtime.sendMessage ({message: "clearfavorite"}, (response) => {
friends=response.message;
clearpromise();
});
}
function clikclik(){
whritepromise();
chrome.runtime.sendMessage ({message: "clear"}, (response) => {
friends=response.message;
clearpromise();
});
}
function whritepromise(){
const ttext3=document.getElementById('mytext3');
const ttext4=document.getElementById('mytext4');
ttext3.style.color='rgb(231, 226, 180)';
ttext4.style.color='rgb(231, 226, 180)';
ttext3.style.position="absolute";
ttext3.style.top="30%";
ttext4.style.position="absolute";
ttext4.style.top="35%";
ttext3.innerHTML='<p>Im just learning, but service_worker fell asleep. Using Wireshark, I checked the cookies are changing - the service_worker is dormant but does not respond to signals from the options_html/options_script.js.</p>';
ttext4.innerHTML='<p>It seems that I need to do it through promises, but this is in future updates. When you open the browser again, for a while, you can get a list of favorites and manage in the management. Thank you for understanding.</p>';
}
function management(){
if(myradio==2)
clearhello();
else
clearfavorites();
myradio=1;
let meneg= document.getElementById('elem');
meneg.style.display="block";
meneg.style.position="absolute";
meneg.style.top="20%";
meneg.value="Full clear without favorites";
let menegf= document.getElementById('elemfavorite');
menegf.style.display="block";
menegf.style.position="absolute";
menegf.style.top="25%";
menegf.value="Clear favorites";
}
function favorites(){
if(myradio==2)
clearhello();
else
clearmenegment();
myradio=0;
let friends=[];
let favf= document.getElementById('favor');
favf.style.overflow='scroll';
favf.style.height='400px';
favf.style.color='rgb(231, 226, 180)';
document.getElementById('favor').innerHTML='<li>Im just learning, but service_worker fell asleep. Using Wireshark, I checked the cookies are changing - the service_worker is dormant but does not respond to signals from the options_html/options_script.js.</li>';
document.getElementById('favor').innerHTML+='<li>It seems that I need to do it through promises, but this is in future updates. When you open the browser again, for a while, you can get a list of favorites and manage in the management. Thank you for understanding.</li>';
chrome.runtime.sendMessage ({message: "get"}, (response) => {
friends=response.message;
let favf= document.getElementById('favor');
favf.style.color='rgb(0, 0, 0)';
while (favf.firstChild) {
favf.removeChild(favf.lastChild);
}
if(friends.length>0){
friends.forEach(function(item, i, arr) {
item='https//'+item;
document.getElementById('favor').innerHTML += '<li>' + item + '</li>';
});
}
else{
document.getElementById('favor').innerHTML += '<li>' + "empty" + '</li>';
}
});
}
function hello(){
if(myradio==0)
clearfavorites();
else
clearmenegment();
myradio=2;
clearfavorites();
document.getElementById('mytext1').innerHTML='<p>After installation, remembers (does not send anywhere) visited sites. After three visits to the site, separated by closing and opening the browser, the extension begins to replace the cookies received from such a site with random values. Of course, cookies protected by httpOnly are not and cannot be replaced. Getting started on replacing cookies from the third launch of the browser allows you to login through the chrome password manager. The extension does not interfere with the .google.com domain. Basically, these cookies are screen parameters, technical records. All this is not very effective in the fight against digital eavesdroppers, just a little dirty trick due to the large computing power of todays computers, almost invisible to the user.</p>';
document.getElementById('mytext2').innerHTML='<p>The extension automatically changes cookies, you do not need to keep track of what you have been placed and why, with a new visit to the site, the site will receive random values, which will be very surprised. Sometimes you can be surprised yourself, a change in theme, language, and other delights. Also, some sites have cookies - counters, there is only one cookie file, the extension will make it random. "Count as much as you want" is our message. The very existence of this extension compromises any data collected by the cookie and any inferences from such data. For the first time, we have in our hands not a shield, but a sword.</p>';
document.getElementById('mytext3').innerHTML='<p>In the event that a site is no longer allowed, on the page of such a site, click on the left mouse button on the extension icon, you have placed the domain in your favorites and cookies for such a domain will not be attracted. Then, in chrome: //settings/siteData, clear the cookies of the site of interest, or in chrome://settings/clearBrowserData, delete all cookies and try to log in again. To clear and stop interfering with cookies for three launches of the browser, right-click on the extension icon and in the options on the Management tab, click Full clear without favorites. In Management, you can clear the entire list of favorite domains.</p>';
document.getElementById('mytext4').innerHTML='<p>For freedom!</p>';
}
function clearhello(){
let fff=document.getElementById('mytext1');
fff.innerHTML = "";
document.getElementById('mytext2').innerHTML = "";
document.getElementById('mytext3').innerHTML = "";
document.getElementById('mytext4').innerHTML = "";
}
function clearfavorites(){
let favf= document.getElementById('favor');
while (favf.firstChild) {
favf.removeChild(favf.lastChild);
}
favf.style.overflow='';
favf.style.height='0px';
}
function clearmenegment(){
let meneg= document.getElementById('elem');
meneg.style.display="none";
document.getElementById('elemfavorite').style.display="none";
}
function clearpromise(){
const fff=document.getElementById('mytext3');
fff.style.color='rgb(0, 0, 0)';
fff.style.position="absolute";
fff.style.top="26%";
fff.innerHTML = "";
document.getElementById('mytext4').style.color='rgb(0, 0, 0)';
document.getElementById('mytext4').innerHTML = "";
}