Created
April 9, 2018 05:41
-
-
Save x43x61x69/1f152d83514f5a328dd8d3af044883e0 to your computer and use it in GitHub Desktop.
Injector for: https://my.gogoro.com/tw/coupon
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
javascript: | |
{ | |
function evtSim(e, idx) | |
{ | |
sel.selectedIndex = idx; | |
var evt = document.createEvent("MouseEvents"); | |
evt.initEvent("change", false, true); | |
e.dispatchEvent(evt); | |
} | |
function inj(plt) | |
{ | |
if (plt != null) | |
{ | |
sel = document.getElementById('mygogoro-plate'); | |
var opts = sel.options; | |
for (var opt, j = 0; opt = opts[j]; j++) | |
{ | |
if (opt.value == plt) | |
{ | |
evtSim(sel, j); | |
return; | |
} | |
} | |
var nopt = document.createElement('option'); | |
nopt.value = plt; | |
nopt.innerHTML = plt; | |
sel.appendChild(nopt); | |
evtSim(sel, sel.length - 1); | |
} | |
} | |
var plt = prompt("車牌號碼 (例:ABC-1234):", ""); | |
inj(plt); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment