Desktop Mode & Disable DPI Detection

Forces the browser to use desktop mode and prevents sites from determining the browser DPI

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Greasemonkey lub Violentmonkey.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana będzie instalacja rozszerzenia Tampermonkey lub Userscripts.

You will need to install an extension such as Tampermonkey to install this script.

Aby zainstalować ten skrypt, musisz zainstalować rozszerzenie menedżera skryptów użytkownika.

(Mam już menedżera skryptów użytkownika, pozwól mi to zainstalować!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Musisz zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

(Mam już menedżera stylów użytkownika, pozwól mi to zainstalować!)

// ==UserScript==
// @name         Desktop Mode & Disable DPI Detection
// @namespace    http://dmxdpi.41
// @version      1.0
// @description  Forces the browser to use desktop mode and prevents sites from determining the browser DPI
// @author       FortyOne
// @license MIT
// @match        *://*/*
// @grant        none
// @run-at       document-start
// ==/UserScript==

(function() {
    'use strict';

    // Set viewport meta tag to ensure desktop mode
    var viewport = document.createElement('meta');
    viewport.setAttribute('name', 'viewport');
    viewport.setAttribute('content', 'width=1200, user-scalable=yes');
    document.head.appendChild(viewport);

    // Prevent sites from determining browser DPI
    Object.defineProperty(window.screen, 'deviceXDPI', { value: 96, writable: false, configurable: false });
    Object.defineProperty(window.screen, 'logicalXDPI', { value: 96, writable: false, configurable: false });
    Object.defineProperty(window.screen, 'devicePixelRatio', { value: 1, writable: false, configurable: false });
})();