Does instagram embedded feed allow users to comment Inline instead of redirect to instagram?
And is it possible to load more by scrolling down instead of clicking load more button?
Does instagram embedded feed allow users to comment Inline instead of redirect to instagram?
And is it possible to load more by scrolling down instead of clicking load more button?
Hi User147, and welcome to the Forum. Instagram’s a great program and I think the Staff thrives on questions like this. Hang in there. The Staff will be with you as soon as they get back from their weekend break.
Hi there @user147 and welcome aboard
I am really sorry, but there is no way to comment posts right from the widget. We see that it would be a great feature and I’ve added your idea to the Wishlist. You can keep an eye on it here - Comment posts right from the widget
As for the loading posts on scroll, I’ll check it with our dev team and let you know if it’s feasible
Thank you for waiting @user147
Our devs came up with a custom solution for your use case:
<script>
let target;
let view;
let elements;
const viewObserver = new MutationObserver(mutations => {
elements = mutations[mutations.length - 1].addedNodes;
observer.observe(elements[elements.length - 1]);
});
const mutation = new MutationObserver((mutations) => {
mutations.forEach(mutation => {
mutation.addedNodes.forEach((node) => {
viewObserver.observe(node, {childList: true});
})
});
});
let handleIntersection = function (entries) {
for (let entry of entries) {
if (entry.isIntersecting) {
document.querySelector(".eapps-instagram-feed-posts-grid-load-more-text-visible")?.click();
observer.unobserve(elements[elements.length - 1]);
}
}
}
const observer = new IntersectionObserver(handleIntersection);
const waitForElement = (selector, root = document) => new Promise(res => {
let i = 0;
const check = () => {
const component = root.querySelector(selector);
if (component) {
res(component);
} else if (i !== 50) {
setTimeout(check, 100);
i++;
}
};
check();
});
waitForElement(".eapps-instagram-feed-posts-inner")
.then(_ => {
target = document.querySelector('.eapps-instagram-feed-posts-inner');
view = document.querySelectorAll('.eapps-instagram-feed-posts-view');
elements = view[view.length - 1].querySelectorAll('.eapps-instagram-feed-posts-item');
mutation.observe(target, {childList: true});
observer.observe(elements[elements.length - 1]);
});
</script>
Please add this code right after the widget’s installation code on your website and let me know how it worked