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';
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
// 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
// so we can do the same to the next one to open.

View File

@ -1,4 +1,3 @@
/* global cachedStyles: true */
'use strict';
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) {
if (url.indexOf('file:') == 0) {
return [];