Greasy Fork is available in English.

Github News Unfold

A user script that unfolds GitHub news.

スクリプトをインストールするには、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         Github News Unfold
// @namespace    http://tampermonkey.net/
// @version      0.3
// @description  A user script that unfolds GitHub news.
// @author       LovelyWei
// @match        https://github.com/
// @grant        none
// ==/UserScript==

const unfold = () =>{
    const detailsContainerSelector = 'div.Details.js-details-container.js-news-feed-event-group';
    const detailsContainer = Array.from(document.querySelectorAll(detailsContainerSelector));

    if (detailsContainer.length !== 0) {
        for (let i = 0; i < detailsContainer.length; i += 1) {
            const element = detailsContainer[i];
            element.classList.add('Details--on');
        }
    }
}

const init = () => {
    const target = document.getElementsByClassName('news')[0];

    const observer = new MutationObserver(() => {
        unfold();
    });

    observer.observe(target, {
        childList: true,
        subtree: true
    });
};

(function() {
    'use strict';
    init();
})();