view surugaya-fixes.user.js @ 98:3e5f1fa9ed52

Skip redundant class check and add dataset check instead
author nanaya <me@nanaya.net>
date Fri, 23 Dec 2022 19:58:14 +0900
parents 86da34e62d29
children 6b354277f2d1
line wrap: on
line source

// ==UserScript==
// @name         suruga-ya fixes
// @namespace    https://myconan.net
// @version      1.0.2
// @description  Show all products
// @author       nanaya
// @match        https://www.suruga-ya.jp/*
// @grant        none
// @downloadURL  https://hg.myconan.net/ec-userscripts/raw-file/tip/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()