# HG changeset patch # User nanaya # Date 1736233670 -32400 # Node ID 76e8b47bbb036964f9b8ca6f880f23aca1e40f53 # Parent 7a7aafa65baeca8a4793fd62c2253670d8d5f6af [lashinbang-always-consent] check for login state It's now required to turn off age check limit. diff -r 7a7aafa65bae -r 76e8b47bbb03 lashinbang-always-consent.user.js --- a/lashinbang-always-consent.user.js Fri May 17 15:03:30 2024 +0900 +++ b/lashinbang-always-consent.user.js Tue Jan 07 16:07:50 2025 +0900 @@ -1,7 +1,7 @@ // ==UserScript== // @name lashinbang always consent // @namespace https://nanaya.net -// @version 1.0.0 +// @version 1.0.1 // @description always apply adult consent session // @author nanaya // @match https://shop.lashinbang.com/* @@ -16,7 +16,21 @@ window.location.reload(); } -const consentOffLink = document.querySelector('a[href="https://shop.lashinbang.com/age_check_off"]'); -if (consentOffLink == null) { - consent(); +function main () { + const loginUrl = 'https://shop.lashinbang.com/mypage/login'; + if (window.location.href === loginUrl) { + return; + } + + const loginLink = document.querySelector(`a[href="${loginUrl}"]`); + if (loginLink != null) { + window.location = loginUrl; + } + + const consentOffLink = document.querySelector('a[href="https://shop.lashinbang.com/age_check_off"]'); + if (consentOffLink == null) { + consent(); + } } + +main();