'Cannot find name 'browser' error in typescript when trying to add onMessageExternal method for Firefox Extension

Cannot find name 'browser' error in typescript when trying to add onMessageExternal method for Firefox Extension

enter image description here

enter image description here



Solution 1:[1]

i had the same problem before but

adding /*global browser*/ at top of the file will resolve your problem also if you get the same error for runtime you can do the same for that

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 scripty dude