mirror of
https://github.com/anticensority/runet-censorship-bypass.git
synced 2024-11-13 13:06:34 +03:00
22 lines
845 B
JavaScript
Executable File
22 lines
845 B
JavaScript
Executable File
chrome.runtime.getBackgroundPage(
|
|
background => {
|
|
var RKN = background.RKN;
|
|
|
|
var switchButton = document.querySelector('#switch-button');
|
|
var switchText = document.querySelector('#switch-button-text');
|
|
var updateButton = document.querySelector('#update-button');
|
|
var updateText = document.querySelector('#update-button-text');
|
|
|
|
var renderSwitchButton = () => switchText.innerText = RKN.ifEnabled ? 'Отключить' : 'Включить';
|
|
renderSwitchButton();
|
|
switchButton.onclick = () => {
|
|
switchText.innerText = 'Ждите...';
|
|
RKN.switch( renderSwitchButton );
|
|
};
|
|
updateButton.onclick = () => {
|
|
updateText.innerText = 'Ждите...';
|
|
RKN.checkForUpdates( () => {updateText.innerText = new Date(RKN.lastUpdate).toLocaleTimeString() } );
|
|
};
|
|
}
|
|
);
|