NRKCinemaMode

Forbedre videoavspillingsopplevelsen på NRK ved å få den til å fylle hele fanen

K instalaci tototo skriptu si budete muset nainstalovat rozšíření jako Tampermonkey, Greasemonkey nebo Violentmonkey.

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

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Userscripts.

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

K instalaci tohoto skriptu si budete muset nainstalovat manažer uživatelských skriptů.

(Už mám manažer uživatelských skriptů, nechte mě ho nainstalovat!)

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.

(Už mám manažer uživatelských stylů, nechte mě ho nainstalovat!)

// ==UserScript==
// @name         NRKCinemaMode
// @namespace    http://tampermonkey.net/
// @version      0.3
// @description  Forbedre videoavspillingsopplevelsen på NRK ved å få den til å fylle hele fanen
// @author       H3rl
// @match        https://tv.nrk.no/*/avspiller
// @icon         https://www.google.com/s2/favicons?sz=64&domain=nrk.no
// @license      MIT
// @grant        none
// ==/UserScript==

(function () {
    'use strict';

    window.onload = function () {
        applyCinemaMode();
    };

    function applyCinemaMode() {
        let episodelist = document.querySelector('#episode-list');

        if (!episodelist) {
            handleLoadFailure();
            return;
        }

        // Patch the episode list
        episodelist.classList.remove('tv-series-season-episode__list--sticky');
        episodelist.style.width = '300px';
        episodelist.style.marginLeft = 'auto';
        episodelist.style.marginRight = 'auto';

        // Apply custom styles
        applyStyles();
    }

    function applyStyles() {
        let style = document.createElement('style');
        style.innerHTML = `
            .tv-series-season-grid {
                display: block !important;
                margin: 5px !important;
            }
            ::-webkit-scrollbar {
                display: none;
            }
        `;

        document.head.appendChild(style);

        let grid = document.querySelector('.tv-series-season-grid');
        if (!grid) {
            handleLoadFailure();
            return;
        }
        grid.style.display = 'block';

        console.log("Success!");
    }

    function handleLoadFailure() {
        console.log("Could not apply patch, trying again!");
        setTimeout(applyCinemaMode, 100);
    }
})();