qutebrowser: Add cookie-blocker script
Added cookie-blocker script which attempts to remove the cookie banners popping up on a variety of websites. Works well for some of the large ones (e.g. reddit, google, stackoverflow) but less well on smaller pages. Can be invoked with `:cookie-block` command alias.
This commit is contained in:
parent
c6f243c2c1
commit
b2ee02e474
30 changed files with 17369 additions and 5 deletions
|
@ -28,3 +28,6 @@ c.aliases["show-qr"] = "spawn --userscript qr"
|
|||
|
||||
# add a task of current page to taskwarrior
|
||||
c.aliases["taskadd"] = "spawn --userscript taskadd"
|
||||
|
||||
# try to remove the cookie banner from a website
|
||||
c.aliases["cookie-block"] = "spawn --userscript qute-cookie-block"
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
c.content.blocking.enabled = True
|
||||
c.content.blocking.method = "both"
|
||||
c.content.blocking.adblock.lists = [
|
||||
"http://www.malwaredomainlist.com/hostslist/hosts.txt",
|
||||
"http://someonewhocares.org/hosts/hosts",
|
||||
"http://pgl.yoyo.org/adservers/serverlist.php?hostformat=hosts&mimetype=plaintext",
|
||||
"https://www.malwaredomainlist.com/hostslist/hosts.txt",
|
||||
"https://someonewhocares.org/hosts/hosts",
|
||||
"https://pgl.yoyo.org/adservers/serverlist.php?hostformat=hosts&mimetype=plaintext",
|
||||
"https://secure.fanboy.co.nz/fanboy-cookiemonster.txt",
|
||||
]
|
||||
c.content.blocking.hosts.lists = [
|
||||
"http://winhelp2002.mvps.org/hosts.zip",
|
||||
"http://malwaredomains.lehigh.edu/files/justdomains.zip",
|
||||
"https://winhelp2002.mvps.org/hosts.zip",
|
||||
"https://malwaredomains.lehigh.edu/files/justdomains.zip",
|
||||
]
|
||||
c.content.blocking.whitelist = ["piwik.org"]
|
||||
c.content.autoplay = False
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<block>
|
||||
<click element="#consent-page > div > div > div > form > div.wizard-body > div.actions.couple > a"/>
|
||||
<wait/>
|
||||
<click element="#select-legit-all-purpose > span.toggleAll.toggle-accpet-all"/>
|
||||
<click element="#consent-page > div > form > div.page-footer > div > div > button"/>
|
||||
</block>
|
17160
qutebrowser/.local/share/qutebrowser/cookie-blockers/blocklist.txt
Normal file
17160
qutebrowser/.local/share/qutebrowser/cookie-blockers/blocklist.txt
Normal file
File diff suppressed because it is too large
Load diff
|
@ -0,0 +1,9 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<block>
|
||||
<click element="#yDmH0d > c-wiz > div > div > div.NIoIEf > div.G4njw > div.qqtRac > div > div > div > a"/>
|
||||
<wait/>
|
||||
<click element="#yDmH0d > c-wiz > div > div > div > div.VP4fnf > div:nth-child(3) > div.uScs5d > div > div.uScs5d > div:nth-child(1) > div > button"/>
|
||||
<click element="#yDmH0d > c-wiz > div > div > div > div.VP4fnf > div:nth-child(4) > div.uScs5d > div > div.uScs5d > div:nth-child(1) > div > button"/>
|
||||
<click element="#yDmH0d > c-wiz > div > div > div > div.VP4fnf > div:nth-child(5) > div.IgeUeb > div.uScs5d > div > div.uScs5d > div:nth-child(1) > div > button"/>
|
||||
<click element="#yDmH0d > c-wiz > div > div > div > div.VP4fnf > form > div > button"/>
|
||||
</block>
|
|
@ -0,0 +1,5 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<block>
|
||||
<!-- TODO: You cannot block cookies on ebay -->
|
||||
<click element="#gdpr-banner > div.gdpr-banner__wrapper > div > a"/>
|
||||
</block>
|
|
@ -0,0 +1,4 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<block>
|
||||
<click element="#onetrust-reject-all-handler"/>
|
||||
</block>
|
|
@ -0,0 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<block>
|
||||
<click element="#gdpr-single-choice-overlay > div > div.wt-overlay__footer.wt-pt-xs-3 > div.wt-overlay__footer__action.wt-display-flex-md.wt-flex-grow-md-1.wt-order-xs-1.wt-order-md-neg1.wt-justify-content-flex-end > button"/>
|
||||
<wait/>
|
||||
<click element="#gdpr-privacy-settings > div > div.wt-overlay__footer.wt-align-items-center > div.wt-overlay__footer__action > div > div:nth-child(3) > button"/>
|
||||
</block>
|
|
@ -0,0 +1,4 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<block>
|
||||
<!-- TODO: Facebook changes IDs of buttons -->
|
||||
</block>
|
|
@ -0,0 +1,4 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<block>
|
||||
<click element="#wrapper > div.notification-banner > div > a"/>
|
||||
</block>
|
|
@ -0,0 +1,4 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<block>
|
||||
<remove element=".hide-consent"/>
|
||||
</block>
|
|
@ -0,0 +1,9 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<block>
|
||||
<click element="#EDu5ze > div"/>
|
||||
<wait/>
|
||||
<click element="#yDmH0d > c-wiz > div > div > div > div.VP4fnf > div:nth-child(4) > div.uScs5d > div > div.uScs5d > div:nth-child(1) > div > button"/>
|
||||
<click element="#yDmH0d > c-wiz > div > div > div > div.VP4fnf > div:nth-child(5) > div.uScs5d > div > div.uScs5d > div:nth-child(1) > div > button"/>
|
||||
<click element="#yDmH0d > c-wiz > div > div > div > div.VP4fnf > div:nth-child(6) > div.IgeUeb > div.uScs5d > div > div.uScs5d > div:nth-child(1) > div > button"/>
|
||||
<click element="#yDmH0d > c-wiz > div > div > div > div.VP4fnf > form > div > button"/>
|
||||
</block>
|
|
@ -0,0 +1,7 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<block>
|
||||
<!-- WARNING: The cookie-free version of this websites looks very different-->
|
||||
<click element="#modal-host > div > div > div > div > div > div > div.css-zndjj2 > a"/>
|
||||
<wait time="1000"/>
|
||||
<click element="#__next > div.css-qbih8b > div > button.css-1glzvq1"/>
|
||||
</block>
|
|
@ -0,0 +1,5 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<block>
|
||||
<click element="#onetrust-pc-btn-handler"/>
|
||||
<click element="#cookie-preferences > div.save-preference-btn-container > button"/>
|
||||
</block>
|
|
@ -0,0 +1,5 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<block>
|
||||
<!-- TODO: You cannot block cookies, only accept? -->
|
||||
<click element="body > div.RnEpo.Yx5HN > div > div > div > div.mt3GC > button.aOOlW.HoLwm"/>
|
||||
</block>
|
|
@ -0,0 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<block>
|
||||
<click element="#artdeco-global-alert-container > div.artdeco-global-alert.artdeco-global-alert--NOTICE.artdeco-global-alert--COOKIE_CONSENT > section > div > div.artdeco-global-alert-action__wrapper > button:nth-child(1)"/>
|
||||
<wait time="1500"/>
|
||||
<click element="body > header > a:nth-child(1) > li-icon"/>
|
||||
</block>
|
|
@ -0,0 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<block>
|
||||
<click element="#modal-host > div > div > div > div > div > div > div.css-zndjj2 > a"/>
|
||||
<wait time="1000"/>
|
||||
<click element="#__next > div.css-1m0hjq0 > div > button.css-1mzn52w"/>
|
||||
</block>
|
|
@ -0,0 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<block>
|
||||
<click element="#modal-host > div > div > div > div > div > div > div.css-zndjj2 > a"/>
|
||||
<wait/>
|
||||
<click element="#__next > div.css-1m0hjq0 > div > button.css-1mzn52w"/>
|
||||
</block>
|
|
@ -0,0 +1,9 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<block>
|
||||
<click element="#wcpConsentBannerCtrl > div._2j0fmugLb1FgYz6KPuB91w > button:nth-child(2)"/>
|
||||
<wait/>
|
||||
<click element="#_1dp8Vp5m3HwAqGx8qBmFV2_c1_reject"/>
|
||||
<click element="#_1dp8Vp5m3HwAqGx8qBmFV2_c2_reject"/>
|
||||
<click element="#_1dp8Vp5m3HwAqGx8qBmFV2_c3_reject"/>
|
||||
<click element="#wcpCookiePreferenceCtrl > div.AFsJE948muYyzCMktdzuk > div > div.nohp3sIG12ZBhzcMnPala > button._3tOu1FJ59c_xz_PmI1lKV5._1zNQOqxpBFSokeCLGi_hGr"/>
|
||||
</block>
|
|
@ -0,0 +1,7 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<block>
|
||||
<!-- TODO: Clicking on the button does not work -->
|
||||
<!-- <click element="#cookie-disclosure > div.cta-btn-container > button:nth-child(2)"/> -->
|
||||
<!-- TODO: Workaround: Close -->
|
||||
<click element="#cookie-disclosure > div.btn-container > button > span.icon-close"/>
|
||||
</block>
|
|
@ -0,0 +1,54 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<block>
|
||||
<!-- CANNOT OPT OUT OF EVERYTHING -->
|
||||
<!-- TODO: Does not work? -->
|
||||
<click element="#site-content > div.gdpr.shown.expanded.expanded-dock.css-17nqy7q.e1x0szx60 > div.css-183a15u.ejw0p350 > div > div.css-1s2i4vk > a"/>
|
||||
<debug/>
|
||||
<wait/>
|
||||
<debug msg="After"/>
|
||||
|
||||
<click element="#gdpr-faq-cookie-table-2 > tbody > tr:nth-child(1) > td:nth-child(5) > a:nth-child(2)"/>
|
||||
<click element="#gdpr-faq-cookie-table-2 > tbody > tr:nth-child(2) > td:nth-child(5) > a:nth-child(2)"/>
|
||||
<click element="#gdpr-faq-cookie-table-2 > tbody > tr:nth-child(3) > td:nth-child(5) > a:nth-child(2)"/>
|
||||
<click element="#gdpr-faq-cookie-table-2 > tbody > tr:nth-child(4) > td:nth-child(5) > a:nth-child(2)"/>
|
||||
<click element="#gdpr-faq-cookie-table-2 > tbody > tr:nth-child(5) > td:nth-child(5) > a:nth-child(2)"/>
|
||||
<click element="#gdpr-faq-cookie-table-2 > tbody > tr:nth-child(6) > td:nth-child(5) > a:nth-child(2)"/>
|
||||
<click element="#gdpr-faq-cookie-table-2 > tbody > tr:nth-child(7) > td:nth-child(5) > a:nth-child(2)"/>
|
||||
<click element="#gdpr-faq-cookie-table-2 > tbody > tr:nth-child(8) > td:nth-child(5) > a:nth-child(2)"/>
|
||||
<click element="#gdpr-faq-cookie-table-2 > tbody > tr:nth-child(9) > td:nth-child(5) > a:nth-child(2)"/>
|
||||
<click element="#gdpr-faq-cookie-table-2 > tbody > tr:nth-child(10) > td:nth-child(5) > a:nth-child(2)"/>
|
||||
<click element="#gdpr-faq-cookie-table-2 > tbody > tr:nth-child(11) > td:nth-child(5) > a:nth-child(2)"/>
|
||||
<click element="#gdpr-faq-cookie-table-2 > tbody > tr:nth-child(12) > td:nth-child(5) > a:nth-child(2)"/>
|
||||
<click element="#gdpr-faq-cookie-table-2 > tbody > tr:nth-child(14) > td:nth-child(5) > a:nth-child(2)"/>
|
||||
|
||||
<click element="#gdpr-faq-cookie-table-3 > tbody > tr:nth-child(1) > td:nth-child(5) > a:nth-child(2)"/>
|
||||
<click element="#gdpr-faq-cookie-table-3 > tbody > tr:nth-child(2) > td:nth-child(5) > a:nth-child(2)"/>
|
||||
<click element="#gdpr-faq-cookie-table-3 > tbody > tr:nth-child(3) > td:nth-child(5) > a:nth-child(2)"/>
|
||||
<click element="#gdpr-faq-cookie-table-3 > tbody > tr:nth-child(4) > td:nth-child(5) > a:nth-child(2)"/>
|
||||
<click element="#gdpr-faq-cookie-table-3 > tbody > tr:nth-child(5) > td:nth-child(5) > a:nth-child(2)"/>
|
||||
<click element="#gdpr-faq-cookie-table-3 > tbody > tr:nth-child(6) > td:nth-child(5) > a:nth-child(2)"/>
|
||||
<click element="#gdpr-faq-cookie-table-3 > tbody > tr:nth-child(7) > td:nth-child(5) > a:nth-child(2)"/>
|
||||
<click element="#gdpr-faq-cookie-table-3 > tbody > tr:nth-child(8) > td:nth-child(5) > a:nth-child(2)"/>
|
||||
<click element="#gdpr-faq-cookie-table-3 > tbody > tr:nth-child(9) > td:nth-child(5) > a:nth-child(2)"/>
|
||||
<click element="#gdpr-faq-cookie-table-3 > tbody > tr:nth-child(10) > td:nth-child(5) > a:nth-child(2)"/>
|
||||
<click element="#gdpr-faq-cookie-table-3 > tbody > tr:nth-child(11) > td:nth-child(5) > a:nth-child(2)"/>
|
||||
<click element="#gdpr-faq-cookie-table-3 > tbody > tr:nth-child(12) > td:nth-child(5) > a:nth-child(2)"/>
|
||||
<click element="#gdpr-faq-cookie-table-3 > tbody > tr:nth-child(13) > td:nth-child(5) > a:nth-child(2)"/>
|
||||
<click element="#gdpr-faq-cookie-table-3 > tbody > tr:nth-child(14) > td:nth-child(5) > a:nth-child(2)"/>
|
||||
<click element="#gdpr-faq-cookie-table-3 > tbody > tr:nth-child(15) > td:nth-child(5) > a:nth-child(2)"/>
|
||||
<click element="#gdpr-faq-cookie-table-3 > tbody > tr:nth-child(16) > td:nth-child(5) > a:nth-child(2)"/>
|
||||
<click element="#gdpr-faq-cookie-table-3 > tbody > tr:nth-child(17) > td:nth-child(5) > a:nth-child(2)"/>
|
||||
<click element="#gdpr-faq-cookie-table-3 > tbody > tr:nth-child(18) > td:nth-child(5) > a:nth-child(2)"/>
|
||||
<click element="#gdpr-faq-cookie-table-3 > tbody > tr:nth-child(19) > td:nth-child(5) > a:nth-child(2)"/>
|
||||
|
||||
<click element="#gdpr-faq-cookie-table-4 > tbody > tr:nth-child(1) > td:nth-child(5) > a:nth-child(2)"/>
|
||||
<click element="#gdpr-faq-cookie-table-4 > tbody > tr:nth-child(2) > td:nth-child(5) > a:nth-child(2)"/>
|
||||
<click element="#gdpr-faq-cookie-table-4 > tbody > tr:nth-child(3) > td:nth-child(5) > a:nth-child(2)"/>
|
||||
<click element="#gdpr-faq-cookie-table-4 > tbody > tr:nth-child(4) > td:nth-child(5) > a:nth-child(2)"/>
|
||||
<click element="#gdpr-faq-cookie-table-4 > tbody > tr:nth-child(7) > td:nth-child(5) > a:nth-child(2)"/>
|
||||
<click element="#gdpr-faq-cookie-table-4 > tbody > tr:nth-child(8) > td:nth-child(5) > a:nth-child(2)"/>
|
||||
<click element="#opt-out-of-new-york-times-nonessential-trackers"/>
|
||||
|
||||
<!-- TODO: Close the new tab -->
|
||||
<!-- TODO: Close the banner -->
|
||||
</block>
|
|
@ -0,0 +1,8 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<block>
|
||||
<click element="#manageCookiesLink"/>
|
||||
<wait time="1000"/>
|
||||
<click element="#performance"/>
|
||||
<click element="#functional"/>
|
||||
<click element="#submitCookiesBtn"/>
|
||||
</block>
|
|
@ -0,0 +1,4 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<block>
|
||||
<click element="#SHORTCUT_FOCUSABLE_DIV > div:nth-child(6) > div._3q-XSJ2vokDQrvdG6mR__k > section > div > section > section > form:nth-child(1) > button"/>
|
||||
</block>
|
|
@ -0,0 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<block>
|
||||
<click element="#cookie-link-manage"/>
|
||||
<!-- TODO: Not sure clicking the right thing -->
|
||||
<click element="#cookie-btn-allow"/>
|
||||
</block>
|
|
@ -0,0 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<block>
|
||||
<click element="body > div.ff-sans.ps-fixed.z-nav-fixed.ws4.sm\\:w-auto.p32.bg-black-750.fc-white.bar-lg.b16.l16.r16.js-consent-banner > div > button.grid--cell.s-btn.s-btn__filled.js-cookie-settings"/>
|
||||
<wait time="1000"/>
|
||||
<click element="#onetrust-pc-sdk > div > div.s-modal--footer.mt0.grid.gs8.gsx > button.grid--cell.s-btn.s-btn__primary.save-preference-btn-handler.onetrust-close-btn-handler.js-consent-banner-hide.js-consent-save"/>
|
||||
</block>
|
|
@ -0,0 +1,4 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<block>
|
||||
<click element="#rejectAllButton"/>
|
||||
</block>
|
|
@ -0,0 +1,4 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<block>
|
||||
<click element="#react-root > div > div > div.css-1dbjc4n.r-13qz1uu.r-417010 > main > div > div > div.css-1dbjc4n.r-1awozwy.r-1m3jxhj.r-1upvrn0.r-18u37iz.r-1d7fvdj.r-d9fdf6.r-tvv088.r-13qz1uu > div.css-18t94o4.css-1dbjc4n.r-1niwhzg.r-11mg6pl.r-sdzlij.r-1phboty.r-rs99b7.r-18kxxzh.r-1q142lx.r-1w2pmg.r-19u6a5r.r-1mnahxq.r-ero68b.r-1gg2371.r-1ny4l3l.r-1fneopy.r-o7ynqc.r-6416eg.r-lrvibr > div > span"/>
|
||||
</block>
|
|
@ -0,0 +1,4 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<block>
|
||||
<remove element=".oaDry"/>
|
||||
</block>
|
|
@ -0,0 +1,8 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<block>
|
||||
<click element="#consent-page > div > div > div > form > div.wizard-body > div.actions.couple > a"/>
|
||||
<wait time="2000"/>
|
||||
<!-- This is not my spelling mistake :) vvvvvv -->
|
||||
<click element="#select-legit-all-purpose > span.toggleAll.toggle-accpet-all"/>
|
||||
<click element="#consent-page > div > form > div.page-footer > div > div > button"/>
|
||||
</block>
|
BIN
qutebrowser/.local/share/qutebrowser/userscripts/qute-cookie-block
Executable file
BIN
qutebrowser/.local/share/qutebrowser/userscripts/qute-cookie-block
Executable file
Binary file not shown.
Loading…
Reference in a new issue