Mercurial > ec-userscripts
annotate surugaya-always-consent.user.js @ 147:15ec4ec958d7 default tip
Sentence case name and match filename (sort of)
author | nanaya <me@nanaya.net> |
---|---|
date | Sat, 27 Sep 2025 15:06:06 +0900 |
parents | bb4795a52a46 |
children |
rev | line source |
---|---|
116 | 1 // ==UserScript== |
147
15ec4ec958d7
Sentence case name and match filename (sort of)
nanaya <me@nanaya.net>
parents:
134
diff
changeset
|
2 // @name Suruga-ya always consent |
118 | 3 // @namespace https://nanaya.net |
134 | 4 // @version 2.0.3 |
118 | 5 // @description always inject adult consent cookie |
6 // @author nanaya | |
7 // @match https://www.suruga-ya.jp/* | |
8 // @grant none | |
9 // @downloadURL https://hg.nanaya.net/ec-userscripts/raw-file/tip/surugaya-always-consent.user.js | |
116 | 10 // ==/UserScript== |
11 | |
12 'use strict'; | |
13 | |
134 | 14 const hasAdultCookie = document.cookie.split('; ').includes('safe_search_expired=3'); |
116 | 15 if (!hasAdultCookie) { |
16 const d = new Date(); | |
17 d.setTime(d.getTime() + (100 * 24 * 60 * 60 * 1000)); | |
134 | 18 const options = `expires=${d.toGMTString()};path=/`; |
19 document.cookie = `safe_search_expired=3;${options};`; | |
20 document.cookie = `safe_search_option=3;${options};`; | |
116 | 21 window.location.reload(); |
22 } |