MTurk Message Receiver

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

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name        MTurk Message Receiver
// @namespace   http://idlewords.net
// @description Used in conjuction with other scripts to automatically open windows from links contained in HITs
// @include     https://www.mturk.com/mturk/continue*
// @include     https://www.mturk.com/mturk/previewandaccept*
// @include     https://www.mturk.com/mturk/accept*
// @include     https://www.mturk.com/mturk/return*
// @include     https://www.mturk.com/mturk/submit
// @version     0.1
// @require     https://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js
// @grant       none
// ==/UserScript==

function receiveMessage(event) {
	console.log(event);
	if (event.data.search("!!!!!") > -1) {
		var openData = event.data.split('!!!!!');
		window.open(openData[1], openData[0], 'toolbar=1,location=1,menubar=1,scrollbars=1');
	}
}

if ($("td:contains('Let someone else do it')").length) {
	window.addEventListener("message", receiveMessage, false);
}