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 (https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/runtime/sendMessage and friends) or storage