Use TSyringe on background script
This commit is contained in:
parent
c7803e7c29
commit
cdfd54ed99
37 changed files with 212 additions and 202 deletions
|
@ -1,3 +1,6 @@
|
|||
import { injectable } from 'tsyringe';
|
||||
|
||||
@injectable()
|
||||
export default class IndicatorPresenter {
|
||||
indicate(enabled: boolean): Promise<void> {
|
||||
let path = enabled
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
import { injectable } from 'tsyringe';
|
||||
|
||||
const NOTIFICATION_ID = 'vimvixen-update';
|
||||
|
||||
@injectable()
|
||||
export default class NotifyPresenter {
|
||||
async notify(
|
||||
title: string,
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
import { injectable } from 'tsyringe';
|
||||
import MemoryStorage from '../infrastructures/MemoryStorage';
|
||||
|
||||
const CURRENT_SELECTED_KEY = 'tabs.current.selected';
|
||||
|
@ -5,6 +6,7 @@ const LAST_SELECTED_KEY = 'tabs.last.selected';
|
|||
|
||||
type Tab = browser.tabs.Tab;
|
||||
|
||||
@injectable()
|
||||
export default class TabPresenter {
|
||||
open(url: string, tabId?: number): Promise<Tab> {
|
||||
return browser.tabs.update(tabId, { url });
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
import { injectable } from 'tsyringe';
|
||||
|
||||
@injectable()
|
||||
export default class WindowPresenter {
|
||||
create(url: string): Promise<browser.windows.Window> {
|
||||
return browser.windows.create({ url });
|
||||
|
|
Reference in a new issue