inline reportError()

This commit is contained in:
tophf 2017-04-19 19:22:13 +03:00
parent 4fd1a3db62
commit 3a8ac2d9dc
2 changed files with 5 additions and 12 deletions

View File

@ -1,4 +1,4 @@
/* global getDatabase, getStyles, saveStyle, reportError */ /* global getDatabase, getStyles, saveStyle */
'use strict'; 'use strict';
chrome.webNavigation.onBeforeNavigate.addListener(data => { chrome.webNavigation.onBeforeNavigate.addListener(data => {
@ -161,7 +161,10 @@ Object.keys(contextMenus).forEach(id => {
// Get the DB so that any first run actions will be performed immediately // Get the DB so that any first run actions will be performed immediately
// when the background page loads. // when the background page loads.
getDatabase(function() {}, reportError); getDatabase(() => {}, (...args) => {
args.forEach(arg => 'message' in arg && console.error(arg.message));
});
// When an edit page gets attached or detached, remember its state // When an edit page gets attached or detached, remember its state
// so we can do the same to the next one to open. // so we can do the same to the next one to open.

View File

@ -1,4 +1,3 @@
/* global cachedStyles: true */
'use strict'; 'use strict';
const RX_NAMESPACE = new RegExp([/[\s\r\n]*/, const RX_NAMESPACE = new RegExp([/[\s\r\n]*/,
@ -496,15 +495,6 @@ function cleanupCachedFilters({force = false} = {}) {
} }
function reportError(...args) {
for (const arg of args) {
if ('message' in arg) {
console.log(arg.message);
}
}
}
function getDomains(url) { function getDomains(url) {
if (url.indexOf('file:') == 0) { if (url.indexOf('file:') == 0) {
return []; return [];