mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-06-02 07:26:45 +00:00
Add parent checking before inserting or removing the child
This commit is contained in:
@@ -116,7 +116,11 @@ class MessengerCustomerChat extends Component {
|
||||
js = d.createElement(s);
|
||||
js.id = id;
|
||||
js.src = `https://connect.facebook.net/${language}/sdk/xfbml.customerchat.js`;
|
||||
fjs.parentNode.insertBefore(js, fjs);
|
||||
if (fjs && fjs.parentNode && fjs.parentNode.contains(fjs)) {
|
||||
fjs.parentNode.insertBefore(js, fjs);
|
||||
} else {
|
||||
document.body.appendChild(js);
|
||||
}
|
||||
})(document, 'script', 'facebook-jssdk');
|
||||
/* eslint-enable */
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user