Mturk Group IDs

Adds group ID to mturk hit frames

目前為 2018-08-17 提交的版本,檢視 最新版本

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         Mturk Group IDs
// @description  Adds group ID to mturk hit frames
// @author       DCI
// @namespace    https://www.redpandanetwork.org
// @version      1.2
// @include      *
// @exclude      https://worker.mturk.com/mturk/externalSubmit*
// @run-at       document-start
// ==/UserScript==

if (~window.location.toString().indexOf("worker.mturk.com/projects/")){
    window.addEventListener("message", function(e){
        if (e.data == "I'm here!"){
            let iframe = document.getElementsByTagName("iframe")[0];
            let groupId = location.toString().split("projects/")[1].split("/")[0];
            iframe.src = iframe.src + "&groupId=" + groupId;
        }
    });
}
if ((window.location != window.parent.location) && (!~window.location.toString("externalSubmit"))){
    if (!~window.location.toString().indexOf("&groupId=")){
        window.parent.postMessage("I'm here!", '*');
    }
}