segmentfault.com去掉google广告和编辑面板优化

编辑高度提高到800px,历史版本添加滚动条。

目前為 2018-09-12 提交的版本,檢視 最新版本

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         segmentfault.com去掉google广告和编辑面板优化
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  编辑高度提高到800px,历史版本添加滚动条。
// @author       https://github.com/1uokun
// @match        https://segmentfault.com/n/*/edit
// @match        https://segmentfault.com/record
// @match        https://segmentfault.com/*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';
    var defaultHeight = document.documentElement.clientHeight
    console.log('defaultHeight',defaultHeight)
    /**
    var observer = new ResizeObserver(function(entries) {
        entries.forEach(function(entry) {
            defaultHeight = entry.contentRect.height
        });
    });
    observer.observe(noteText);
    **/

    var _url = window.location.href;
    if(_url.indexOf('record')>-1 || _url.indexOf('edit')>-1){
        noteText.style.minHeight = defaultHeight+'px'
        revisionList.style.maxHeight = defaultHeight+'px'
        revisionList.style.overflowY = 'auto'
    }else {
        //去iframe类型的广告
        if($('iframe')){
            window.stop()
        }
        // 以防万一
        document.querySelectorAll('iframe').forEach(function(item){
            console.log(item)
            item.style.display = 'none'
        })
    }
})();