Relativize Fixed

Turns fixed elements (navbars and such) into relative positioned elements. Good for small screens.

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         Relativize Fixed
// @namespace    http://github.com/kba
// @version      0.2
// @description  Turns fixed elements (navbars and such) into relative positioned elements. Good for small screens.
// @author       kba
// @match        http://*/*
// @grant        GM_registerMenuCommand
// ==/UserScript==

function relativizeFixed() {
	var elems = document.querySelectorAll('div,nav,header,footer');
	for (var i = 0; i < elems.length; i++) {
		var el = elems[i];
		var position = window.getComputedStyle(el).getPropertyValue('position');
		if (position === 'fixed') {
			el.style.position = 'relative';
		}
	}
}
GM_registerMenuCommand('Relativize Fixed', relativizeFixed);