Last active
May 6, 2020 08:26
-
-
Save mstssk/913bfa9b394cd6fa791919478454497d to your computer and use it in GitHub Desktop.
pixivでブックマークタグ括登録するボタンを付けるユーザースクリプト
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 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