Mercurial > ec-userscripts
comparison surugaya-always-consent.user.js @ 116:0e108a9dc6d7
Split suruga-ya scripts
author | nanaya <me@nanaya.net> |
---|---|
date | Sun, 15 Jan 2023 23:46:56 +0900 |
parents | |
children | 8de2d53a4cb1 |
comparison
equal
deleted
inserted
replaced
115:7774174022af | 116:0e108a9dc6d7 |
---|---|
1 // ==UserScript== | |
2 // @name suruga-ya always consent | |
3 // @namespace https://nanaya.net | |
4 // @version 2.0.2 | |
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 | |
10 // ==/UserScript== | |
11 | |
12 'use strict'; | |
13 | |
14 const hasAdultCookie = document.cookie.split('; ').includes('adult=1'); | |
15 if (!hasAdultCookie) { | |
16 const d = new Date(); | |
17 d.setTime(d.getTime() + (100 * 24 * 60 * 60 * 1000)); | |
18 document.cookie = `adult=1; expires=${d.toGMTString()}; path=/`; | |
19 window.location.reload(); | |
20 } |