Skip to content

Instantly share code, notes, and snippets.

@-moz-document regexp("^http:\/\/live2\.nicovideo\.jp\/watch\/.*") {
/* 映像+コメントリストをもっと大きく live2 バージョン */
/****display:none****/
/*2017/8(htmlの属性値がどの画面モードでも共通になってしまった)*/
[class*="page-head-area"]/*サイトロゴと検索とバナー広告*/,
[class*="program-head-area"]/*生放送タイトル*/,
[class*="wall"]/*両脇大広告*/,
[class*="operator-area"]/*empty*/,
[class*="player-head-area"]/*empty*/,
[class*="player-foot-area"]/*empty*/,
@knoajp
knoajp / LogTest.user.js
Created January 3, 2019 03:25
リッチな console.log のもと
// ==UserScript==
// @name LogTest
// @namespace knoa.jp
// @include http*://knoa.jp/
// ==/UserScript==
(function parent(){
const SCRIPTNAME = 'LogTest';
const DEBUG = true;
const log = function(){
@knoajp
knoajp / NiconicoBatchCommenter.min.js
Last active March 17, 2019 12:24
ニコニコ動画のコメントをまとめて投稿するブックマークレット
/*
ニコニコ動画のコメントをまとめて投稿するブックマークレットです。
下記のコードの冒頭のコメント部分を「#1:23 コメント内容」の形式で自由に書き換えてください。
ブラウザのアドレスバーに手入力で javascript: と打ってから、コード全体(8-17行目)を貼り付けて、Enterしてください。
# あらかじめニコニコのコマンド欄に shita などのコマンドを書いておくと、すべてのコメントに適用されます。
# テスト用動画 https://www.nicovideo.jp/watch/sm30996075
*/
(function(){const a=`
#0:00 うp乙
@knoajp
knoajp / scanObject.js
Last active February 2, 2020 02:59
find key or value from an object recursively
(function(){
const target = window;
const search = /search/;
const type = {
key: true,
value: true,
};
const scan = function(t, path = '', chain = [t]){
//console.log(path);
switch(true){
@knoajp
knoajp / TwitterBeforeAfter.bookmarklet.js
Last active July 10, 2020 06:54
Twitter Before/After
(function(){
let name = location.href.match(/twitter\.com\/([^/]+)\//)[1];
let match = document.querySelector('a[href$="#source-labels"]').parentNode.firstElementChild.textContent.match(/([0-9]+)年([0-9]+)月([0-9]+)日/);
let date = new Date(`${match[1]}-${match[2]}-${match[3]}`) - 0, since = new Date(date - 1000*60*60*24).toISOString().substr(0,10), until = new Date(date + 1000*60*60*24).toISOString().substr(0,10);
location.assign(`https://twitter.com/search?q=from%3A${name}%20since%3A${since}%20until%3A${until}&f=live`);
})();
@knoajp
knoajp / Linkify.bookmarklet.js
Last active August 21, 2020 13:14
テキストのリンク化。高速かつ誤判定のない気持ちのよい動作を目指しています。
(function(){
const linkify = function(node){
split(node);
function split(n){
if(['style', 'script', 'textarea', 'select', 'button', 'a'].includes(n.localName)) return;
if(n.nodeType === Node.TEXT_NODE){
let pos = n.data.search(linkify.RE);
if(0 <= pos){
let target = n.splitText(pos);/*pos直前までのnとpos以降のtargetに分割*/
let rest = target.splitText(RegExp.lastMatch.length);/*targetと続くrestに分割*/
@knoajp
knoajp / proxy.pac
Last active December 25, 2022 05:26
function FindProxyForURL(url, host){
switch(true){
/*いまいましい音付き広告を拒否*/
case dnsDomainIs(host, '2mdn.net'):
case dnsDomainIs(host, 'cmertv.com'):
case dnsDomainIs(host, 'cxense.com'):
case dnsDomainIs(host, 'microad.jp'):
case dnsDomainIs(host, 'socdm.com'):
case dnsDomainIs(host, 'teads.tv'):
case dnsDomainIs(host, 'uliza.jp'):/*TVerのCMに使われるのでTVerを見るなら外す必要があるかも*/