您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Adds total time elapsed, time remaining, and task time elapsed to a floating display. The task timer keeps track of page load times to more accurately reflect the amount of required to finish a HIT.
当前为
// ==UserScript== // @name mmmturkeybacon Floating Timers // @author mmmturkeybacon // @description Adds total time elapsed, time remaining, and task time elapsed to a floating display. The task timer keeps track of page load times to more accurately reflect the amount of required to finish a HIT. // @namespace http://userscripts.org/users/523367 // @match https://*.mturk.com/mturk/preview* // @match https://*.mturk.com/mturk/accept* // @match https://*.mturk.com/mturk/continue* // @match https://*.mturk.com/mturk/submit* // @match https://*.mturk.com/mturk/return* // @require http://code.jquery.com/jquery-latest.min.js // @version 1.04 // @grant none // ==/UserScript== /* Code for calculating time remaining modified from mTurk Title Bar Timer (http://userscripts-mirror.org/scripts/review/169153) * The offset calculation is much more simplistic than https://www.mturk.com/js/timer.js uses but it is probably sufficient. */ // try to get serverTimestamp and set offset immediately, if that fails try again when the document is ready. var offset; var serverTimestamp = unsafeWindow.serverTimestamp; if (serverTimestamp) { offset = (new Date()).getTime() - serverTimestamp; } /* Set task_start_time as soon as possible, because page load time affects how long it takes to complete * a task. */ var task_start_time = localStorage.getItem('mtb_page_unload_time'); if (task_start_time == null) { task_start_time = (new Date()).getTime(); } //$(document).ready(function() window.addEventListener('load', function() { if (offset) { serverTimestamp = unsafeWindow.serverTimestamp; if (serverTimestamp) { offset = (new Date()).getTime() - serverTimestamp; } } var endTime = unsafeWindow.endTime; if (endTime) { endTime = endTime.getTime(); } var timer_holder = document.createElement("DIV"); timer_holder.style = "position: fixed; top: 0px; left: 0px; z-index: 20; background-color: black;"; timer_holder.align = "right"; var timer_holder_innerHTML = '<div><span id="elapsed_timer" style="font-size: 14px; color: white; font-family: verdana,arial,sans-serif; text-align: right;"></span></div>'; timer_holder_innerHTML += '<div><span id="remaining_timer" style="font-size: 14px; color: white; font-family: verdana,arial,sans-serif; text-align: right;"></span></div>'; timer_holder_innerHTML += '<div><span id="task_timer" style="font-size: 14px; color: white; font-family: verdana,arial,sans-serif; text-align: right;"></span></div>'; timer_holder.innerHTML = timer_holder_innerHTML; document.body.insertBefore(timer_holder, document.body.firstChild); var theTime = document.getElementById("theTime"); var elapsed_timer = document.getElementById("elapsed_timer"); var remaining_timer = document.getElementById("remaining_timer"); var task_timer = document.getElementById("task_timer"); var observer = new MutationObserver(function (mutations) { var now = (new Date()).getTime(); elapsed_timer.innerHTML = theTime.innerHTML; var task_seconds_elapsed = Math.floor((now - task_start_time)/1000); task_timer.innerHTML = format_time(task_seconds_elapsed); if (endTime && offset) { var seconds_remaining = Math.floor((endTime - (now + offset))/1000); remaining_timer.innerHTML = format_time(seconds_remaining); } else { remaining_timer.innerHTML = "error"; } }); var options = { subtree: true, childList: true, attributes: false }; observer.observe(theTime, options); window.addEventListener('beforeunload', function(){if(typeof(Storage)!=="undefined"){localStorage.setItem('mtb_page_unload_time', (new Date()).getTime());}}); }); function format_time(time_in_seconds) { var time_str = "error"; if (time_in_seconds >= 0) { // time formatting code modified from http://userscripts.org/scripts/show/169154 var days = Math.floor((time_in_seconds/(60*60*24))); var hours = Math.floor((time_in_seconds/(60*60)) % 24); var minutes = Math.floor((time_in_seconds/60) % 60); var seconds = time_in_seconds % 60; time_str = (days == 0 ? '' : days + (days > 1 ? ' days ' : ' day ')); if (hours < 10) {hours = "0"+hours;} if (minutes < 10) {minutes = "0"+minutes;} if (seconds < 10) {seconds = "0"+seconds;} time_str += hours + ':' +minutes + ':' + seconds; } return time_str; }
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址