Greasy Fork

Greasy Fork is available in English.

Instagram - 为用户添加备注(别名/标签)

为用户添加备注(别名/标签)功能,以帮助识别和搜索

当前为 2022-06-14 提交的版本,查看 最新版本

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name                Instagram为关注用户添加备注
// @name:en             Instagram - Add notes(aliases/tags) to the user
// @name:zh-CN          Instagram - 为用户添加备注(别名/标签)
// @name:zh-TW          Instagram - 為用戶添加備註(別名/標籤)
// @name:ja             Instagram - ユーザーへのメモの追加(エイリアス/ラベル)
// @name:ko             Instagram - 사용자에게 메모 추가 (별칭/라벨)
// @name:fr             Instagram - ajouter des notes aux utilisateurs (alias/tag)
// @namespace           http://greasyfork.icu/zh-CN/users/193133-pana
// @homepage            http://greasyfork.icu/zh-CN/users/193133-pana
// @icon                data:image/svg+xml;base64,PHN2ZyByb2xlPSJpbWciIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjI0cHgiIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAwIDI0IDI0IiBhcmlhLWxhYmVsbGVkYnk9Im5ld0ljb25UaXRsZSIgc3Ryb2tlPSJyZ2JhKDI5LDE2MSwyNDIsMS4wMCkiIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlLWxpbmVjYXA9InNxdWFyZSIgc3Ryb2tlLWxpbmVqb2luPSJtaXRlciIgZmlsbD0ibm9uZSIgY29sb3I9InJnYmEoMjksMTYxLDI0MiwxLjAwKSI+IDx0aXRsZSBpZD0ibmV3SWNvblRpdGxlIj5OZXc8L3RpdGxlPiA8cGF0aCBkPSJNMTkgMTRWMjJIMi45OTk5N1Y0SDEzIi8+IDxwYXRoIGQ9Ik0xNy40NjA4IDQuMDM5MjFDMTguMjQxOCAzLjI1ODE3IDE5LjUwODIgMy4yNTgxNiAyMC4yODkyIDQuMDM5MjFMMjAuOTYwOCA0LjcxMDc5QzIxLjc0MTggNS40OTE4NCAyMS43NDE4IDYuNzU4MTcgMjAuOTYwOCA3LjUzOTIxTDExLjU4NTggMTYuOTE0MkMxMS4yMTA3IDE3LjI4OTMgMTAuNzAyIDE3LjUgMTAuMTcxNiAxNy41TDcuNSAxNy41TDcuNSAxNC44Mjg0QzcuNSAxNC4yOTggNy43MTA3MSAxMy43ODkzIDguMDg1NzkgMTMuNDE0MkwxNy40NjA4IDQuMDM5MjFaIi8+IDxwYXRoIGQ9Ik0xNi4yNSA1LjI1TDE5Ljc1IDguNzUiLz4gPC9zdmc+
// @version             5.3.12
// @description         为用户添加备注(别名/标签)功能,以帮助识别和搜索
// @description:en      Add a note(alias/tag) for users to help identify and search
// @description:zh-CN   为用户添加备注(别名/标签)功能,以帮助识别和搜索
// @description:zh-TW   為用戶添加備註(別名/標籤)功能,以幫助識別和搜尋
// @description:ja      ユーザーが識別と検索に役立つメモ(エイリアス/タグ)機能を追加する
// @description:ko      사용자 식별 및 검색에 도움이되는 메모 (별칭/태그) 기능 추가
// @description:fr      Ajouter une fonction de notes (alias/tag) pour les utilisateurs pour aider à identifier et rechercher
// @license             GNU General Public License v3.0 or later
// @compatible          chrome
// @compatible          firefox
// @author              pana
// @include             http*://*instagram.com/*
// @require             https://gcore.jsdelivr.net/npm/[email protected]/minified/arrive.min.js
// @require             https://gcore.jsdelivr.net/npm/[email protected]/dist/vue.min.js
// @require             https://gcore.jsdelivr.net/gh/LightAPIs/greasy-fork-library@c5961e56c4461790de3a52f1502e6c007ff64b4a/Note_Obj.js
// @grant               GM_info
// @grant               GM.info
// @grant               GM_getValue
// @grant               GM.getValue
// @grant               GM_setValue
// @grant               GM.setValue
// @grant               GM_deleteValue
// @grant               GM.deleteValue
// @grant               GM_listValues
// @grant               GM.listValues
// @grant               GM_openInTab
// @grant               GM.openInTab
// @grant               GM_registerMenuCommand
// @grant               GM_unregisterMenuCommand
// @grant               GM_addValueChangeListener
// @grant               GM_removeValueChangeListener
// ==/UserScript==

(async function () {
  'use strict';
  if (typeof Note_Obj !== 'function') {
    alert('Note_Obj.js was not loaded successfully!');
  }
  const updated = '2022-06-14';
  const INS_ICON = {
    NOTE_BLACK:
      'url(data:image/svg+xml;base64,PHN2ZyByb2xlPSJpbWciIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjI0cHgiIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAwIDI0IDI0IiBhcmlhLWxhYmVsbGVkYnk9Im5ld0ljb25UaXRsZSIgc3Ryb2tlPSJyZ2IoMzgsIDM4LCAzOCkiIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlLWxpbmVjYXA9InNxdWFyZSIgc3Ryb2tlLWxpbmVqb2luPSJtaXRlciIgZmlsbD0ibm9uZSIgY29sb3I9InJnYigzOCwgMzgsIDM4KSI+IDx0aXRsZSBpZD0ibmV3SWNvblRpdGxlIj5OZXc8L3RpdGxlPiA8cGF0aCBkPSJNMTkgMTRWMjJIMi45OTk5N1Y0SDEzIi8+IDxwYXRoIGQ9Ik0xNy40NjA4IDQuMDM5MjFDMTguMjQxOCAzLjI1ODE3IDE5LjUwODIgMy4yNTgxNiAyMC4yODkyIDQuMDM5MjFMMjAuOTYwOCA0LjcxMDc5QzIxLjc0MTggNS40OTE4NCAyMS43NDE4IDYuNzU4MTcgMjAuOTYwOCA3LjUzOTIxTDExLjU4NTggMTYuOTE0MkMxMS4yMTA3IDE3LjI4OTMgMTAuNzAyIDE3LjUgMTAuMTcxNiAxNy41TDcuNSAxNy41TDcuNSAxNC44Mjg0QzcuNSAxNC4yOTggNy43MTA3MSAxMy43ODkzIDguMDg1NzkgMTMuNDE0MkwxNy40NjA4IDQuMDM5MjFaIi8+IDxwYXRoIGQ9Ik0xNi4yNSA1LjI1TDE5Ljc1IDguNzUiLz4gPC9zdmc+)',
    SERACH_BLUE:
      'url(data:image/svg+xml;base64,PHN2ZyByb2xlPSJpbWciIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjI0cHgiIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAwIDI0IDI0IiBhcmlhLWxhYmVsbGVkYnk9InNlYXJjaEljb25UaXRsZSIgc3Ryb2tlPSJyZ2JhKDI5LDE2MSwyNDIsMS4wMCkiIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlLWxpbmVjYXA9InNxdWFyZSIgc3Ryb2tlLWxpbmVqb2luPSJtaXRlciIgZmlsbD0ibm9uZSIgY29sb3I9InJnYmEoMjksMTYxLDI0MiwxLjAwKSI+IDx0aXRsZSBpZD0ic2VhcmNoSWNvblRpdGxlIj5TZWFyY2g8L3RpdGxlPiA8cGF0aCBkPSJNMTQuNDEyMTEyMiwxNC40MTIxMTIyIEwyMCwyMCIvPiA8Y2lyY2xlIGN4PSIxMCIgY3k9IjEwIiByPSI2Ii8+IDwvc3ZnPg==)',
  };
  const INS_STYLE = `
        .note-obj-ins-font-blue-color {
            color: #336699;
        }
        .note-obj-ins-background-box {
            display: inline-block;
            align-items: center;
            white-space: nowrap;
            border-radius: 50px;
            padding: 0px 10px;
            background-color: #336699;
            color: #fff;
        }
        .note-obj-ins-add-btn {
            background-image: ${INS_ICON.NOTE_BLACK};
            background-size: 24px;
            background-repeat: no-repeat;
            background-position: center;
            margin-left: 5px;
            cursor: pointer;
            width: 24px;
            height: 24px;
        }
        .note-obj-ins-homepage-btn {
            margin: 6px !important;
        }
        .note-obj-ins-homepage-btn:hover {
          opacity: 0.5;
        }
        .note-obj-ins-userpage-btn {
            margin-top: 2px;
        }
        .note-obj-ins-userpage-tag {
            display: block;
            font-size: 20px;
            margin-bottom: 20px;
            white-space: nowrap;
        }
        .note-obj-ins-mobile-search-button {
            background-image: ${INS_ICON.SERACH_BLUE};
            background-size: 24px;
            background-repeat: no-repeat;
            background-position: center;
            cursor: pointer;
            min-width: 0px;
            height: 100%;
            flex: 1 1 auto;
        }
        .note-obj-ins-font-bold {
            font-weight: bold;
        }
        .note-obj-veryins-blue-tag {
            background-color: #3c81df;
            color: #fff;
            display: inline-flex;
            align-items: center;
            padding: 0px 10px;
            white-space: nowrap;
            line-height: 100%;
            border-radius: 50px;
            padding: 2px 10px;
        }
        .note-obj-veryins-userpage-btn {
            display: inline-block;
            vertical-align: middle;
        }
        .note-obj-ins-left-box {
          height: 25%;
        }
    `;
  const selector = {
    body: 'body',
    homepage: {
      article: '[role="main"] article',
      id: '._aaqt a',
      icon: 'span._aamz',
      comment_id: '._aap6._aap7._aap8 a',
      comment_at: '._aat6 ._aade > .notranslate',
    },
    homepage_stories: {
      id: '._aamb._aamc',
      id_shell: '._aam8',
    },
    homepage_recommend: {
      id: '._aak3 ._aap6._aap7._aap8 a',
    },
    user_page: {
      frame: '._aa_h',
      id: '._aa_m h2',
      bar: '._aa_n',
      box: '._aa_m',
      common: 'span._aaai',
      suggest: '._acj1 a.notranslate',
      info_at: '.notranslate',
      user_name: '._aa_c > span',
    },
    watch_list: {
      initial_item: '._aae- li',
      later_item: '._aaei',
      id: '._aap6._aap7._aap8 a',
    },
    stories: {
      id: 'a.notranslate',
      id_shell: '._ac0q',
    },
    dialog: {
      frame: '[role="dialog"] ._a3gq article',
      comment_id: '._a9zm ._aap6._aap7._aap8 a',
      comment_at: '._a9zs .notranslate',
    },
    request: {
      follow: '._aajc ._aap6._aap7._aap8 a',
    },
    mobile: {
      bottom_bar: '._abp7',
    },
    suggest: {
      user: '._aa0- ._aap6._aap7._aap8 a',
    },
  };
  function instagram_Change_Event(note_obj, user_id = null) {
    for (const article of document.querySelectorAll(selector.homepage.article)) {
      const article_user = article.querySelector(selector.homepage.id);
      if (article_user) {
        const article_user_id = Note_Obj.fn.getUserIdFromLink(article_user.href);
        (!user_id || user_id == article_user_id) &&
          note_obj.handler(article_user_id, article_user, null, {
            add: note_obj.getConfig().other.replaceHomepageID ? null : 'span',
            classname: note_obj.getConfig().other.replaceHomepageID ? 'note-obj-ins-font-blue-color' : 'note-obj-ins-background-box',
            title: note_obj.getConfig().other.replaceHomepageID,
          });
      }
      for (const comment of article.querySelectorAll(selector.homepage.comment_id)) {
        const comment_id = Note_Obj.fn.getUserIdFromLink(comment.href);
        (!user_id || user_id == comment_id) &&
          note_obj.handler(comment_id, comment, null, {
            classname: 'note-obj-ins-font-blue-color',
          });
      }
      for (const comment_at of article.querySelectorAll(selector.homepage.comment_at)) {
        const comment_at_id = Note_Obj.fn.getUserIdFromLink(comment_at.href);
        (!user_id || user_id == comment_at_id) &&
          note_obj.handler(comment_at_id, comment_at, null, {
            symbol: {
              prefix: '@',
            },
            title: true,
            classname: 'note-obj-ins-font-blue-color',
          });
      }
      for (const pic_comment_user of article.querySelectorAll(selector.dialog.comment_id)) {
        const pic_comment_id = Note_Obj.fn.getUserIdFromLink(pic_comment_user.href);
        (!user_id || user_id == pic_comment_id) &&
          note_obj.handler(pic_comment_id, pic_comment_user, null, {
            title: true,
            classname: 'note-obj-ins-font-blue-color',
          });
      }
      for (const pic_comment_at of article.querySelectorAll(selector.dialog.comment_at)) {
        if (!pic_comment_at.classList.contains(selector.homepage.comment_id.replace(/^\.|\s+.*$/g, ''))) {
          const pic_comment_at_id = Note_Obj.fn.getUserIdFromLink(pic_comment_at.href);
          (!user_id || user_id == pic_comment_at_id) &&
            note_obj.handler(pic_comment_at_id, pic_comment_at, null, {
              symbol: {
                prefix: '@',
              },
              title: true,
              classname: 'note-obj-ins-font-blue-color',
            });
        }
      }
    }
    for (const homepage_stories of document.querySelectorAll(selector.homepage_stories.id_shell)) {
      if (homepage_stories.querySelector(selector.homepage_stories.id)) {
        const homepage_stories_id = homepage_stories.querySelector(selector.homepage_stories.id).textContent;
        if (!user_id || user_id == homepage_stories_id) {
          homepage_stories.title = note_obj.getUserTag(homepage_stories_id);
        }
      }
    }
    for (const homepage_recommend of document.querySelectorAll(selector.homepage_recommend.id)) {
      const homepage_recommend_id = Note_Obj.fn.getUserIdFromLink(homepage_recommend.href);
      (!user_id || user_id == homepage_recommend_id) &&
        note_obj.handler(homepage_recommend_id, homepage_recommend, null, {
          classname: 'note-obj-ins-font-blue-color',
        });
    }
    for (const user_page of document.querySelectorAll(selector.user_page.frame)) {
      if (user_page.querySelector(selector.user_page.id)) {
        const user_page_id = user_page.querySelector(selector.user_page.id).textContent;
        if (!user_id || user_id == user_page_id) {
          const user_page_tag = user_page.querySelector('.note-obj-user-tag');
          user_page_tag && user_page_tag.remove();
          note_obj.judgeUsers(user_page_id) &&
            user_page.querySelector(selector.user_page.box).after(
              note_obj.createNoteTag(
                user_page_id,
                {
                  secondaryColor: false,
                  offsetWidth: -20,
                },
                'div',
                ['note-obj-ins-userpage-tag', 'note-obj-ins-font-blue-color', 'note-obj-ins-font-bold']
              )
            );
        }
      }
      for (const common_user of user_page.querySelectorAll(selector.user_page.common)) {
        const common_user_id = common_user.textContent;
        if (!user_id || user_id == common_user_id) {
          if (note_obj.judgeUsers(common_user_id)) {
            common_user.title = note_obj.getUserTag(common_user_id);
            if (note_obj.getShowNoteColorConfig()) {
              common_user.style.setProperty('color', note_obj.getPrimaryColor(common_user_id), 'important');
            } else {
              common_user.style.setProperty('color', '');
            }
            common_user.classList.add('note-obj-ins-font-blue-color');
          } else {
            (common_user.title = ''), common_user.style.setProperty('color', '');
            common_user.classList.remove('note-obj-ins-font-blue-color');
          }
        }
      }
      for (const info_at_user of user_page.querySelectorAll(selector.user_page.info_at)) {
        const info_at_user_id = Note_Obj.fn.getUserIdFromLink(info_at_user.href);
        (!user_id || user_id == info_at_user_id) &&
          note_obj.handler(info_at_user_id, info_at_user, null, {
            symbol: {
              prefix: '@',
            },
            classname: 'note-obj-ins-font-blue-color',
            title: true,
          });
      }
    }
    for (const stories_shell of document.querySelectorAll(selector.stories.id_shell)) {
      const stories = stories_shell.querySelector(selector.stories.id);
      if (stories) {
        const stories_user_id = Note_Obj.fn.getUserIdFromLink(stories.href);
        (!user_id || user_id == stories_user_id) &&
          note_obj.handler(stories_user_id, stories, null, {
            classname: 'note-obj-ins-font-blue-color',
          });
      }
    }
    for (const initial of document.querySelectorAll(selector.watch_list.initial_item)) {
      const initial_item = initial.querySelector(selector.watch_list.id);
      if (initial_item) {
        const initial_item_id = Note_Obj.fn.getUserIdFromLink(initial_item.href);
        (!user_id || user_id == initial_item_id) &&
          note_obj.handler(initial_item_id, initial_item, null, {
            classname: 'note-obj-ins-font-blue-color',
          });
      }
    }
    for (const later of document.querySelectorAll(selector.watch_list.later_item)) {
      const later_item = later.querySelector(selector.watch_list.id);
      if (later_item) {
        const later_item_id = Note_Obj.fn.getUserIdFromLink(later_item.href);
        (!user_id || user_id == later_item_id) &&
          note_obj.handler(later_item_id, later_item, null, {
            classname: 'note-obj-ins-font-blue-color',
          });
      }
    }
    for (const dialog of document.querySelectorAll(selector.dialog.frame)) {
      const dialog_a = dialog.querySelector(selector.homepage.id);
      if (dialog_a) {
        const dialog_a_id = Note_Obj.fn.getUserIdFromLink(dialog_a.href);
        (!user_id || user_id == dialog_a_id) &&
          note_obj.handler(dialog_a_id, dialog_a, null, {
            title: true,
            classname: 'note-obj-ins-font-blue-color',
          });
      }
      for (const like of dialog.querySelectorAll(selector.homepage.comment_id)) {
        const like_id = Note_Obj.fn.getUserIdFromLink(like.href);
        (!user_id || user_id == like_id) &&
          note_obj.judgeUsers(like_id) &&
          note_obj.handler(like_id, like, null, {
            classname: 'note-obj-ins-font-blue-color',
          });
      }
      for (const comment_user of dialog.querySelectorAll(selector.dialog.comment_id)) {
        const comment_id = Note_Obj.fn.getUserIdFromLink(comment_user.href);
        (!user_id || user_id == comment_id) &&
          note_obj.handler(comment_id, comment_user, null, {
            classname: 'note-obj-ins-font-blue-color',
            title: true,
          });
      }
      for (const comment_at of dialog.querySelectorAll(selector.dialog.comment_at)) {
        const comment_at_id = Note_Obj.fn.getUserIdFromLink(comment_at.href);
        (!user_id || user_id == comment_at_id) &&
          note_obj.handler(comment_at_id, comment_at, null, {
            symbol: {
              prefix: '@',
            },
            classname: 'note-obj-ins-font-blue-color',
            title: true,
          });
      }
    }
    for (const follow of document.querySelectorAll(selector.request.follow)) {
      const follow_user_id = Note_Obj.fn.getUserIdFromLink(follow.href);
      (!user_id || user_id == follow_user_id) &&
        note_obj.handler(follow_user_id, follow, null, {
          classname: 'note-obj-ins-font-blue-color',
        });
    }
    for (const suggest_user of document.querySelectorAll(selector.suggest.user)) {
      const suggest_user_id = Note_Obj.fn.getUserIdFromLink(suggest_user.href);
      (!user_id || user_id == suggest_user_id) &&
        note_obj.handler(suggest_user_id, suggest_user, null, {
          classname: 'note-obj-ins-font-blue-color',
        });
    }
    for (const suggest of document.querySelectorAll(selector.user_page.suggest)) {
      const suggest_user_id = Note_Obj.fn.getUserIdFromLink(suggest.href);
      (!user_id || user_id == suggest_user_id) &&
        note_obj.handler(suggest_user_id, suggest, null, {
          classname: 'note-obj-ins-font-blue-color',
        });
    }
  }
  function instagram_Homepage_Event(newValue, oldValue) {
    if (newValue != oldValue) {
      for (const article of document.querySelectorAll(selector.homepage.article)) {
        const article_user = article.querySelector(selector.homepage.id);
        if (article_user) {
          const article_user_id = Note_Obj.fn.getUserIdFromLink(article_user.href);
          note_obj.handler(article_user_id, article_user, null, {
            add: oldValue ? null : 'span',
            classname: oldValue ? 'note-obj-ins-font-blue-color' : 'note-obj-ins-background-box',
            title: oldValue,
            restore: true,
          });
          note_obj.handler(article_user_id, article_user, null, {
            add: newValue ? null : 'span',
            classname: newValue ? 'note-obj-ins-font-blue-color' : 'note-obj-ins-background-box',
            title: newValue,
          });
        }
      }
    }
  }
  function init_Instagram(note_obj) {
    const arrive_option = {
      fireOnAttributesModification: true,
      existing: true,
    };
    Note_Obj.fn.isMobilePage() &&
      document.body.arrive(selector.mobile.bottom_bar, arrive_option, item =>
        item.appendChild(note_obj.createSearchButton('note-obj-ins-mobile-search-button'))
      );
    document.body.arrive(selector.homepage.article, arrive_option, article => {
      const article_user = article.querySelector(selector.homepage.id);
      if (article_user) {
        const article_user_id = Note_Obj.fn.getUserIdFromLink(article_user.href);
        note_obj.judgeUsers(article_user_id) &&
          note_obj.handler(article_user_id, article_user, null, {
            add: note_obj.getConfig().other.replaceHomepageID ? null : 'span',
            classname: note_obj.getConfig().other.replaceHomepageID ? 'note-obj-ins-font-blue-color' : 'note-obj-ins-background-box',
            title: note_obj.getConfig().other.replaceHomepageID,
          });
        article.querySelector(selector.homepage.icon) &&
          article
            .querySelector(selector.homepage.icon)
            .insertAdjacentElement(
              'beforebegin',
              note_obj.createNoteBtn(article_user_id, null, ['note-obj-ins-add-btn', 'note-obj-ins-homepage-btn'], 'span')
            );
      }
      for (const comment of article.querySelectorAll(selector.homepage.comment_id)) {
        const comment_id = Note_Obj.fn.getUserIdFromLink(comment.href);
        note_obj.judgeUsers(comment_id) &&
          note_obj.handler(comment_id, comment, null, {
            classname: 'note-obj-ins-font-blue-color',
          });
      }
      article.arrive(selector.homepage.comment_at, arrive_option, comment_at => {
        const comment_at_id = Note_Obj.fn.getUserIdFromLink(comment_at.href);
        note_obj.judgeUsers(comment_at_id) &&
          note_obj.handler(comment_at_id, comment_at, null, {
            symbol: {
              prefix: '@',
            },
            title: true,
            classname: 'note-obj-ins-font-blue-color',
          });
      });
      article.arrive(selector.dialog.comment_id, arrive_option, pic_comment_user => {
        const pic_comment_id = Note_Obj.fn.getUserIdFromLink(pic_comment_user.href);
        note_obj.judgeUsers(pic_comment_id) &&
          note_obj.handler(pic_comment_id, pic_comment_user, null, {
            title: true,
            classname: 'note-obj-ins-font-blue-color',
          });
      });
      article.arrive(selector.dialog.comment_at, arrive_option, pic_comment_at => {
        if (!pic_comment_at.classList.contains(selector.homepage.comment_id.replace(/^\.|\s+.*$/g, ''))) {
          const pic_comment_at_id = Note_Obj.fn.getUserIdFromLink(pic_comment_at.href);
          note_obj.judgeUsers(pic_comment_at_id) &&
            note_obj.handler(pic_comment_at_id, pic_comment_at, null, {
              symbol: {
                prefix: '@',
              },
              title: true,
              classname: 'note-obj-ins-font-blue-color',
            });
        }
      });
    });
    document.body.arrive(selector.homepage_stories.id_shell, arrive_option, homepage_stories => {
      if (homepage_stories.querySelector(selector.homepage_stories.id)) {
        const homepage_stories_id = homepage_stories.querySelector(selector.homepage_stories.id).textContent;
        if (note_obj.judgeUsers(homepage_stories_id)) {
          homepage_stories.title = note_obj.getUserTag(homepage_stories_id);
        }
      }
    });
    document.body.arrive(selector.homepage_recommend.id, arrive_option, homepage_recommend => {
      const homepage_recommend_id = Note_Obj.fn.getUserIdFromLink(homepage_recommend.href);
      note_obj.judgeUsers(homepage_recommend_id) &&
        note_obj.handler(homepage_recommend_id, homepage_recommend, null, {
          classname: 'note-obj-ins-font-blue-color',
        });
    });
    document.body.arrive(selector.user_page.frame, arrive_option, user_page => {
      if (user_page.querySelector(selector.user_page.id)) {
        const user_page_id = user_page.querySelector(selector.user_page.id).textContent;
        const user_name = user_page.querySelector(selector.user_page.user_name);
        let user_name_text = '';
        if (user_name) {
          user_name_text = user_page.querySelector(selector.user_page.user_name).textContent;
        }
        user_page.querySelector(selector.user_page.bar) &&
          user_page
            .querySelector(selector.user_page.bar)
            .after(note_obj.createNoteBtn(user_page_id, user_name_text, ['note-obj-ins-add-btn', 'note-obj-ins-userpage-btn']));
        note_obj.judgeUsers(user_page_id) &&
          user_page.querySelector(selector.user_page.box).after(
            note_obj.createNoteTag(
              user_page_id,
              {
                secondaryColor: false,
                offsetWidth: -20,
              },
              'div',
              ['note-obj-ins-userpage-tag', 'note-obj-ins-font-blue-color', 'note-obj-ins-font-bold'],
              user_name_text
            )
          );
      }
      for (const common_user of user_page.querySelectorAll(selector.user_page.common)) {
        const common_user_id = common_user.textContent;
        if (note_obj.judgeUsers(common_user_id)) {
          common_user.title = note_obj.getUserTag(common_user_id);
          note_obj.getShowNoteColorConfig() &&
            common_user.style.setProperty('color', note_obj.getPrimaryColor(common_user_id), 'important');
          common_user.classList.add('note-obj-ins-font-blue-color');
        }
      }
      for (const info_at_user of user_page.querySelectorAll(selector.user_page.info_at)) {
        const info_at_user_id = Note_Obj.fn.getUserIdFromLink(info_at_user.href);
        note_obj.judgeUsers(info_at_user_id) &&
          note_obj.handler(info_at_user_id, info_at_user, null, {
            symbol: {
              prefix: '@',
            },
            classname: 'note-obj-ins-font-blue-color',
            title: true,
          });
      }
    });
    document.body.arrive(selector.stories.id_shell, arrive_option, stories_shell => {
      const stories = stories_shell.querySelector(selector.stories.id);
      if (stories) {
        const stories_user_id = Note_Obj.fn.getUserIdFromLink(stories.href);
        note_obj.judgeUsers(stories_user_id) &&
          note_obj.handler(stories_user_id, stories, null, {
            classname: 'note-obj-ins-font-blue-color',
          });
      }
      const userIdChange = new MutationObserver(() => {
        const newUserId = Note_Obj.fn.getUserIdFromLink(stories.href);
        if (note_obj.judgeUsers(newUserId)) {
          note_obj.handler(newUserId, stories, null, {
            classname: 'note-obj-ins-font-blue-color',
          });
        } else {
          note_obj.handler(newUserId, stories, null, {
            restore: true,
          });
        }
      });
      userIdChange.observe(stories, {
        attributeFilter: ['href'],
      });
    });
    document.querySelector(selector.body).arrive(selector.watch_list.initial_item, arrive_option, initial => {
      const initial_item = initial.querySelector(selector.watch_list.id);
      if (initial_item) {
        const initial_item_id = Note_Obj.fn.getUserIdFromLink(initial_item.href);
        note_obj.judgeUsers(initial_item_id) &&
          note_obj.handler(initial_item_id, initial_item, null, {
            classname: 'note-obj-ins-font-blue-color',
          });
      }
    });
    document.querySelector(selector.body).arrive(selector.watch_list.later_item, arrive_option, later => {
      const later_item = later.querySelector(selector.watch_list.id);
      if (later_item) {
        const later_item_id = Note_Obj.fn.getUserIdFromLink(later_item.href);
        note_obj.judgeUsers(later_item_id) &&
          note_obj.handler(later_item_id, later_item, null, {
            classname: 'note-obj-ins-font-blue-color',
          });
      }
    });
    document.querySelector(selector.body).arrive(selector.dialog.frame, arrive_option, dialog => {
      const dialog_a = dialog.querySelector(selector.homepage.id);
      if (dialog_a) {
        const dialog_a_id = Note_Obj.fn.getUserIdFromLink(dialog_a.href);
        note_obj.judgeUsers(dialog_a_id) &&
          note_obj.handler(dialog_a_id, dialog_a, null, {
            title: true,
            classname: 'note-obj-ins-font-blue-color',
          });
        dialog.querySelector(selector.homepage.icon) &&
          dialog
            .querySelector(selector.homepage.icon)
            .insertAdjacentElement(
              'beforebegin',
              note_obj.createNoteBtn(dialog_a_id, null, ['note-obj-ins-add-btn', 'note-obj-ins-homepage-btn'], 'span')
            );
      }
      for (const like of dialog.querySelectorAll(selector.homepage.comment_id)) {
        const like_id = Note_Obj.fn.getUserIdFromLink(like.href);
        note_obj.judgeUsers(like_id) &&
          note_obj.handler(like_id, like, null, {
            classname: 'note-obj-ins-font-blue-color',
          });
      }
      dialog.arrive(selector.dialog.comment_id, arrive_option, comment_user => {
        const comment_id = Note_Obj.fn.getUserIdFromLink(comment_user.href);
        note_obj.judgeUsers(comment_id) &&
          note_obj.handler(comment_id, comment_user, null, {
            classname: 'note-obj-ins-font-blue-color',
            title: true,
          });
      });
      dialog.arrive(selector.dialog.comment_at, arrive_option, comment_at => {
        const comment_at_id = Note_Obj.fn.getUserIdFromLink(comment_at.href);
        note_obj.judgeUsers(comment_at_id) &&
          note_obj.handler(comment_at_id, comment_at, null, {
            symbol: {
              prefix: '@',
            },
            classname: 'note-obj-ins-font-blue-color',
            title: true,
          });
      });
    });
    document.body.arrive(selector.request.follow, arrive_option, follow => {
      const follow_user_id = Note_Obj.fn.getUserIdFromLink(follow.href);
      note_obj.judgeUsers(follow_user_id) &&
        note_obj.handler(follow_user_id, follow, null, {
          classname: 'note-obj-ins-font-blue-color',
        });
    });
    document.body.arrive(selector.suggest.user, arrive_option, suggest_user => {
      const suggest_user_id = Note_Obj.fn.getUserIdFromLink(suggest_user.href);
      note_obj.judgeUsers(suggest_user_id) &&
        note_obj.handler(suggest_user_id, suggest_user, null, {
          classname: 'note-obj-ins-font-blue-color',
        });
    });
    document.body.arrive(selector.user_page.suggest, arrive_option, suggest => {
      const suggest_user_id = Note_Obj.fn.getUserIdFromLink(suggest.href);
      note_obj.judgeUsers(suggest_user_id) &&
        note_obj.handler(suggest_user_id, suggest, null, {
          classname: 'note-obj-ins-font-blue-color',
        });
    });
  }
  const note_obj = new Note_Obj('myInstagramNote');
  await note_obj.init({
    style: INS_STYLE,
    changeEvent: instagram_Change_Event,
    script: {
      author: {
        name: 'pana',
        homepage: 'http://greasyfork.icu/zh-CN/users/193133-pana',
      },
      address: 'http://greasyfork.icu/scripts/387871',
      updated: updated,
      library: [
        {
          name: 'arrive.js',
          version: '2.4.1',
          url: 'https://github.com/uzairfarooq/arrive',
        },
      ],
    },
    primaryColor: '#336699',
    settings: {
      replaceHomepageID: {
        type: 'checkbox',
        lang: {
          en: 'Allow to replace the user ID on the instagram homepage',
          zh_cn: '允许替换 Instagram 首页上的用户 ID',
          zh_tw: '允許替換 Instagram 首頁上的用戶 ID',
          ja: 'Instagram ホームページのユーザーIDの置き換えを許可する',
          ko: 'Instagram 첫 페이지에 있는 사용자 ID 바꾸기 허용',
          fr: "Permettre de remplacer l'ID utilisateur sur la page d'accueil Instagram",
        },
        default: true,
        event: instagram_Homepage_Event,
      },
    },
    leftBtnBoxClassName: 'note-obj-ins-left-box',
  });
  init_Instagram(note_obj);
})();