blob: 48d0ce1326c6050d7bb23132589f9e2153e0e70d [file] [log] [blame]
Adrià Vilanova Martínezd7951b22024-05-25 22:13:32 +02001import {injectScript} from '../../../common/contentScriptsUtils';
Adrià Vilanova Martínez5f5b3e02023-07-23 00:08:17 +02002import 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}