feat: Adds async and defer attributes to chatwoot script tag (#2890)
Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com> Co-authored-by: Nithin David Thomas <1277421+nithindavid@users.noreply.github.com>
This commit is contained in:
parent
5853531d9a
commit
0a08e1ffc0
4 changed files with 7 additions and 0 deletions
|
@ -630,6 +630,7 @@ GEM
|
||||||
|
|
||||||
PLATFORMS
|
PLATFORMS
|
||||||
arm64-darwin-20
|
arm64-darwin-20
|
||||||
|
x86_64-darwin-20
|
||||||
x86_64-darwin-21
|
x86_64-darwin-21
|
||||||
x86_64-linux
|
x86_64-linux
|
||||||
|
|
||||||
|
|
|
@ -59,6 +59,8 @@ class Channel::WebWidget < ApplicationRecord
|
||||||
var BASE_URL=\"#{ENV.fetch('FRONTEND_URL', '')}\";
|
var BASE_URL=\"#{ENV.fetch('FRONTEND_URL', '')}\";
|
||||||
var g=d.createElement(t),s=d.getElementsByTagName(t)[0];
|
var g=d.createElement(t),s=d.getElementsByTagName(t)[0];
|
||||||
g.src=BASE_URL+\"/packs/js/sdk.js\";
|
g.src=BASE_URL+\"/packs/js/sdk.js\";
|
||||||
|
g.defer = true;
|
||||||
|
g.async = true;
|
||||||
s.parentNode.insertBefore(g,s);
|
s.parentNode.insertBefore(g,s);
|
||||||
g.onload=function(){
|
g.onload=function(){
|
||||||
window.chatwootSDK.run({
|
window.chatwootSDK.run({
|
||||||
|
|
|
@ -66,6 +66,8 @@
|
||||||
var BASE_URL="";
|
var BASE_URL="";
|
||||||
var g=d.createElement(t),s=d.getElementsByTagName(t)[0];
|
var g=d.createElement(t),s=d.getElementsByTagName(t)[0];
|
||||||
g.src=BASE_URL+"/packs/js/sdk.js";
|
g.src=BASE_URL+"/packs/js/sdk.js";
|
||||||
|
g.defer = true;
|
||||||
|
g.async = true;
|
||||||
s.parentNode.insertBefore(g,s);
|
s.parentNode.insertBefore(g,s);
|
||||||
s.async=!0;
|
s.async=!0;
|
||||||
g.onload=function(){
|
g.onload=function(){
|
||||||
|
|
|
@ -24,6 +24,8 @@ window.chatwootSettings = {
|
||||||
var BASE_URL = '';
|
var BASE_URL = '';
|
||||||
var g=d.createElement(t),s=d.getElementsByTagName(t)[0];
|
var g=d.createElement(t),s=d.getElementsByTagName(t)[0];
|
||||||
g.src= BASE_URL + "/packs/js/sdk.js";
|
g.src= BASE_URL + "/packs/js/sdk.js";
|
||||||
|
g.defer = true;
|
||||||
|
g.async = true;
|
||||||
s.parentNode.insertBefore(g,s);
|
s.parentNode.insertBefore(g,s);
|
||||||
g.onload=function(){
|
g.onload=function(){
|
||||||
window.chatwootSDK.run({
|
window.chatwootSDK.run({
|
||||||
|
|
Loading…
Reference in a new issue