// ==UserScript==
// @name           Turn off age gate on Amazon.co.jp
// @namespace      curipha
// @description    Click "I'm over 18" automatically
// @include        https://www.amazon.co.jp/gp/product/*
// @include        https://www.amazon.co.jp/dp/*
// @include        https://www.amazon.co.jp/*/dp/*
// @exclude        https://www.amazon.co.jp/ap/*
// @exclude        https://www.amazon.co.jp/mn/*
// @exclude        https://www.amazon.co.jp/clouddrive*
// @version        0.5.2
// @grant          none
// @noframes
// ==/UserScript==

(function() {
  'use strict';

  if (document.title === '警告：アダルトコンテンツ') {
    const a = document.body.querySelector('center a[href*="black-curtain-redirect.html"]');
    if (a) {
      location.href = a.href;
    }
  }
})();

// ==UserScript==
// @name           Turn off age gate on Amazon.co.jp
// @namespace      curipha
// @description    Click "I'm over 18" automatically
// @include        https://www.amazon.co.jp/gp/product/*
// @include        https://www.amazon.co.jp/gp/browse.html*
// @include        https://www.amazon.co.jp/dp/*
// @include        https://www.amazon.co.jp/*/dp/*
// @exclude        https://www.amazon.co.jp/ap/*
// @exclude        https://www.amazon.co.jp/mn/*
// @exclude        https://www.amazon.co.jp/clouddrive*
// @version        0.5.2
// @grant          none
// @noframes
// ==/UserScript==

(function() {
  'use strict';

  if (document.title === '警告：アダルトコンテンツ') {
    const a = document.body.querySelector('center a[href*="black-curtain-redirect.html"]');
    if (a) {
      location.href = a.href;
    }
  }
})();

Change @include settings so that the script is not run on all pages
Change @include settings so that the script is not run on all pages
