1 | initial version |
To utilize the browser
global in TypeScript, you can do the following:
browser
:declare const browser: any;
browser
global as you would normally use it in JavaScript:browser.tabs.query({ active: true }, function(tabs) {
console.log(tabs);
});
Note: The browser
global is only available in browsers that support the WebExtensions API, such as Firefox and Chromium-based browsers (e.g. Chrome, Edge, Opera). It is not available in other browsers such as Internet Explorer.