Advertisement
Guest User

Untitled

a guest
Oct 21st, 2019
207
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1. // ==UserScript==
  2. // @name MERLAMT 0.38 (10/21/2019)
  3. // @version 1.0
  4. // @author Nobody
  5. // @include /^https://(www|s3)\.(mturkcontent|amazonaws)\.com/
  6. // @grant none
  7.  
  8. // ==/UserScript==
  9.  
  10.  
  11. const radios_and_checkboxes = document.querySelectorAll('[type="checkbox"],[type="radio"]');
  12.  
  13. function preclick (elements_to_click, ...numbers) {
  14. const radios_and_checkboxes_to_preclick = [];
  15. Array.prototype.slice.call(arguments).forEach(el => radios_and_checkboxes_to_preclick.push(el));
  16. radios_and_checkboxes_to_preclick.forEach(element => radios_and_checkboxes[element].click());
  17. console.log(`There are a total of ${radios_and_checkboxes.length} checkboxes/radio's on this page. The requested preclicks are numbers ${radios_and_checkboxes_to_preclick}`);
  18. }
  19. preclick(0,4,9,14,19,24,29,34,39,44,49,54,59,64,69,74)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement