HideHackingWithSwiftNavAndSkybar

hide hackingWithSwift Nav and video

スクリプトをインストールするには、Tampermonkey, GreasemonkeyViolentmonkey のような拡張機能のインストールが必要です。

You will need to install an extension such as Tampermonkey to install this script.

スクリプトをインストールするには、TampermonkeyViolentmonkey のような拡張機能のインストールが必要です。

スクリプトをインストールするには、TampermonkeyUserscripts のような拡張機能のインストールが必要です。

このスクリプトをインストールするには、Tampermonkeyなどの拡張機能をインストールする必要があります。

このスクリプトをインストールするには、ユーザースクリプト管理ツールの拡張機能をインストールする必要があります。

(ユーザースクリプト管理ツールは設定済みなのでインストール!)

このスタイルをインストールするには、Stylusなどの拡張機能をインストールする必要があります。

このスタイルをインストールするには、Stylus などの拡張機能をインストールする必要があります。

このスタイルをインストールするには、Stylus tなどの拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

(ユーザースタイル管理ツールは設定済みなのでインストール!)

このスクリプトの質問や評価の投稿はこちら通報はこちらへお寄せください
// ==UserScript==
// @name         HideHackingWithSwiftNavAndSkybar
// @namespace    https://www.hackingwithswift.com/
// @version      0.1
// @description  hide hackingWithSwift Nav and video
// @author       MorganWang
// @match        https://www.hackingwithswift.com/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=hackingwithswift.com
// @grant        none
// @license MIT
// ==/UserScript==

(function() {
    'use strict';

    function hideNavAndSkyBar(){
        console.log("HHHH");
        var mAds=document.querySelectorAll(".navbar"),i;
        for(i=0;i<mAds.length;i++){
            var mAd=mAds[i];
            mAd.remove();
        }
        var list=document.querySelectorAll("#hws-latest-tutorial");
        for(i=0;i<list.length;i++){
            let item = list[i];
            item.remove();
        }
        var rightColumn=document.querySelectorAll(".col-lg-3");
        for(i=0;i<rightColumn.length;i++){
            let item = rightColumn[i];
            item.remove();
        }
    }

    function removeTopVideo(){
        var topVideo=document.querySelectorAll(".embed-responsive-16by9"),i;
        for(i=0;i<topVideo.length;i++){
            let item=topVideo[i];
            item.remove();
        }
    }

    function removeSupportImage() {
        var supportItems = document.querySelectorAll(".row.text-center"),i;
        for(i=0;i<supportItems.length;i++){
            var item=supportItems[i];
            item.remove();
        }
    }

    window.addEventListener('load', function() {
        hideNavAndSkyBar();
        removeTopVideo();
        removeSupportImage();
    }, false);

    setTimeout(() => {
        hideNavAndSkyBar();
        removeTopVideo();
        removeSupportImage();
    }, 2000);
})();