Adrià Vilanova Martínez | 5f5b3e0 | 2023-07-23 00:08:17 +0200 | [diff] [blame] | 1 | import {injectScript} from '../../../common/contentScriptsUtils.js'; |
| 2 | import MWI18nServer from '../../../common/mainWorldI18n/Server.js'; |
| 3 | |
| 4 | import UpdateBanner from './banner/index.js'; |
| 5 | |
| 6 | export default class UpdateHandler { |
| 7 | constructor() { |
Adrià Vilanova Martínez | 1af4c04 | 2024-05-18 20:51:06 +0200 | [diff] [blame] | 8 | // The extension was just updated, so we need to start everything from |
| 9 | // scratch. |
Adrià Vilanova Martínez | 5f5b3e0 | 2023-07-23 00:08:17 +0200 | [diff] [blame] | 10 | 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 | } |