habr.com

Cached pages from closed habrahabr/geektimes posts.

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        habr.com
// @include     https://habr.com/*
// @version     5.2
// @description Cached pages from closed habrahabr/geektimes posts.
// @description Remove all unnecessary blocks from page.
// @grant       none
// @namespace https://habrahabr.ru/
// ==/UserScript==

var h1 = document.querySelector("h1");
if (h1 && h1.innerHTML == "Доступ к публикации закрыт") {
        h1.innerHTML += "<br/><br/>";
	var link = "http://webcache.googleusercontent.com/search?q=cache:" + window.location;
	h1.innerHTML += " <a href='" + link + "'>[Google Cache]</a>";
	var link = window.location.toString();
	link = link.replace(/(habr.com\/post\/)(\d+)\//, 'savepearlharbor.com/?p=$2');
	h1.innerHTML += " <a href='" + link + "'>[SavePearlHarbor]</a>";
	var link = window.location.toString();
	link = link.replace(/(habr.com\/post\/)(\d+)\//, 'sohabr.ru/post/$2/');
	h1.innerHTML += " <a href='" + link + "'>[SoHabr]</a>";
} else {
    // быстрый доступ к трекеру
    $('a.logo[href="https://habr.com/ru/feed/"]').attr('href', 'https://habr.com/ru/tracker/');
}

function GM_addStyle(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);
}

GM_addStyle('.sidebar_content-area {display:none !important;}');
GM_addStyle('.content_left {padding-right: 0px !important;}');