Greasy Fork

来自缓存

Greasy Fork is available in English.

cs论文跳转

在 CVPR Open Access 和 OpenReview PDF 页面添加跳转按钮,跳转至论文介绍页面

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         cs论文跳转
// @namespace    http://tampermonkey.net/
// @version      1.2
// @description  在 CVPR Open Access 和 OpenReview PDF 页面添加跳转按钮,跳转至论文介绍页面
// @author       ChrisRaynor with ChatGPT4o
// @license      MIT
// @match        https://openaccess.thecvf.com/content/*/*_paper.pdf
// @match        https://openreview.net/pdf?id=*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    // 获取当前 URL
    let currentURL = window.location.href;
    let htmlURL = "";

    if (currentURL.includes("openaccess.thecvf.com")) {
        // CVPR Open Access 处理方式
        htmlURL = currentURL.replace("/papers/", "/html/").replace("_paper.pdf", "_paper.html");
    } else if (currentURL.includes("openreview.net")) {
        // OpenReview 处理方式
        let paperId = currentURL.split("=").pop();
        htmlURL = `https://openreview.net/forum?id=${paperId}`;
    }

    if (htmlURL) {
        // 创建悬浮按钮
        let button = document.createElement("button");
        button.innerText = "跳转到介绍页面";
        button.style.position = "fixed";
        button.style.bottom = "20px";
        button.style.right = "20px";
        button.style.zIndex = "1000";
        button.style.backgroundColor = "#f39c12";
        button.style.color = "white";
        button.style.border = "none";
        button.style.padding = "12px 16px";
        button.style.cursor = "pointer";
        button.style.fontSize = "14px";
        button.style.borderRadius = "10px";
        button.style.boxShadow = "0px 4px 6px rgba(0, 0, 0, 0.1)";
        button.style.opacity = "0.9";
        button.style.transition = "opacity 0.3s";

        // 鼠标悬停时增强可见度
        button.addEventListener("mouseover", function() {
            button.style.opacity = "1";
        });
        button.addEventListener("mouseout", function() {
            button.style.opacity = "0.9";
        });

        // 按钮点击事件
        button.addEventListener("click", function() {
            window.location.href = htmlURL;
        });

        // 将按钮添加到页面
        document.body.appendChild(button);
    }
})();