Mercurial > ec-userscripts
changeset 134:bb4795a52a46
Update consent cookie
author | nanaya <me@nanaya.net> |
---|---|
date | Wed, 21 Feb 2024 21:19:16 +0900 |
parents | 717bc604371b |
children | 59c8866710f8 |
files | surugaya-always-consent.user.js |
diffstat | 1 files changed, 5 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/surugaya-always-consent.user.js Sun Jan 07 19:20:55 2024 +0900 +++ b/surugaya-always-consent.user.js Wed Feb 21 21:19:16 2024 +0900 @@ -1,7 +1,7 @@ // ==UserScript== // @name suruga-ya always consent // @namespace https://nanaya.net -// @version 2.0.2 +// @version 2.0.3 // @description always inject adult consent cookie // @author nanaya // @match https://www.suruga-ya.jp/* @@ -11,10 +11,12 @@ 'use strict'; -const hasAdultCookie = document.cookie.split('; ').includes('adult=1'); +const hasAdultCookie = document.cookie.split('; ').includes('safe_search_expired=3'); if (!hasAdultCookie) { const d = new Date(); d.setTime(d.getTime() + (100 * 24 * 60 * 60 * 1000)); - document.cookie = `adult=1; expires=${d.toGMTString()}; path=/`; + const options = `expires=${d.toGMTString()};path=/`; + document.cookie = `safe_search_expired=3;${options};`; + document.cookie = `safe_search_option=3;${options};`; window.location.reload(); }