Created
May 10, 2013 14:46
-
-
Save oquno/5554858 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 希望の電話番号 | |
// @namespace http://oq.la/ | |
// @include https://oc.dti.ne.jp/cgi-bin/uss/contract/add_plan/sphone/add_plan.cgi | |
// ==/UserScript== | |
(function() { | |
window.addEventListener("load", function(e) { | |
if (document.getElementsByTagName("b")[0].innerText == "ご希望の電話番号を選択してください。") { | |
var numbers = document.getElementsByTagName("input"); | |
for (var i = 0; i < numbers.length; i++) { | |
if (numbers[i].value && numbers[i].value.match(/1176$/)) { | |
alert("found!"); | |
return; | |
} | |
} | |
main_form.action.value = 'reflush_phone'; | |
main_form.submit(); | |
} | |
console.log("not in selection"); | |
}); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment