☰

F95 Bookmark Tab

Restores 'bookmark' tab link on navigation bar. Also on Latest Update Page, replaces 'FORUMS' tab with 'BOOKMARK'.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

作者のサイトでサポートを受ける。または、このスクリプトの質問や評価の投稿はこちら、通報はこちらへお寄せください
// ==UserScript==
// @name        F95 Bookmark Tab
// @namespace   1330126-edexal
// @match       *://f95zone.to/*
// @grant       none
// @icon        https://external-content.duckduckgo.com/ip3/f95zone.to.ico
// @license     Unlicense
// @version     1.0.0
// @author      Edexal
// @description Restores 'bookmark' tab link on navigation bar. Also on Latest Update Page, replaces 'FORUMS' tab with 'BOOKMARK'.
// @homepageURL https://sleazyfork.org/en/scripts/601301-f95-bookmark-tab
// @supportURL  https://github.com/Edexaal/scripts/issues
// @require     https://cdn.jsdelivr.net/gh/Edexaal/scripts@f60c1de7534d5b794a21b4be75281143ac96a99d/_lib/utility.js
// ==/UserScript==

(() => {
  Edexal.addCSS(`
  .p-nav-list .p-navEl:hover::after {
    right: 0;
  }`);
  const BM_LINK = '/watched/threads?tab=bookmarks';
  
  function swapForumNav() {
    const forumLinkEl = Edexal.$('.p-nav-list li:nth-child(2) a');
    forumLinkEl.href = BM_LINK;
    forumLinkEl.querySelector('span').textContent = 'Bookmarks';
  }
  
  function getMarkNav(subNav) {
    for (const el of subNav.children) {
      const spanEl = el.querySelector('span');
      if (spanEl.textContent.toLowerCase().startsWith('mark')) {
        return el;
      }
    }
  }
  
  function addBMToSubNav() {
    const subNav = Edexal.$('.p-sectionLinks-list');
    if (!subNav){
      return;
    }
    const markEl = getMarkNav(subNav);
    if (!markEl) {
      return;
    }
    const aTag = markEl.querySelector('a');
    aTag.href = BM_LINK;
    aTag.dataset.navId = "bookmarks";
    markEl.querySelector('span').textContent = "Bookmarks";
  }
  
  function run() {
    Edexal.runOnLatestUpdatePage(swapForumNav);
    addBMToSubNav();
  }
  run();
})()