blob: b1b8286070cfc0e36d5f89983dfce56af115c115 [file] [log] [blame]
Adrià Vilanova Martínezc14e44a2023-03-09 19:28:03 +01001import MainWorldContentScriptBridgeClient from '../mainWorldContentScriptBridge/Client.js';
2
3import {kCSTarget, kMWTarget} from './consts.js';
4
5// Main World i18n client (used in scripts injected into the Main World (MW) to
6// use the chrome.i18n API).
7export default class MWI18nClient extends MainWorldContentScriptBridgeClient {
8 constructor(timeout) {
9 super(kCSTarget, kMWTarget, timeout);
10 }
11
12 async getMessage(messageName, substitutions, options) {
13 return this._sendRequest(
14 'getMessage', {messageName, substitutions, options});
15 }
16
17 async getUILanguage() {
18 return this._sendRequest('getUILanguage', {});
19 }
20}