Prolific Study Links

Add direct links to study pages on Prolific listings

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

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

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

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

你需要先安裝一款使用者腳本管理器擴展,比如 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 });
})();