Prolific Study Links

Add direct links to study pages on Prolific listings

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         Prolific Study Links
// @namespace    http://tampermonkey.net/
// @version      1.0
// @description  Add direct links to study pages on Prolific listings
// @author       Lintilla
// @match        https://app.prolific.com/*
// @grant        none
// @license      MIT
// ==/UserScript==

(function() {
    'use strict';
    function addStudyLinks() {
        const studyItems = document.querySelectorAll('li[data-testid^="study-"]');
        studyItems.forEach(item => {
            const testid = item.getAttribute('data-testid');
            const studyId = testid.replace('study-', '');
            const titleEl = item.querySelector('[data-testid="title"]');
            if (titleEl && !titleEl.querySelector('.prolific-link')) {
                const link = document.createElement('a');
                link.href = `https://app.prolific.com/studies/${studyId}`;
                link.textContent = '🔗 Open study page';
                link.target = '_blank';
                link.className = 'prolific-link';
                link.style.marginLeft = '8px';
                link.style.fontSize = '0.9em';
                titleEl.appendChild(link);
            }
        });
    }
    addStudyLinks();
    const observer = new MutationObserver(addStudyLinks);
    observer.observe(document.body, { childList: true, subtree: true });
})();