annotate lashinbang-always-consent.user.js @ 130:49658e99888a

[medium] update class name and use document level styling instead
author nanaya <me@nanaya.net>
date Sun, 26 Feb 2023 20:09:37 +0900
parents dc960ef1248b
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
129
dc960ef1248b Add lashinbang always consent script
nanaya <me@nanaya.net>
parents:
diff changeset
1 // ==UserScript==
dc960ef1248b Add lashinbang always consent script
nanaya <me@nanaya.net>
parents:
diff changeset
2 // @name lashinbang always consent
dc960ef1248b Add lashinbang always consent script
nanaya <me@nanaya.net>
parents:
diff changeset
3 // @namespace https://nanaya.net
dc960ef1248b Add lashinbang always consent script
nanaya <me@nanaya.net>
parents:
diff changeset
4 // @version 1.0.0
dc960ef1248b Add lashinbang always consent script
nanaya <me@nanaya.net>
parents:
diff changeset
5 // @description always apply adult consent session
dc960ef1248b Add lashinbang always consent script
nanaya <me@nanaya.net>
parents:
diff changeset
6 // @author nanaya
dc960ef1248b Add lashinbang always consent script
nanaya <me@nanaya.net>
parents:
diff changeset
7 // @match https://shop.lashinbang.com/*
dc960ef1248b Add lashinbang always consent script
nanaya <me@nanaya.net>
parents:
diff changeset
8 // @grant none
dc960ef1248b Add lashinbang always consent script
nanaya <me@nanaya.net>
parents:
diff changeset
9 // @downloadURL https://hg.nanaya.net/ec-userscripts/raw-file/tip/lashinbang-always-consent.user.js
dc960ef1248b Add lashinbang always consent script
nanaya <me@nanaya.net>
parents:
diff changeset
10 // ==/UserScript==
dc960ef1248b Add lashinbang always consent script
nanaya <me@nanaya.net>
parents:
diff changeset
11
dc960ef1248b Add lashinbang always consent script
nanaya <me@nanaya.net>
parents:
diff changeset
12 'use strict';
dc960ef1248b Add lashinbang always consent script
nanaya <me@nanaya.net>
parents:
diff changeset
13
dc960ef1248b Add lashinbang always consent script
nanaya <me@nanaya.net>
parents:
diff changeset
14 async function consent () {
dc960ef1248b Add lashinbang always consent script
nanaya <me@nanaya.net>
parents:
diff changeset
15 await fetch('https://shop.lashinbang.com/age_check');
dc960ef1248b Add lashinbang always consent script
nanaya <me@nanaya.net>
parents:
diff changeset
16 window.location.reload();
dc960ef1248b Add lashinbang always consent script
nanaya <me@nanaya.net>
parents:
diff changeset
17 }
dc960ef1248b Add lashinbang always consent script
nanaya <me@nanaya.net>
parents:
diff changeset
18
dc960ef1248b Add lashinbang always consent script
nanaya <me@nanaya.net>
parents:
diff changeset
19 const consentOffLink = document.querySelector('a[href="https://shop.lashinbang.com/age_check_off"]');
dc960ef1248b Add lashinbang always consent script
nanaya <me@nanaya.net>
parents:
diff changeset
20 if (consentOffLink == null) {
dc960ef1248b Add lashinbang always consent script
nanaya <me@nanaya.net>
parents:
diff changeset
21 consent();
dc960ef1248b Add lashinbang always consent script
nanaya <me@nanaya.net>
parents:
diff changeset
22 }