changeset 68:7784a39c891b

Add script to fix suruga-ya display
author nanaya <me@nanaya.pro>
date Fri, 03 Apr 2020 14:34:12 +0900
parents f03e2d169a8a
children cd36abde74ff
files surugaya-fixes.user.js
diffstat 1 files changed, 25 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/surugaya-fixes.user.js	Fri Apr 03 14:34:12 2020 +0900
@@ -0,0 +1,25 @@
+// ==UserScript==
+// @name         suruga-ya fixes
+// @namespace    https://myconan.net
+// @version      0.1.0
+// @description  Show all products
+// @author       nanaya
+// @match        https://www.suruga-ya.jp/*
+// @grant        none
+// @downloadURL  https://hg.sr.ht/~nanaya/ec-userscripts/raw/default/surugaya-fixes.user.js
+// ==/UserScript==
+
+;(function () {
+  'use strict'
+
+  const hasAdultCookie = document.cookie.split('; ').includes('adult=1')
+
+  if (hasAdultCookie) {
+    return
+  }
+
+  const d = new Date()
+  d.setTime(d.getTime() + (100 * 24 * 60 * 60 * 1000))
+  document.cookie = `adult=1; expires=${d.toGMTString()}; path=/`
+  window.location.reload()
+}).call()