I am new to Grease Monkey and I need to click this Delete button
<TD nowrap width="20" height="18" valign="middle" align="center"><A href="JavaScript:SetCmd(document.msgViewer.CmdDelete.value);" title="Delete"><IMG border="0" src="https://webmail.myweb.com.au/exchweb/img/delete.gif" alt="Delete"></A></TD>
after the page is loaded using Grease Monkey
Full page here:
Is this possible and how should I go about it?
This is so that I can delete my more than 10K spam email automatically. I already selected all the email items using Grease Monkey so now I need to press the Delete button.
This is one case where it’s perfectly fine to use unsafeWindow.
So assuming that the emails are properly selected (which may be more than just checking a checkbox) and any AJAX delays/reloading are accounted for, then this code should do the trick:
Alternatively, you may find it easier to generate a click event.