aboutsummaryrefslogtreecommitdiff
path: root/src/content/components/top-content
diff options
context:
space:
mode:
authorShin'ya Ueoka <ueokande@i-beam.org>2018-07-13 22:36:56 +0900
committerShin'ya Ueoka <ueokande@i-beam.org>2018-07-13 22:36:56 +0900
commit944dea59199fa03f77e0e7c0d3c02acf8ccb458f (patch)
tree5f44471cdb32376a8c93e6f6eba738180f08c96f /src/content/components/top-content
parent77b4e807e2a8b3e7ddb5f042719a34962a31b1c4 (diff)
parent28bfa3ac8124d3453cd539db26da4f4703e783df (diff)
Merge remote-tracking branch 'origin/master' into greenkeeper/css-loader-1.0.0
Diffstat (limited to 'src/content/components/top-content')
-rw-r--r--src/content/components/top-content/index.js29
1 files changed, 0 insertions, 29 deletions
diff --git a/src/content/components/top-content/index.js b/src/content/components/top-content/index.js
index a0d0480..e22e957 100644
--- a/src/content/components/top-content/index.js
+++ b/src/content/components/top-content/index.js
@@ -2,16 +2,13 @@ import CommonComponent from '../common';
import FollowController from './follow-controller';
import FindComponent from './find';
import * as consoleFrames from '../../console-frames';
-import * as addonActions from '../../actions/addon';
import messages from 'shared/messages';
-import * as re from 'shared/utils/re';
export default class TopContent {
constructor(win, store) {
this.win = win;
this.store = store;
- this.prevBlacklist = undefined;
new CommonComponent(win, store); // eslint-disable-line no-new
new FollowController(win, store); // eslint-disable-line no-new
@@ -21,32 +18,6 @@ export default class TopContent {
consoleFrames.initialize(this.win.document);
messages.onMessage(this.onMessage.bind(this));
-
- this.store.subscribe(() => this.update());
- }
-
- update() {
- let blacklist = this.store.getState().setting.blacklist;
- if (JSON.stringify(this.prevBlacklist) !== JSON.stringify(blacklist)) {
- this.disableIfBlack(blacklist);
- this.prevBlacklist = blacklist;
- }
- }
-
- disableIfBlack(blacklist) {
- let loc = this.win.location;
- let partial = loc.host + loc.pathname;
- let matched = blacklist
- .map((item) => {
- let pattern = item.includes('/') ? item : item + '/*';
- return re.fromWildcard(pattern);
- })
- .some(regex => regex.test(partial));
- if (matched) {
- this.store.dispatch(addonActions.disable());
- } else {
- this.store.dispatch(addonActions.enable());
- }
}
onMessage(message) {