Global variable in webextension

is it possible to create a variable in a file (js or other) and use it in content scripts and background scripts ?
thank you for your support.

In the APIs available in a content script there are two that can solve situations where you want to share data:

Messaging ( and friends) or storage