Skip to content

Instantly share code, notes, and snippets.

@mstssk
Last active May 6, 2020 08:26
Show Gist options
  • Save mstssk/913bfa9b394cd6fa791919478454497d to your computer and use it in GitHub Desktop.
Save mstssk/913bfa9b394cd6fa791919478454497d to your computer and use it in GitHub Desktop.
pixivでブックマークタグ括登録するボタンを付けるユーザースクリプト
// ==UserScript==
// @name pixivでブックマークタグ括登録
// @namespace http://tampermonkey.net/
// @version 0.1
// @description pixivでブックマークタグ括登録するボタンを付ける
// @author @mstssk
// @match https://www.pixiv.net/bookmark_add.php?*
// @match https://www.pixiv.net/novel/bookmark_add.php?*
// @grant none
// @homepageURL https://gist.github.com/mstssk/913bfa9b394cd6fa791919478454497d/
// @updateURL https://gist.githubusercontent.com/mstssk/913bfa9b394cd6fa791919478454497d/raw/pixiv_bookmark_tagging.js
// @downloadURL https://gist.githubusercontent.com/mstssk/913bfa9b394cd6fa791919478454497d/raw/pixiv_bookmark_tagging.js
// ==/UserScript==
(function() {
'use strict';
const d = document;
const parent = d.querySelector('.recommend-tag');
const h1 = parent.querySelector('h1');
const button = d.createElement('a');
button.href = 'javascript:void(0)';
button.style.marginLeft = '1ex';
button.textContent = '一括登録';
button.addEventListener('click', event => {
event.preventDefault();
event.stopPropagation();
Array.from(parent.querySelectorAll('span.tag')).forEach(e => e.click());
});
h1.appendChild(button);
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment