Skip to content

Instantly share code, notes, and snippets.

@southgate
Created October 8, 2012 10:22
Show Gist options
  • Save southgate/3851835 to your computer and use it in GitHub Desktop.
Save southgate/3851835 to your computer and use it in GitHub Desktop.
// ==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