habrahabr.ru

Cached pages from closed habrahabr/geektimes posts.

目前為 2016-05-22 提交的版本,檢視 最新版本

// ==UserScript==
// @name        habrahabr.ru
// @namespace   http://habrahabr.ru/
// @include     http://habrahabr.ru/*
// @include     http://geektimes.ru/*
// @version     3
// @description Cached pages from closed habrahabr/geektimes posts.
// @description Remove all unnecessary blocks from page.
// @grant       none
// ==/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(/(habrahabr.ru\/post\/)(\d+)\//, 'savepearlharbor.com/?p=$2');
	link = link.replace(/(geektimes.ru\/post\/)(\d+)\//, 'savepearlharbor.com/?p=$2');
	h1.innerHTML += " <a href='" + link + "'>[SavePearlHarbor]</a>";
	var link = window.location.toString();
	link = link.replace(/(habrahabr.ru\/post\/)(\d+)\//, 'sohabr.ru/post/$2/');
	link = link.replace(/(geektimes.ru\/post\/)(\d+)\//, 'sohabr.ru/post/$2/');
	h1.innerHTML += " <a href='" + link + "'>[SoHabr]</a>";
} else {
    // быстрый доступ к трекеру
    $('a.logo[href="http://habrahabr.ru/feed/habred/"]').attr('href', 'http://habrahabr.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_right {display:none !important;}');
GM_addStyle('.content_left {padding-right: 0px !important;}');

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址