r4phf43l / livecall

LiveCall a Chat Plugin for GLPI
MIT License
1 stars 0 forks source link

The chat window launches #2

Closed Smiley-k closed 1 year ago

Smiley-k commented 1 year ago

HI

I configured livechat in Rocket.Chat placed the code, but the chat window is not active and there is no way to run.

image

r4phf43l commented 1 year ago

Hey! It seems to be a problem with your Rocket.Chat server. Can you post, from your browser's developer tools, the console error messages and network errors?

Smiley-k commented 1 year ago

Yes there is an error, but I can not figure out how to solve it, in the reverse proxy I added the parameter
_addheader X-Frame-Options SAMEORIGIN;

Loading "https://in.domain.com/livechat" in a frame is forbidden by the "X-Frame-Options" directive set in "sameorigin".

image

and

Uncaught ReferenceError: livechat is not defined at Object. (livecall.js?v=3ed4563e6f8360e1e8ac07a4202aa72a5c834cbd:1:444) at widget.js:502:4 at Array.forEach () at Module. (widget.js:501:7) at n (bootstrap:19:22) at bootstrap:83:10 at rocketchat-livechat.min.js:1:920

r4phf43l commented 1 year ago

@Smiley-k about "X-Frame-Options": you should adjust your server (https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Frame-Options).

About "Uncaught ReferenceError: livechat is not defined" can you post your script config?

Smiley-k commented 1 year ago

Dear @r4phf43l could you please tell me where I should and what parameter to use (I'm confused) I see a lot of similar problems with RC on the Internet on this subject

my script config


    (function(w, d, s, u) {
        w.RocketChat = function(c) { w.RocketChat._.push(c) }; w.RocketChat._ = []; w.RocketChat.url = u;
        var h = d.getElementsByTagName(s)[0], j = d.createElement(s);
        j.async = true; j.src = 'https://chat.domain.com/livechat/rocketchat-livechat.min.js';
        h.parentNode.insertBefore(j, h);
    })(window, document, 'script', 'https://chat.domain.com/livechat');

RocketChat( function() {
    this.registerGuest( {
        name: livechat('name'),
    } );
} );