Reputation: 173
I am trying to initiate a click event for multiple instances of an element with a javascript bookmarklet. My goal is to be able to click on the bookmarklet and have it delete specific elements, such as whenever a button says remove. Could you help me with this please, I have tried vark.com and other sources to find this answer.
My goal is to achieve this in Google Chrome, can you help me?
Updated: Here is a more detailed explanation
<a class="page_link" title="Visit Page" href="http://www.jitbit.com/macro-recorder/versionhistory/" target="_blank">Version History - Macro Recorder, Macro Program, Mouse...</a>
This can be found by having PageMonitor installed in Chrome, clicking options and inspect element where it shows the name of the site you are monitoring.
Example:
Version History - Macro Recorder, Macro Program, Mouse...<--- This is the link
advanced rename remove Last Check: 11 seconds ago.<--- These are the options
Perhaps nodes was the wrong term, let me see.
remove
Where it says remove, I would like to initiate a click event that will press the Remove button every time it occurs Screenshot of PageMonitor options window
Upvotes: 0
Views: 591
Reputation: 11042
Thanks for explaining what you want to do. Unfortunately, I don't think this is going to be possible. Playing with PageMonitor, it doesn't appear to be possible to execute javascript in the address bar (necessary to make a bookmarklet) and have it affect the extension page.
The code to implement the feature you want is very easy though, and they could probably just add it to the extension if you asked them to. Here's the code:
$('.stop_monitoring:not(:first)').click()
Sadly, as I said, I don't think you can bookmarkletify this due to zone restrictions. Unsafe browser JS is run in a different zone from trusted extension JS. Hope this helps. :/
Upvotes: 1