Created
October 8, 2012 10:22
-
-
Save southgate/3851835 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 ANA International Partner Space Hack | |
// @namespace http://spondooliks.org/userscripts | |
// @description Allow an ANA member with no miles to search for Partner Award Space | |
// @match http://*.ana.co.jp/* | |
// @match https://*.ana.co.jp/* | |
// ==/UserScript== | |
var elements = document.getElementsByClassName('btnRArrGrayL'); | |
var replace = [ | |
{ | |
name : "buttons.starTicketButton", | |
value : "Use Star Alliance Members" | |
}, | |
{ | |
name : "buttons.careerTicketButton", | |
value : "Use the Single Airline" | |
}, | |
]; | |
[0, 1].forEach(function(index) { | |
var input = document.createElement('input'); | |
input.setAttribute('type', 'submit'); | |
input.setAttribute('name', replace[index].name); | |
input.setAttribute('value', replace[index].value); | |
input.setAttribute('class', 'btnBlueL'); | |
var button = elements[0]; // always 0-indexed since button nodes get removed from the DOM. | |
button.parentNode.replaceChild(input, button); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment