Last active
September 17, 2020 01:30
-
-
Save ci7lus/0419d74bc508ec84eada939dbb227857 to your computer and use it in GitHub Desktop.
ゆうちょダイレクト オートコンプリートスクリプト https://greasyfork.org/ja/scripts/390584-yucho-autocomplete
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name YUCHO AUTOCOMPLETE | |
// @namespace https://ci7lus.github.io | |
// @version 0.3 | |
// @description ゆうちょダイレクト オートコンプリートスクリプト | |
// @author ci7l | |
// @match https://*.jp-bank.japanpost.jp/* | |
// @grant none | |
// @license MIT | |
// @copyright Copyright (c) 2020 ci7lus | |
// ==/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); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment