NikitaTH / MANGA Plus — Fullscreen reader

// ==UserScript==
// @name         MANGA Plus — Fullscreen reader
// @version      0.2
// @description  Позволяет читать мангу на весь экран в книжном формате (убирает полосы по бокам). Использованы наработки https://github.com/DarthSomebody/MangaPlusPlus
// @author       vk.com/nikitasb
// @match        https://mangaplus.shueisha.co.jp/viewer/*
// @run-at:      document-end
// @updateURL    https://openuserjs.org/meta/NikitaTH/MANGA_Plus_—_Fullscreen_reader.meta.js
// @downloadURL  https://openuserjs.org/src/scripts/NikitaTH/MANGA_Plus_—_Fullscreen_reader.user.js
// @license      MIT
// ==/UserScript==
/*
function addGlobalStyle(css) {
    var head, style;
    head = document.getElementsByTagName('head')[0];
    if (!head) { return; }
    style = document.createElement('style');
    style.type = 'text/css';
    style.innerHTML = css;
    head.appendChild(style);
}
//addGlobalStyle('.zao-image { max-width: none !important;}');
*/

// ==/UserScript==
/* STYLE */
(function (css) {
  var style = document.createElement("style");
  style.type = "text/css";
  style.innerHTML = css;
  document.head.appendChild(style);
})(`
/*
 * FIX FOR BACKGROUND COLOR ON FIRST PAGE
 */
.zao-surface
{
    background-color: transparent !important;
}
/*
* Убирает лимит ширины для страниц (на мониторах в книжной ориентации страницы отображаются без полей по бокам)
*/
.zao-image
{
    max-width: none !important;
}
`);

// https://github.com/DarthSomebody/MangaPlusPlus
(function () {
  // Allow middle mouse scrolling
  document.addEventListener("mousedown", function (e) {
    if (e && (e.which == 2 || e.button == 4)) {
      e.stopPropagation();
    }
  }, true);

  // Allow context menu
  window.addEventListener("contextmenu", e => e.stopPropagation(), true);

  // Allow page refresh
  document.addEventListener("keydown", function (e) {
    if (e.key == "BrowserRefresh" || e.key == "F5") {
      e.stopPropagation();
    }
  }, true);
})();