Skip to content

Instantly share code, notes, and snippets.

@oquno
Created May 10, 2013 14:46
Show Gist options
  • Save oquno/5554858 to your computer and use it in GitHub Desktop.
Save oquno/5554858 to your computer and use it in GitHub Desktop.
// ==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