Created
August 21, 2018 02:07
-
-
Save mstssk/b42e110055588ecce4fe851d7e631952 to your computer and use it in GitHub Desktop.
pixivでブックマークタグ括登録するUserScript。Tampermonkeyで使う。
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==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