Исправил появление кнопок при перезагрузке

This commit is contained in:
2020-04-14 19:24:54 +03:00
parent 5b94ca4eec
commit 928984c158
6 changed files with 166 additions and 162 deletions

View File

@@ -1,15 +1,14 @@
chrome.runtime.onInstalled.addListener(function() {
chrome.storage.sync.set({isExtensionOn: true}, function() {
console.log('isExtensionOn: '+true);
});
chrome.runtime.onInstalled.addListener(function () {
chrome.storage.sync.set({ isExtensionOn: true }, function () {
console.log('isExtensionOn: ' + true);
});
chrome.declarativeContent.onPageChanged.removeRules(undefined, function() {
chrome.declarativeContent.onPageChanged.addRules([{
conditions: [new chrome.declarativeContent.PageStateMatcher({
pageUrl: {hostEquals: 'vk.com'},
})
],
actions: [new chrome.declarativeContent.ShowPageAction()]
}]);
});
chrome.declarativeContent.onPageChanged.removeRules(undefined, function () {
chrome.declarativeContent.onPageChanged.addRules([{
conditions: [new chrome.declarativeContent.PageStateMatcher({
pageUrl: { hostEquals: 'vk.com' },
})],
actions: [new chrome.declarativeContent.ShowPageAction()]
}]);
});
});