|
|
@ -1,9 +1,9 @@ |
|
|
|
import messages from 'content/messages'; |
|
|
|
import messages from 'content/messages'; |
|
|
|
import * as commandActions from 'actions/command'; |
|
|
|
|
|
|
|
import * as consoleActions from 'actions/console'; |
|
|
|
import * as consoleActions from 'actions/console'; |
|
|
|
import * as inputActions from 'actions/input'; |
|
|
|
import * as inputActions from 'actions/input'; |
|
|
|
import * as settingsActions from 'actions/setting'; |
|
|
|
import * as settingsActions from 'actions/setting'; |
|
|
|
import * as tabActions from 'actions/tab'; |
|
|
|
import * as tabActions from 'actions/tab'; |
|
|
|
|
|
|
|
import * as commands from 'shared/commands'; |
|
|
|
|
|
|
|
|
|
|
|
export default class BackgroundComponent { |
|
|
|
export default class BackgroundComponent { |
|
|
|
constructor(store) { |
|
|
|
constructor(store) { |
|
|
@ -12,7 +12,7 @@ export default class BackgroundComponent { |
|
|
|
|
|
|
|
|
|
|
|
browser.runtime.onMessage.addListener((message, sender) => { |
|
|
|
browser.runtime.onMessage.addListener((message, sender) => { |
|
|
|
try { |
|
|
|
try { |
|
|
|
this.onMessage(message, sender); |
|
|
|
return this.onMessage(message, sender); |
|
|
|
} catch (e) { |
|
|
|
} catch (e) { |
|
|
|
this.store.dispatch(consoleActions.showError(e.message), sender); |
|
|
|
this.store.dispatch(consoleActions.showError(e.message), sender); |
|
|
|
} |
|
|
|
} |
|
|
@ -47,11 +47,9 @@ export default class BackgroundComponent { |
|
|
|
return this.store.dispatch( |
|
|
|
return this.store.dispatch( |
|
|
|
consoleActions.hide(), sender); |
|
|
|
consoleActions.hide(), sender); |
|
|
|
case messages.CONSOLE_ENTERED: |
|
|
|
case messages.CONSOLE_ENTERED: |
|
|
|
return this.store.dispatch( |
|
|
|
return commands.exec(message.text, this.settings); |
|
|
|
commandActions.exec(message.text, this.settings), sender); |
|
|
|
case messages.CONSOLE_QUERY_COMPLETIONS: |
|
|
|
case messages.CONSOLE_CHANGEED: |
|
|
|
return commands.complete(message.text, this.settings); |
|
|
|
return this.store.dispatch( |
|
|
|
|
|
|
|
commandActions.complete(message.text, this.settings), sender); |
|
|
|
|
|
|
|
case messages.SETTINGS_RELOAD: |
|
|
|
case messages.SETTINGS_RELOAD: |
|
|
|
this.store.dispatch(settingsActions.load()); |
|
|
|
this.store.dispatch(settingsActions.load()); |
|
|
|
} |
|
|
|
} |
|
|
|