If you use native messaging, the native app must explicitly grant access to the add-on by listing the add-on’s ID in the “allowed_extensions” key in the app manifest.
“You should probably specify your add-on ID explicitly, using the applications
manifest key (This is because the app’s manifest will identify the set
of WebExtensions that are allowed to connect to it by listing their
IDs).”
https://developer.mozilla.org/en-US/Add-ons/WebExtensions/Native_messaging#Add-on_manifest