Skip to content

Instantly share code, notes, and snippets.

@gorhill
Last active February 16, 2023 21:17
Show Gist options
  • Star 26 You must be signed in to star a gist
  • Fork 4 You must be signed in to fork a gist
  • Save gorhill/ef1b62d606473c68d524 to your computer and use it in GitHub Desktop.
Save gorhill/ef1b62d606473c68d524 to your computer and use it in GitHub Desktop.
Disqus comments widget: on-demand
! Title: Disqus click-to-load
# Copy-paste the static filters below into your "My filters" pane in the
# dashboard.
# Purpose is to load Disqus comments on demand only, so that no connection
# to `disqus.com` occurs by default when you land on a site which uses
# Disqus comments widget.
# Not connecting to Disqus by default is a good thing for such a
# ubiquitous server as `disqus.com`, which can be used to build a
# profile of your browsing habits, even if you have no account with
# Disqus. This also helps web pages containing the Disqus widget to
# load faster.
# These filters will cause a button labeled:
# "Disqus blocked by uBlock Origin: click to unblock" to be embedded
# where Disqus comments would normally be loaded. Click the button
# to force the comments to be loaded.
# Be sure your filter lists are up to date, new resources have been
# added today to make these filters work.
||disqus.com/forums/*/embed.js$script,redirect=disqus.com/forums/*/embed.js
||disqus.com/embed.js$script,redirect=disqus.com/embed.js
||disqus.com/count.js$script
@@||disqus.com/embed.js?_=1457540*$script
@gorhill
Copy link
Author

gorhill commented Mar 9, 2016

a

@gorhill
Copy link
Author

gorhill commented Mar 9, 2016

You can also simply use the URL to the raw version of the current Gist as an external filter list:
https://gist.github.com/gorhill/ef1b62d606473c68d524/raw/90edb7864ee40d49c8f29ad4f2f1aded08e60c6c/gistfile1.txt

a

@collinbarrett
Copy link

I've been using this gist as an external subscription for a few weeks, and it works really well. I love having Disqus blocked by default. Is the plan to roll this into one of the other primary lists? Maybe it already has been and I missed it?

@gorhill
Copy link
Author

gorhill commented Apr 28, 2016

Is the plan to roll this into one of the other primary lists?

That would be the ideal, but I want to think long and hard about how this could be best implemented.

@gitarra
Copy link

gitarra commented Aug 28, 2016

This does not work on the Ubuntu MATE blog:

https://ubuntu-mate.org/blog/ubuntu-mate-yakkety-beta1/

The Disqus comments on the bottom of the page load automatically.

@gitarra
Copy link

gitarra commented Dec 30, 2016

Here is a page where the comments cannot be viewed at all. The button to load them does not show up.

https://atlee.ca/blog/posts/2016-releng-retrospective.html

@gitarra
Copy link

gitarra commented Jan 27, 2017

Here is a page that is broken completely, infinite spinner, the page does not load at all.

https://sietch-tabr.tumblr.com/post/156437385832/thunderbird-testing-effort

@dsedivec
Copy link

dsedivec commented Apr 2, 2017

Medium mode users: I had to add * disqus.com * noop to my dynamic rules, otherwise the * * 3p-script block rule would just block the new script element inserted by these rules. (I welcome a better dynamic rule, perhaps one that isn't so permissive!)

And in case anyone else is interested, here is the JavaScript run by the above redirect rule (as of this writing).

@sotracez
Copy link

sotracez commented May 8, 2019

not work on igg-games.com

@Gittyperson
Copy link

Both broken: 1 - 2

@Grossdm
Copy link

Grossdm commented Oct 23, 2019

@dsedivec,
Is the second rule for the cdn server that I have unneeded:

* disqus.com * noop
* disquscdn.com * noop

TIA

@dsedivec
Copy link

dsedivec commented Oct 23, 2019

Is the second rule for the cdn server that I have unneeded:

* disqus.com * noop
* disquscdn.com * noop

No, I think the second rule is needed, good point. I actually have this more specific rule instead of your second one:

* https://c.disquscdn.com/next/embed script noop

Thanks @Grossdm for pointing that out for everyone. I must not have noticed that I had previously added the disquscdn.com rule prior to using this gist.

Copy link

ghost commented Nov 9, 2019

Is there any plan for some of these sites to be fixed? I would love to add this to my hosts file for extra privacy but it appears this comment from 2016 hasn't even been fixed.
https://gist.github.com/gorhill/ef1b62d606473c68d524#gistcomment-1859882

Edit: For some reason works in Chrome but not Firefox (with all the same lists)

@gwarser
Copy link

gwarser commented Nov 9, 2019

but it appears this comment from 2016 hasn't even been fixed.
gorhill/ef1b62d606473c68d524#gistcomment-1859882

Works for me in Firefox 70.0.1, uBO 1.23.0 default settings.

Copy link

ghost commented Nov 9, 2019

I'll get a different version of Firefox and see if it's something one of my past extensions did.

Edit: Woks now, good to know something is messed up.

@serovar
Copy link

serovar commented Aug 17, 2020

For some time now this is not working anymore for me (Disqus just don't load and the button does not appear) on Firefox, both desktop (Dev Edition 80) and mobile (Fenix Nightly). It was working as intended with the button on both. I am using v1.29.0. On Chrome it works with v1.28.4.

@gorhill
Copy link
Author

gorhill commented Aug 17, 2020

@serovar
Copy link

serovar commented Aug 17, 2020

It was good until it lasted, thanks for the heads up :)

@ArtexJay
Copy link

I really need this

@gwarser
Copy link

gwarser commented Jan 20, 2023

@ArtexJay
Copy link

Looks like this still working https://gist.github.com/gwarser/2d4b5dcd32b0d219e0ae65b43eb1f53d

@ArtexJay

Is this only compatible with ublock or can i use this in adguard too

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment