Welcome to mirror list, hosted at ThFree Co, Russian Federation.

ClientControllerManager.js « Manager « js « src - github.com/marius-wieschollek/passwords-webextension.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 9bbeb8f8bce757c51c76a4cbc710a68689879b86 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import MessageService from '@js/Services/MessageService';
import FillPassword from '@js/Controller/Client/FillPassword';
import ErrorManager from '@js/Manager/ErrorManager';
import ShowFields from "@js/Controller/Client/Debug/ShowFields";

class ClientControllerManager {
    init() {
        this._initClientControllers();
    }

    _initClientControllers() {
        MessageService.listen(
            'autofill.password',
            async (message, reply) => {
                try {
                    let controller = new FillPassword();
                    await controller.execute(message, reply);
                } catch(e) {
                    ErrorManager.logError(e, {message, reply});
                }
            }
        );
        MessageService.listen(
            'debug.form.fields',
            async (message, reply) => {
                try {
                    let controller = new ShowFields();
                    await controller.execute(message, reply);
                } catch(e) {
                    ErrorManager.logError(e, {message, reply});
                }
            }
        );
    }
}

export default new ClientControllerManager();