1

Do you know why this script is detected as document.write() on Lighthouse?

And is it possible to use DOM Manipulation or any alternative ways to solve this problem?

<script src="https://MyDisqusID.disqus.com/recent_comments_widget.js?num_items=4&hide_avatars=0&avatar_size=32&excerpt_length=200"></script>

2 Answers 2

2

recent_comments_widget.js is no longer supported by Disqus but as a workaround you can use the public API to get recent comments https://disqus.com/api/docs/posts/list/ using any time parameters you prefer, then display the comment data into your document using plain JavaScript.

1
  • Better to say it's not maintained? It still works.
    – i0rg
    Jan 10, 2023 at 18:41
0

When I searched on this to get the recent comments displaying, I found an example that works. Not relevant to your issue, but it's related somehow. From which I can say that Disqus still supports this.

<script type="text/javascript" src="https://gregorys-blog.disqus.com/recent_comments_widget.js?num_items=10&hide_avatars=0&avatar_size=40&excerpt_length=100"></script>

Just replace gregorys-blog with your own Disqus site.

More reference at: https://www.gregoryalexander.com/blog/2019/10/7/Building-your-own-Disqus-Recent-Comments-Widget

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.