使用greasemonkey 添加这两个按钮。我试过颠倒顺序,它总是第二个添加的按钮有效。另一个按钮不会触发 onclick 事件。
// Add the click to chat button
mydiv = document.getElementById("optionalJobinfoData");
var btn = document.createElement("input");
btn.type = 'button';
btn.value = 'Click to Chat';
btn.onclick = function() { window.open(chatURL); };
mydiv.innerHTML += "<i>Notify Dispatch</i><br><i>(stuck on job)</i> ";
mydiv.appendChild(btn);
// Credentials button
mydiv = document.getElementById("optionalJobinfoData");
btn = document.createElement("input");
btn.type = 'button';
btn.value = 'Credentials';
btn.onclick = function() { window.open(credsURL); };
mydiv.innerHTML += "<br><br><i>DSL Credentials</i> ";
mydiv.appendChild(btn);