blob: b976b244d333106a355072ca93d6a8ec012a8bcd [file] [log] [blame]
Adrià Vilanova Martínez5f5b3e02023-07-23 00:08:17 +02001import {injectScript} from '../../../common/contentScriptsUtils.js';
2import MWI18nServer from '../../../common/mainWorldI18n/Server.js';
3
4import UpdateBanner from './banner/index.js';
5
6export default class UpdateHandler {
7 constructor() {
Adrià Vilanova Martínez1af4c042024-05-18 20:51:06 +02008 // The extension was just updated, so we need to start everything from
9 // scratch.
Adrià Vilanova Martínez5f5b3e02023-07-23 00:08:17 +020010 new MWI18nServer();
11 injectScript(chrome.runtime.getURL('updateHandlerLitComponents.bundle.js'));
12 this.updateBanner = new UpdateBanner();
13 }
14
15 handle(reason) {
16 console.debug(`Handling extension update (reason: ${reason}).`);
17 this.updateBanner.addBanner(reason);
18 }
19}