var clickNavByText = function (text) { var list = parent.document.querySelectorAll(‘[data-options]‘) list.forEach(function (e, i) { var _text = e.querySelector("span").textContent; if (text.trim() === _text.trim()) e.click(); }) } var clickNavByUrl = function (url) { var list = parent.document.querySelectorAll(‘[data-options]‘) list.forEach(function (e, i) { var opt = e.getAttribute(‘data-options‘); try { var _url = eval("("+opt+")").url; if (url.trim() === _url.trim()) e.click() } catch (e) { } }) }
clickNavByUrl("/ProcessUI/ProcessWaitToApproveUI/Approved") clickNavByText("我已审批的")