Vuetify 去广告

去除 Vuetify 开发文档中的广告

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         Vuetify 去广告
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  去除 Vuetify 开发文档中的广告
// @author       HoPGoldy
// @match        https://vuetifyjs.com/*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    /**
     * 移除 html 元素
     * @param {HtmlElement} el 要移除的元素
     */
    const remove = function (el) {
        if (!el) return
        el.parentElement.removeChild(el)
    }

    // 删除所有广告
    const clearAd = () => {
        // 左上角主要赞助商标题
        remove(document.querySelector('.text-center > .title.grey--text.text--darken-2'))
        // 左上角主要赞助商广告
        remove(document.querySelector('.text-center > section.layout.align-center.wrap'))
        // 左上角赞助我们按钮
        remove(document.querySelector('.mb-6.v-btn.v-btn--depressed.v-btn--flat.v-btn--outlined.v-btn--rounded.v-size--default.primary--text'))
        // 右边栏赞助我们按钮
        remove(document.querySelector('.v-navigation-drawer__content > div > div > .my-4'))
        // 右边栏下方广告
        remove(document.querySelector('.mt-auto'))
    }
    setInterval(clearAd, 600)
})();