TimerInTitlebar

Puts the remaining HIT time in the titlebar.

اعتبارا من 06-04-2018. شاهد أحدث إصدار.

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

ستحتاج إلى تثبيت إضافة مثل Stylus لتثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتتمكن من تثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتثبيت هذا النمط.

(لدي بالفعل مثبت أنماط للمستخدم، دعني أقم بتثبيته!)

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