crisp-im / crisp-sdk-web

:package: Include the Crisp chat widget from using frameworks such as React, VueJS, Angular...
https://www.npmjs.com/package/crisp-sdk-web
MIT License
39 stars 13 forks source link

The safe mode does not seem to be available in the library #1

Closed GitHubish closed 1 year ago

GitHubish commented 2 years ago

When we receive in the console the warning message asking us to activate the "safe mode" I see that it is not possible to do it from the exposed methods of the SDK. Shouldn't it be possible to activate it directly in the configure method?

You can disable this warning by adding: $crisp.push(["safe", true]) to your page JavaScript.

noghartt commented 1 year ago

The lib injects the $crisp object on window too, so you can do:

window.$crisp.push('safe', true);

I made a PR where I'm adding the method to handle it. See here.

jashok2 commented 1 year ago

i got a mirror in vue3

index.ts:173 Refused to load the script 'https://client.crisp.chat/l.js' because it violates the following Content Security Policy directive: "script-src 'self' 'unsafe-inline'". Note that 'script-src-elem' was not explicitly set, so 'script-src' is used as a fallback.

what should i do?

baptistejamin commented 1 year ago

@jashok2 Your issue is absolutely not related. You should just edit your CSP policy as stated in the error message. Please check https://docs.crisp.chat/guides/others/whitelisting-our-systems/crisp-domain-names/

baptistejamin commented 1 year ago

Safe mode is not available : https://docs.crisp.chat/guides/chatbox-sdks/web-sdk/npm/#configuration