修改设备像素比dpi 调整jellyfin发送的图片分辨率

修改浏览器的设备像素比以增加jellyfin图片分辨率

// ==UserScript==
// @name         修改设备像素比dpi 调整jellyfin发送的图片分辨率
// @namespace    http://tampermonkey.net/
// @version      1.0.1
// @description  修改浏览器的设备像素比以增加jellyfin图片分辨率
// @author       tanmoumou252
// @match        *://*/web/index.html
// @grant        none
// @license MIT
// @icon         https://cdn.jsdelivr.net/gh/xushier/HD-Icons@main/border-radius/Jellyfin_A.png
// ==/UserScript==

(function () {
    'use strict';

    // 指定你想要的 devicePixelRatio 值,3.75时jellyfin给的图片像素为300px,2时为160px
    const customPixelRatio = 8;

    // 修改 devicePixelRatio
    Object.defineProperty(window, 'devicePixelRatio', {
        get: function () {
            return customPixelRatio;
        }
    });

    // 打印确认修改结果
    console.log(`devicePixelRatio 已修改为: ${window.devicePixelRatio}`);
})();