🏠 Home 

[niconico video] Add the "Add My List" button to search r###lt page

Add the "Add My List" button to niconico video search r###lt page


Install this script?
Author's suggested script

You may also like [niconico video] Add the "Add My List" button to mylist page.


Install this script
  1. // ==UserScript==
  2. // @name [niconico video] Add the "Add My List" button to search r###lt page
  3. // @name:ja [ニコニコ動画] 検索結果ページからマイリストするボタンを追加
  4. // @description Add the "Add My List" button to niconico video search r###lt page
  5. // @description:ja 検索結果ページページからマイリストするボタンを追加
  6. // @namespace masshiro.blog
  7. // @version 20200412
  8. // @author masshiro
  9. // @license MIT License
  10. // @match http://www.nicovideo.jp/search/*
  11. // @match https://www.nicovideo.jp/search/*
  12. // @match http://www.nicovideo.jp/tag/*
  13. // @match https://www.nicovideo.jp/tag/*
  14. // @grant none
  15. // ==/UserScript==
  16. (function () {
  17. 'use strict';
  18. var span = document.createElement('span');
  19. span.className = 'value';
  20. span.style='color:#F00;text-decoration:underline;cursor:pointer';
  21. span.innerHTML='追加';
  22. var li = document.createElement('li');
  23. li.appendChild(span);
  24. li.className = 'count';
  25. li.addEventListener('click',function () {
  26. window.open('http://www.nicovideo.jp/mylist_add/video/' + encodeURIComponent(document.querySelectorAll('li[data-video-item]')[0].getAttribute('data-video-id')), 'nicomylistadd', 'width=500, height=400, menubar=no, scrollbars=no');
  27. },false);
  28. Array.prototype.forEach.call(document.querySelectorAll('li[data-video-item] div.itemContent div.itemData ul.list'), function(item,i) {
  29. var lis = li.cloneNode(true);
  30. lis.addEventListener('click',function () {
  31. window.open('http://www.nicovideo.jp/mylist_add/video/' + encodeURIComponent(document.querySelectorAll('li[data-video-item]')[i].getAttribute('data-video-id')), 'nicomylistadd', 'width=500, height=400, menubar=no, scrollbars=no');
  32. },false);
  33. item.appendChild(lis);
  34. });
  35. document.body.addEventListener('AutoPagerize_DOMNodeInserted',function(evt){
  36. Array.prototype.forEach.call(evt.target.querySelectorAll('li[data-video-item] div.itemContent div.itemData ul.list'), function(item,i) {
  37. var lis = li.cloneNode(true);
  38. lis.addEventListener('click', function () {
  39. window.open('http://www.nicovideo.jp/mylist_add/video/' + encodeURIComponent(evt.target.querySelectorAll('li[data-video-item]')[i].getAttribute('data-video-id')), 'nicomylistadd', 'width=500, height=400, menubar=no, scrollbars=no');
  40. },false);
  41. item.appendChild(lis);
  42. });
  43. }, false);
  44. })();