I'm not sure I'm understanding your question correctly, but maybe this?

GitHub
GitHub - fiatjaf/window.nostr.js: drop-in <script> that adds seamless NIP-46 support to apps that rely on window.nostr
drop-in <script> that adds seamless NIP-46 support to apps that rely on window.nostr - fiatjaf/window.nostr.js