annotate surugaya-fixes.user.js @ 81:e30cd7fbee42

Actually working
author nanaya <me@nanaya.pro>
date Sat, 03 Oct 2020 02:21:56 +0900
parents 5a3a269c5e6f
children 86da34e62d29
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
68
7784a39c891b Add script to fix suruga-ya display
nanaya <me@nanaya.pro>
parents:
diff changeset
1 // ==UserScript==
7784a39c891b Add script to fix suruga-ya display
nanaya <me@nanaya.pro>
parents:
diff changeset
2 // @name suruga-ya fixes
7784a39c891b Add script to fix suruga-ya display
nanaya <me@nanaya.pro>
parents:
diff changeset
3 // @namespace https://myconan.net
77
5a3a269c5e6f Update downloadurl
nanaya <me@nanaya.pro>
parents: 69
diff changeset
4 // @version 1.0.1
68
7784a39c891b Add script to fix suruga-ya display
nanaya <me@nanaya.pro>
parents:
diff changeset
5 // @description Show all products
7784a39c891b Add script to fix suruga-ya display
nanaya <me@nanaya.pro>
parents:
diff changeset
6 // @author nanaya
7784a39c891b Add script to fix suruga-ya display
nanaya <me@nanaya.pro>
parents:
diff changeset
7 // @match https://www.suruga-ya.jp/*
7784a39c891b Add script to fix suruga-ya display
nanaya <me@nanaya.pro>
parents:
diff changeset
8 // @grant none
77
5a3a269c5e6f Update downloadurl
nanaya <me@nanaya.pro>
parents: 69
diff changeset
9 // @downloadURL https://hg.sr.ht/~nanaya/ec-userscripts/raw/surugaya-fixes.user.js?rev=tip
68
7784a39c891b Add script to fix suruga-ya display
nanaya <me@nanaya.pro>
parents:
diff changeset
10 // ==/UserScript==
7784a39c891b Add script to fix suruga-ya display
nanaya <me@nanaya.pro>
parents:
diff changeset
11
7784a39c891b Add script to fix suruga-ya display
nanaya <me@nanaya.pro>
parents:
diff changeset
12 ;(function () {
7784a39c891b Add script to fix suruga-ya display
nanaya <me@nanaya.pro>
parents:
diff changeset
13 'use strict'
7784a39c891b Add script to fix suruga-ya display
nanaya <me@nanaya.pro>
parents:
diff changeset
14
7784a39c891b Add script to fix suruga-ya display
nanaya <me@nanaya.pro>
parents:
diff changeset
15 const hasAdultCookie = document.cookie.split('; ').includes('adult=1')
7784a39c891b Add script to fix suruga-ya display
nanaya <me@nanaya.pro>
parents:
diff changeset
16
7784a39c891b Add script to fix suruga-ya display
nanaya <me@nanaya.pro>
parents:
diff changeset
17 if (hasAdultCookie) {
7784a39c891b Add script to fix suruga-ya display
nanaya <me@nanaya.pro>
parents:
diff changeset
18 return
7784a39c891b Add script to fix suruga-ya display
nanaya <me@nanaya.pro>
parents:
diff changeset
19 }
7784a39c891b Add script to fix suruga-ya display
nanaya <me@nanaya.pro>
parents:
diff changeset
20
7784a39c891b Add script to fix suruga-ya display
nanaya <me@nanaya.pro>
parents:
diff changeset
21 const d = new Date()
7784a39c891b Add script to fix suruga-ya display
nanaya <me@nanaya.pro>
parents:
diff changeset
22 d.setTime(d.getTime() + (100 * 24 * 60 * 60 * 1000))
7784a39c891b Add script to fix suruga-ya display
nanaya <me@nanaya.pro>
parents:
diff changeset
23 document.cookie = `adult=1; expires=${d.toGMTString()}; path=/`
7784a39c891b Add script to fix suruga-ya display
nanaya <me@nanaya.pro>
parents:
diff changeset
24 window.location.reload()
7784a39c891b Add script to fix suruga-ya display
nanaya <me@nanaya.pro>
parents:
diff changeset
25 }).call()