Greasy Fork is available in English.

PocketBook - Grayscale Online Reader

Set grayscale effect to the actual page to avoid wrong colors in some pages in PDF reading.

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

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

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

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

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

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

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.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @icon            https://cloud.pocketbook.digital/reader_new/static/media/logo.74f9be12.svg
// @name            PocketBook - Grayscale Online Reader
// @version         1.0
// @author          R4wwd0G
// @description     Set grayscale effect to the actual page to avoid wrong colors in some pages in PDF reading.
// @include			https://cloud.pocketbook.digital/reader_new/*
// @namespace https://greasyfork.org/users/700468
// ==/UserScript==



function applyGrayscale() {
    document.querySelectorAll('.page-img').forEach(img => {
        img.style.filter = 'grayscale(1)';
    });
}


applyGrayscale();


const observer = new MutationObserver(mutations => {
    mutations.forEach(mutation => {
        if (mutation.type === 'childList') {
            mutation.addedNodes.forEach(node => {
                if (node.classList && node.classList.contains('page-img')) {
                    node.style.filter = 'grayscale(1)';
                }
            });
        }
    });
});


observer.observe(document.querySelector('#Reader__content'), { childList: true, subtree: true });