MTurk Message Receiver

Used in conjuction with other scripts to automatically open windows from links contained in HITs

目前为 2015-08-20 提交的版本。查看 最新版本

  1. // ==UserScript==
  2. // @name MTurk Message Receiver
  3. // @namespace http://idlewords.net
  4. // @description Used in conjuction with other scripts to automatically open windows from links contained in HITs
  5. // @include https://www.mturk.com/mturk/continue*
  6. // @include https://www.mturk.com/mturk/previewandaccept*
  7. // @include https://www.mturk.com/mturk/accept*
  8. // @include https://www.mturk.com/mturk/return*
  9. // @include https://www.mturk.com/mturk/submit
  10. // @version 0.1
  11. // @require https://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js
  12. // @grant none
  13. // ==/UserScript==
  14.  
  15. function receiveMessage(event) {
  16. console.log(event);
  17. if (event.data.search("!!!!!") > -1) {
  18. var openData = event.data.split('!!!!!');
  19. window.open(openData[1], openData[0], 'toolbar=1,location=1,menubar=1,scrollbars=1');
  20. }
  21. }
  22.  
  23. if ($("td:contains('Let someone else do it')").length) {
  24. window.addEventListener("message", receiveMessage, false);
  25. }