LoginSignup
29
7

More than 5 years have passed since last update.

Qiita のトレンドを二度と見たくない,タグフィードを愛する人のためのユーザスクリプトを書きました

Last updated at Posted at 2018-11-12

Tampermonkey 用です。インストールは Gist の Raw からどうぞ。 Chrome のみ動作確認済み。

// ==UserScript==
// @name         Qiita Trend Eliminator
// @namespace    http://tampermonkey.net/
// @version      0.2
// @description  https://qiita.com/ を https://qiita.com/tag-feed にいい感じに置き換える
// @author       mpyw
// @match        https://qiita.com/*
// @grant        none
// ==/UserScript==

(() => {
  'use strict';

  // 他サイトからトレンドへの流入であればタグフィードに強制移動
  if (location.pathname === '/' && (!document.referrer || new URL(document.referrer).host !== 'qiita.com')) {
    location.replace('/tag-feed');
  }

  // ヘッダーの Qiita ロゴの向き先をタグフィードに変更
  const header = document.querySelector('a.st-Header_logo');
  header.href = '/tag-feed';

  // トレンドをメニュー最下部に,タグフィードはメニュー最上部に
  // for (const menu of [
  //   document.querySelectorAll('#globalHeader .st-Header_dropdown')[1],
  //   document.querySelector('.p-home_menu'),
  // ]) {
  //   const tagFeed = menu.removeChild(menu.children[2]);
  //   const trend = menu.removeChild(menu.children[0]);
  //   menu.prepend(tagFeed);
  //   menu.append(trend);
  // }

})();
29
7
5

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
29
7