Fix: various

This commit is contained in:
eight 2018-10-13 16:11:38 +08:00
parent 7e0eddeb8f
commit a4fc3e9162
3 changed files with 2 additions and 9 deletions

View File

@ -1,4 +1,4 @@
/* global detectSloppyRegexps download prefs openURL FIREFOX CHROME VIVALDI /* global download prefs openURL FIREFOX CHROME VIVALDI
openEditor debounce URLS ignoreChromeError queryTabs getTab openEditor debounce URLS ignoreChromeError queryTabs getTab
styleManager msg navigatorUtil iconUtil workerUtil */ styleManager msg navigatorUtil iconUtil workerUtil */
'use strict'; 'use strict';
@ -34,7 +34,6 @@ window.API_METHODS = Object.assign(window.API_METHODS || {}, {
}, },
getPrefs: prefs.getAll, getPrefs: prefs.getAll,
detectSloppyRegexps,
openEditor, openEditor,
updateIconBadge(count) { updateIconBadge(count) {

View File

@ -358,12 +358,6 @@ const styleManager = (() => {
.map(i => styles.get(i)) .map(i => styles.get(i))
); );
} }
// if (filter && filter.id) {
// if (!cache.sections[filter.id]) {
// return {};
// }
// return {[filter.id]: cache.sections[filter.id]};
// }
if (filter) { if (filter) {
const sections = !filter.id ? Object.values(cache.sections) : const sections = !filter.id ? Object.values(cache.sections) :
cache.sections[filter.id] ? [cache.sections[filter.id]] : cache.sections[filter.id] ? [cache.sections[filter.id]] :

View File

@ -58,7 +58,7 @@ const regExpTester = (() => {
const rxData = Object.assign({text}, cachedRegexps.get(text)); const rxData = Object.assign({text}, cachedRegexps.get(text));
if (!rxData.urls) { if (!rxData.urls) {
cachedRegexps.set(text, Object.assign(rxData, { cachedRegexps.set(text, Object.assign(rxData, {
// imitate buggy Stylish-for-chrome, see detectSloppyRegexps() // imitate buggy Stylish-for-chrome
rx: tryRegExp('^' + text + '$'), rx: tryRegExp('^' + text + '$'),
urls: new Map(), urls: new Map(),
})); }));