Last active
September 17, 2024 02:32
-
-
Save SebastianGrans/26e41b6e050de385775d5eaffbb83049 to your computer and use it in GitHub Desktop.
Emulate the behaviour of the Wikiwand extension in Safari 13 using an AdGuard JavaScript filter
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Since Safari 13 the Wikiwand plugin is no longer available and they | |
# don't even list Safari as a supported browser anymore. | |
# | |
# Most people use some kind of ad blocker, and personally I'm using "AdGuard for Safari" which allows you | |
# to define filters that inject javascript code on certain domains. | |
# | |
# Simply add this to AdGuards "User filter", and any wikipedia article will be redirected to Wikiwand. | |
# | |
@@||wikipedia.org^$generichide,badfilter | |
wikipedia.org#%#if (window.location.search === "") { var lang = window.location.hostname.split('.')[0]; var article = window.location.pathname.split('/')[2]; window.location.href = "http://www.wikiwand.com/" + lang + "/" + article; } | |
I am now using AdGuard for Safari version 1.8.2 with the base filter activated and it seems to be working! fingers crossed
No luck here with 1.8.2 ☹️ ️
What version of the base filter do you have? I’ve got version 2.1.43.3.
…On October 1, 2020, GitHub Notifications ***@***.***> wrote:
@SebastianGrans commented on this gist.
I am now using AdGuard for Safari version 1.8.2 with the base filter
activated and it seems to be working! fingers crossed
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<https://gist.github.com/26e41b6e050de385775d5eaffbb83049#gistcomment-
3473754>, or unsubscribe
<https://github.com/notifications/unsubscribe-
auth/AA6C3727ZICCCEWSDT5X2DTSIROJ5ANCNFSM4M3TJJCA>.
Thanks for the tip, this is great 👍
I also had some issues enabling it, but after enabling/disabling the adguard base list it seems to now work
I just discovered that they have a specific repo for their lists, so I added an issue there: AdguardTeam/AdguardFilters#79855
EDIT:
Well that was fast. Someone replied immediately and solved it!
The first line removes the basefilter from Wikipedia and allows the second rule to run. And hence, redirect any wikipedia article to wikiwand.
@@||wikipedia.org^$generichide,badfilter
wikipedia.org#%#if (window.location.search === "") { var lang = window.location.hostname.split('.')[0]; var article = window.location.pathname.split('/')[2]; window.location.href = "http://www.wikiwand.com/" + lang + "/" + article; }
It works, it works! Thanks a bunch!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Somehow the AdGuard Base filter was disabled for me as well...
I'll try to file an issue with AdGuard and see how to resolve this.