Skip to content

Instantly share code, notes, and snippets.

View javascripter's full-sized avatar

javascripter

View GitHub Profile
// ==UserScript==
// @name GMEasyInstall
// @namespace http://d.hatena.ne.jp/javascripter/
// @include http*
// ==/UserScript==
function fixLink(doc) {
$$('a[href$=".user.js"]', doc)
.forEach(function(a) {
a.href += "#";
});
// ==UserScript==
// @name MDCJa2En
// @namespace http://d.hatena.ne.jp/javascripter/
// @include http://developer.mozilla.org/ja/*
// ==/UserScript==
function ja2en(doc) {
Array.forEach(doc.getElementsByClassName('new'),
function(a) {
a.href = a.href.replace("ja","en");
});
// ==UserScript==
// @name SmartLDR
// @namespace http://d.hatena.ne.jp/javascripter/
// @include http://reader.livedoor.com/reader/
// ==/UserScript==
function evalInPage(fun) {
location.href = "javascript:void (" + fun + ")()";
}
@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); /* set default namespace to XUL */
/* URLバーのIMEをOFFに */
#urlbar *|input {
ime-mode: inactive !important;
}
/* MacでもFaviconを表示 */
.bookmark-item[image] .toolbarbutton-icon {
padding: 0 !important;
@namespace url(http://www.w3.org/1999/xhtml);
/* LivedoorReaderの広告を削除 */
@-moz-document domain("reader.livedoor.com") {
.ads,
.grayline:first-child,
.inner-box,
.Last,
span[onmouseup="init_find_job()"]{
display:none !important;
function $N(name, a)
[[i == "className" ? "class": i, a[i]]
for (i in a) if (a.hasOwnProperty(i))]
.reduce((function(elem, [attr, value])
(elem.setAttribute(attr, value), elem)),
document.createElement(name));
$N("div", {className: "foo", id: "bar"}); // <div id="bar" class="foo">
Function.prototype.bind = function bind() {
var args = Array.slice(arguments),
thisObj = args.shift(),
self = this;
return function ()
self.apply(thisObj, args.concat(Array.slice(arguments)));
};
// ==UserScript==
// @name NicoVideoAutoPlay
// @namespace http://d.hatena.ne.jp/javascripter/
// @include http://www.nicovideo.jp/watch/*
// ==/UserScript==
location.href = "javascript:" + function () {
var flvplayer = document.getElementById("flvplayer");
(function play() {
try {
(function () {
var last = null;
(function request() {
with (new XMLHttpRequest()) {
open('get', location.href, true);
send(null);
onload = function () {
if (!last || last == this.responseText) {
last = this.responseText;
setTimeout(request, 100);
var operator = {
add: function (a, b) {
return a + b;
},
contains: function (a, b) {
return a in b;
},
division: function (a, b) {
return a / b;
},