当我从https://github.com/smooch/smooch-web/调用代码时遇到以下问题
smooch.4.5.4.min.js:5 Failed to execute 'postMessage' on 'DOMWindow': The target origin provided ('file://') does not match the recipient window's origin ('null').
此外,下面的代码是我遇到这个问题的方式。
<!DOCTYPE html>
<html>
<head>
<link href='https://fonts.googleapis.com/css?family=Open+Sans' rel='stylesheet' type='text/css'>
<!-- Trecho 1: adicionar antes do fim do head -->
<script>
! function(e, n, t, r) {
function o() {
try {
var e;
if ((e = "string" == typeof this.response ? JSON.parse(this.response) : this.response).url) {
var t = n.getElementsByTagName("script")[0],
r = n.createElement("script");
r.async = !0, r.src = e.url, t.parentNode.insertBefore(r, t)
}
} catch (e) {}
}
var s, p, a, i = [],
c = [];
e[t] = {
init: function() {
s = arguments;
var e = {
then: function(n) {
return c.push({
type: "t",
next: n
}), e
},
catch: function(n) {
return c.push({
type: "c",
next: n
}), e
}
};
return e
},
on: function() {
i.push(arguments)
},
render: function() {
p = arguments
},
destroy: function() {
a = arguments
}
}, e.__onWebMessengerHostReady__ = function(n) {
if (delete e.__onWebMessengerHostReady__, e[t] = n, s)
for (var r = n.init.apply(n, s), o = 0; o < c.length; o++) {
var u = c[o];
r = "t" === u.type ? r.then(u.next) : r.catch(u.next)
}
p && n.render.apply(n, p), a && n.destroy.apply(n, a);
for (o = 0; o < i.length; o++) n.on.apply(n, i[o])
};
var u = new XMLHttpRequest;
u.addEventListener("load", o), u.open("GET", "https://" + r + ".webloader.smooch.io/", !0), u.responseType = "json", u.send()
}(window, document, "Smooch", "<APP_ID>");
</script>
</head>
<body>
<div class="main-content">
<h1>
Página Teste
</h1>
</div>
<script>
Smooch.init({
appId: '<APP_ID>'}).then(function() {
// Your code after init is complete
});
</script>
</body>
当我从 slack 或电报中键入消息时,消息会到达网络信使。但是,当我从网络信使键入消息时,它不会转到电报和松弛。
我有三个集成:电报、松弛和网络信使。
你能帮忙解决这个问题吗?