runet-censorship-bypass/extensions/chromium/minimalistic-pac-setter/proxy.js

30 lines
568 B
JavaScript
Raw Normal View History

2015-12-07 13:53:47 +03:00
'use strict';
function blockInform(details) {
if (details.tabId !== -1 && details.ip === antizapret.proxyIp) {
chrome.pageAction.setIcon({
2015-12-07 15:05:24 +03:00
path: '/icons/rkn-empty.png',
2015-12-07 13:53:47 +03:00
tabId: details.tabId
});
chrome.pageAction.setTitle({
title: 'Сайт блокирован!',
tabId: details.tabId
});
chrome.pageAction.show(details.tabId);
}
}
chrome.webRequest.onCompleted.addListener(
blockInform,
{ urls: ['<all_urls>'] }
);
chrome.webRequest.onErrorOccurred.addListener(
blockInform,
{ urls: ['<all_urls>'] }
);