Mturk Title Fixer

Change the titles on Mturk pages to be more descriptive

  1. // ==UserScript==
  2. // @name Mturk Title Fixer
  3. // @namespace DonovanM
  4. // @author DonovanM (dnast)
  5. // @description Change the titles on Mturk pages to be more descriptive
  6. // @include https://www.mturk.com/mturk/*
  7. // @require https://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js
  8. // @version 0.9.5
  9. // @grant none
  10. // @copyright 2013+
  11. // ==/UserScript==
  12.  
  13. /** This simple script makes the page titles more useful. Most pages on Mechanical Turk simply have
  14. "Amazon Mechanical Turk" for the title and if you have multiple tabs open, it can be hard
  15. to determine which is which at a glance. This script puts an appropriate title for nearly
  16. every page on AMT.
  17. **/
  18. var title = $("title").text().trim();
  19. var existingTitle = title.replace(/Amazon Mechanical Turk( - )?/, "");
  20. var newText = "";
  21.  
  22. if (existingTitle != "") {
  23. existingTitle += " - AMT";
  24. } else {
  25. existingTitle = " - AMT";
  26.  
  27. if ($(".capsulelink_bold > div:nth-child(1)").length > 0) {
  28. newText = $(".capsulelink_bold > div:nth-child(1)").text().trim();
  29. } else if ($(".title_orange_text_bold").length > 0) {
  30. newText = $(".title_orange_text_bold").text().trim();
  31. } else if ($(".error_title").length > 0) {
  32. newText = $(".error_title").text().trim();
  33. } else {
  34. existingTitle = "AMT";
  35. }
  36. }
  37.  
  38. $("title").text(newText + existingTitle);