Azure / Communication

Azure Communication Services - SDKs and Release Notes
MIT License
320 stars 99 forks source link

Cannot instantiate CallClient in a Chrome Browser Extension #404

Closed deleolajide closed 2 years ago

deleolajide commented 3 years ago

Describe the bug When I run this code

    const tokenCredential = new ACS.AzureCommunicationTokenCredential(token);
    const callClient = new ACS.CallClient();

I get the following error:

image

A quick look at the JavaScript code reveals that it is checking for protocol "https:" and host name "localhost". Anything else is being flagged with this error.

To Reproduce Create a browser extension with Chrome or Edge and try and run similar code as above

Expected behavior I expect to run my ACS app in a browser extension just like a browser tab

Screenshots See above

Desktop (please complete the following information):

mariusu-msft commented 2 years ago

Thanks for your report @deleolajide.

We're looking at this and will reply soon.

deleolajide commented 2 years ago

Thanks for responding. I currently using a hack to move my code forward

if (this._disposed = !1, this.clientId = t, this.logger = e.createChild("CallStack"), this._telemetryLogManager = n, "https:" !== location.protocol && "chrome-extension:" !== location.protocol && "file:" !== location.protocol && "localhost" !== location.hostname) throw new m({
    message: "ACS Web Calling SDK must be used through https, file:, or localhost",
    code: l
});
akania commented 2 years ago

Hi @deleolajide , currently we're not supporting running ACS within Chrome ( or any other browser ) extension, can you please describe your use case ?

ghost commented 2 years ago

Hey @akania, this issue has been marked as needing attention. Please review the issue and remove the Needs: Attention label if this was done in error. Thank you!

deleolajide commented 2 years ago

Hi @akania :-)

can you please describe your use case ?

https://comitfs.github.io/openlink-v2.js/xep/xep-xxx-openlink_15-02.xml https://www.comitfs.com/communication/#apis

We are are currently implementing the CAS Openlink specification for MS Teams and in order for existing Financial applications that use CAS to work seamlessly with MS Teams, we need to install a resident application on the desktop with a simple and efficient deployment model. A web browser extension enables us to achieve that objective 👍

currently we're not supporting running ACS within Chrome ( or any other browser ) extension

I can confirm it works very nicely. It only needs you to remove the block. You are already supporting MSAL in browser extensions and WebRTC is proven in browser extensions. Most of the above specification is already implemented and working fine in both Edge and Chrome extensions using ACS endpoints with MS Teams identities.

ProbablePrime commented 2 years ago

This has been migrated to Azure Ideas: https://feedback.azure.com/d365community/idea/fd957221-1053-ec11-8f8e-000d3a987052