您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Adds a button that add mylist to mylist page
当前为
- // ==UserScript==
- // @name [niconico video] Adds a botton that add mylist to mylist page
- // @name:ja [ニコニコ動画] マイリストページからマイリストするボタンを追加
- // @description Adds a button that add mylist to mylist page
- // @description:ja マイリストページからマイリストするボタンを追加
- // @namespace masshiro.wpblog.jp
- // @version 0.1
- // @author masshiro
- // @match http://www.nicovideo.jp/mylist/*
- // @grant none
- // ==/UserScript==
- /*
- var addbottons = function()
- {
- 'use strict';
- var span = document.createElement('span');
- span.className = "value";
- span.style="color:#F00;text-decoration:underline;cursor:pointer";
- span.innerHTML="追加";
- var a = document.createElement('a');
- a.appendChild(span);
- a.addEventListener('click',function () {
- window.open("http://www.nicovideo.jp/mylist_add/video/" + encodeURIComponent(document.querySelectorAll(".SYS_box_item a")[0].getAttribute("href").replace("watch/","")), "nicomylistadd", "width=500, height=400, menubar=no, scrollbars=no");
- },false);
- Array.prototype.forEach.call(document.querySelectorAll(".SYS_box_item_buttons p"), function(item,i) {
- var as = a.cloneNode(true);
- as.addEventListener('click',function () {
- window.open("http://www.nicovideo.jp/mylist_add/video/" + encodeURIComponent(document.querySelectorAll(".SYS_box_item a")[i].getAttribute("href").replace("watch/","")), "nicomylistadd", "width=500, height=400, menubar=no, scrollbars=no");
- },false);
- item.appendChild(as);
- });
- }
- */
- (function () {
- 'use strict';
- var addButtons = function () {
- var span = document.createElement('span');
- span.style="color:#F00;text-decoration:underline;cursor:pointer";
- span.innerHTML="追加";
- var a = document.createElement('a');
- a.className = "addmylist";
- a.appendChild(span);
- a.addEventListener('click',function () {
- window.open("http://www.nicovideo.jp/mylist_add/video/" + encodeURIComponent(document.querySelectorAll(".SYS_box_item")[0].querySelectorAll("a")[0].getAttribute("href").replace("watch/","")), "nicomylistadd", "width=500, height=400, menubar=no, scrollbars=no");
- },false);
- Array.prototype.forEach.call(document.querySelectorAll(".SYS_box_item_buttons p"), function(item,i) {
- if(typeof item.querySelectorAll("a.addmylist")[0] === "undefined"){
- var as = a.cloneNode(true);
- as.addEventListener('click',function () {
- window.open("http://www.nicovideo.jp/mylist_add/video/" + encodeURIComponent(document.querySelectorAll(".SYS_box_item")[i].querySelectorAll("a")[0].getAttribute("href").replace("watch/","")), "nicomylistadd", "width=500, height=400, menubar=no, scrollbars=no");
- },false);
- item.appendChild(as);
- }
- });
- };
- // DOM変更で再実行
- // コピー元 (ありがとうございました)
- // https://greasyfork.org/ja/scripts/15271-extract-images-for-twitter
- (function () {
- var DOMObserverTimer = false;
- var DOMObserverConfig = {
- attributes: true,
- childList: true,
- subtree: true
- };
- var DOMObserver = new MutationObserver(function () {
- if (DOMObserverTimer !== 'false') {
- clearTimeout(DOMObserverTimer);
- }
- DOMObserverTimer = setTimeout(function () {
- DOMObserver.disconnect();
- addButtons();
- DOMObserver.observe(document.body, DOMObserverConfig);
- }, 100);
- });
- DOMObserver.observe(document.body, DOMObserverConfig);
- }) ();
- })();