Greasy Fork

Greasy Fork is available in English.

豆瓣高清图-douban high resolution image

可以在豆瓣小组列表页面快速预览帖子内容,无须再打开新窗口

当前为 2018-06-12 提交的版本,查看 最新版本

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         豆瓣高清图-douban high resolution image
// @namespace    https://github.com/DragonCat1
// @version      0.1
// @license      MIT
// @description  可以在豆瓣小组列表页面快速预览帖子内容,无须再打开新窗口
// @author       铛铛铛铛铛/https://www.douban.com/people/48915223
// @copyright    1991-2018,铛铛铛铛铛-Dragoncat
// @match        https://www.douban.com/*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    const style = document.createElement("style")
    style.innerHTML = `
.doumail-list li,.status-item,.obu dt,#comments,.comment-item,.user-face{
overflow: visible!important;
}

.uhead-wrap{
position: relative;
}
.raw-uhead{
visibility: hidden;
position: absolute;
transition: all 0.1s;
z-index: 1;
opacity: 0;
width: auto!important;
height: auto!important;
top:0;
left:0;
}
.uhead-wrap:hover .raw-uhead{
visibility: visible;
opacity: 1;
}

`
    document.head.appendChild(style)
    const imgs =document.querySelectorAll("img")
    imgs.forEach((img)=>{
        if(/https:\/\/img\d\.doubanio\.com\/icon\/u[a-z]?\d+-\d+\.jpg/.test(img.src)){
            let rpic=img.src.replace(/(https:\/\/img\d\.doubanio\.com\/icon\/u)[a-z]?(\d+-\d+)(\.jpg)/,'$1r$2$3')
            img.outerHTML=`<div class="uhead-wrap">${img.outerHTML}<img class="raw-uhead" src="${rpic}" alt="无大图"/></div>`
        }
    })
})();