Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save mstssk/b42e110055588ecce4fe851d7e631952 to your computer and use it in GitHub Desktop.
Save mstssk/b42e110055588ecce4fe851d7e631952 to your computer and use it in GitHub Desktop.
pixivでブックマークタグ括登録するUserScript。Tampermonkeyで使う。
// ==UserScript==
// @name pixivでブックマーク一括登録
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @match https://www.pixiv.net/bookmark_add.php?*
// @match https://www.pixiv.net/novel/bookmark_add.php?*
// @grant none
// ==/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