annotate surugaya-fixes.user.js @ 103:b2d0b37f945f

Update mandarake script - update download url - remove iife - run at document start - use observer - remove search link fixer (seems to be fixed already)
author nanaya <me@nanaya.net>
date Sat, 24 Dec 2022 22:10:30 +0900
parents 86da34e62d29
children 6b354277f2d1
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
82
86da34e62d29 Update url
nanaya <me@nanaya.pro>
parents: 77
diff changeset
4 // @version 1.0.2
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
82
86da34e62d29 Update url
nanaya <me@nanaya.pro>
parents: 77
diff changeset
9 // @downloadURL https://hg.myconan.net/ec-userscripts/raw-file/tip/surugaya-fixes.user.js
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()