Greasy Fork 还支持 简体中文。

TimerInTitlebar

Puts the remaining HIT time in the titlebar.

目前為 2018-02-11 提交的版本,檢視 最新版本

  1. // ==UserScript==
  2. // @name TimerInTitlebar
  3. // @namespace https://greasyfork.org/en/users/6503-turk05022014
  4. // @description Puts the remaining HIT time in the titlebar.
  5. // @match https://*.mturk.com/projects/*/tasks/*
  6. // @grant none
  7. // @require http://ajax.googleapis.com/ajax/libs/jquery/2.0.0/jquery.min.js
  8. // @version 1.2.20180210
  9. // ==/UserScript==
  10. this.$ = this.jQuery = jQuery.noConflict(true);
  11. $(document).ready(function () {
  12. setInterval(function () {
  13. var otime = $(".completion-timer").parent().filter(":first").data().reactProps.originalTimeToCompleteInSeconds;
  14. var ct = $(".completion-timer").text().split(" ")[0].split(":").reverse();
  15. var s = (otime - (parseInt(ct[0]) + (parseInt(ct[1])*60) + (ct[2]?parseInt(ct[2])*60*60:0))) * 1000;
  16. var d = new Date(s).toUTCString().replace(/:/g, " ").split(" ");
  17. if (d[1] > 1) { document.title = [d[1]-1,d[4],d[5],d[6]].join(":") }
  18. else if (d[4] > 0) { document.title = [d[4],d[5],d[6]].join(":") }
  19. else { document.title = [d[5],d[6]].join(":") };
  20. }, 1000);
  21. });