Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

<link ... in Head Tag Not Cleaned #108

Closed
renomureza opened this issue Aug 2, 2021 · 10 comments · Fixed by #111
Closed

<link ... in Head Tag Not Cleaned #108

renomureza opened this issue Aug 2, 2021 · 10 comments · Fixed by #111
Labels
bug Something isn't working

Comments

@renomureza
Copy link

renomureza commented Aug 2, 2021

I'm using Nextjs,

When I navigate from a page with no comments to a page with comments repeatedly, Disqus keeps inserting the <link... tag in .

image

@renomureza renomureza changed the title <link ... Head Tag Not Cleaned <link ... in Head Tag Not Cleaned Aug 2, 2021
@tterb tterb added the bug Something isn't working label Aug 3, 2021
@tterb
Copy link
Contributor

tterb commented Aug 3, 2021

@renomureza Thanks for reporting this issue. It looks like there might be an issue with the cleanup process.
Do you have a public repo that I can use to reproduce this issue?

@renomureza
Copy link
Author

@tterb
Copy link
Contributor

tterb commented Aug 13, 2021

@renomureza I just put up a PR(#111) to fix this issue. It would be great if you could pull the branch and make sure that it resolves your problem before merging.

@renomureza
Copy link
Author

@renomureza I just put up a PR(#111) to fix this issue. It would be great if you could pull the branch and make sure that it resolves your problem before merging.

@tterb It works fine, in <header> it's clean.

But, I noticed at the end of the tag there is an <iframe> which has the same behavior, not cleaned.

image

@tterb
Copy link
Contributor

tterb commented Aug 23, 2021

@renomureza Nice catch!
I've updated the PR to also remove the referenced iframe.

@renomureza
Copy link
Author

@tterb Yes it works, everything is as expected. 🥳

Waiting for release.

@tterb
Copy link
Contributor

tterb commented Aug 24, 2021

@renomureza Thanks for your help!
I'll try to get a new version of the package published to NPM later today.

@brokul-dev
Copy link

Hi!
I've updated disqus-react package to the newest version. Scripts from head and Disqus iframe are removed but there is still one iframe that is not deleted. Here is the result after few roundtrips:

image

Worth noticing that these iframes do not have title attributes. This attribute is currently used as a query selector in the cleanup code.

Perhaps it's a problem on my side? 🙂

@renomureza
Copy link
Author

@brokul-dev i had the same problem, @tterb

@tterb
Copy link
Contributor

tterb commented Aug 30, 2021

@renomureza @brokul-dev Unfortunately, due to the lack of attributes on that iframe there isn't really a way of targeting them for removal that wouldn't cause unintended consequences for any other iframes on the page.

This was referenced Sep 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants