ゆうちょダイレクト オートコンプリートスクリプト
目前為
// ==UserScript==
// @name YUCHO AUTOCOMPLETE
// @namespace https://greasyfork.org/ja/scripts/390584-yucho-autocomplete
// @version 0.2
// @description ゆうちょダイレクト オートコンプリートスクリプト
// @author kokoro
// @match https://direct.jp-bank.japanpost.jp/*
// @grant none
// ==/UserScript==
(window => {
'use strict';
const title = window.document.querySelector('form[name="submitData"]');
if (title) {
const dummyInput = window.document.createElement('input');
dummyInput.type = 'text';
dummyInput.name = 'username';
dummyInput.autocomplete = true;
dummyInput.style = 'width: 1px;height: 1px;';
dummyInput.addEventListener('change', e => {
e.target.value.split('-').map((value, idx) => {
window.document.querySelector(`input[name="okyakusamaBangou${idx+1}"]`).value = value;
});
});
title.insertAdjacentElement('beforeBegin', dummyInput);
}
})(window.unsafeWindow || window);