annotate surugaya-fixes.user.js @ 69:cd36abde74ff

Bump version
author nanaya <me@nanaya.pro>
date Fri, 03 Apr 2020 14:34:35 +0900
parents 7784a39c891b
children 5a3a269c5e6f
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
69
cd36abde74ff Bump version
nanaya <me@nanaya.pro>
parents: 68
diff changeset
4 // @version 1.0.0
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
7784a39c891b Add script to fix suruga-ya display
nanaya <me@nanaya.pro>
parents:
diff changeset
9 // @downloadURL https://hg.sr.ht/~nanaya/ec-userscripts/raw/default/surugaya-fixes.user.js
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()