Skip to content

Instantly share code, notes, and snippets.

View cherenkov's full-sized avatar

cherenkov cherenkov

View GitHub Profile
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Google Calendar Demo</title>
</head>
<body>
<style type="text/css">
.hamamatsu
{font-size:5em;}
</style>
// ==UserScript==
// @name kosho.or.jp auto-focus
// @namespace http://d.hatena.ne.jp/Cherenkov/
// @include http://www.kosho.or.jp/public/book/*
// @version 0.0.2
// ==/UserScript==
(function(){
window.addEventListener("keydown",function(){
document.querySelector('[name="p_shomei"]').focus();
},false);
// ==UserScript==
// @name Template of Firebug Lite
// @namespace http://d.hatena.ne.jp/Cherenkov/
// @include http://*
// ==/UserScript==
(function(){
location.replace("javascript:var%20firebug=document.createElement('script');firebug.setAttribute('src','http://getfirebug.com/releases/lite/1.2/firebug-lite-compressed.js');document.body.appendChild(firebug);(function(){if(window.firebug.version){firebug.init();}else{setTimeout(arguments.callee);}})();void(firebug)");
firebug.addEventListener("load",init,false);
// ==UserScript==
// @name ImageContentTypeFix
// @namespace http://d.hatena.ne.jp/Cherenkov/
// @include http://img.blogs.yahoo.co.jp/ybi/*
// @include http://ca.c.yimg.jp/*
// @include http://*.blogzine.jp/photos/*
// @description 画像のContent-Typeがtext/plainでも正しく表示させる。
// ==/UserScript==
(function(){
//https://wiki.mozilla.org/Labs/Jetpack/JEP/17
// about:jetpackで開発する場合、
// そのwindowでFirebugコンソールを開いてconsole.logを表示するのが正しいようだ。
// 他のwindowではconsole.logみれない?
jetpack.future.import("pageMods");
var callback = function(document){
try{
console.log(document.title);
// Paste and Go v0.0.6
// Created by cherenkov (http://d.hatena.ne.jp/Cherenkov/)
//
// Changelog
// v0.0.6 (20100223): hbox上でも動作するようにした。
// v0.0.5: support searchbar.
// v0.0.4: 設計を見直し、ロケーションバーはTextEnteredイベントに任せるようにした。
// v0.0.3: add javascript protocol.
// v0.0.2: use Settings API and bug fix.
// v0.0.1: L(^o^)/
// Win vista sp2
// Firefox 3.5.6
// Jetpack 0.7
// debug_util.js
jetpack.future.import("menu");
jetpack.menu.context.browser.beforeShow = function(menu, context) {
menu.reset();
jetpack.notifications.show("show");
menu.clear();
// ==UserScript==
// @name Disable ToolbarContextMenu
// @namespace http://d.hatena.ne.jp/Cherenkov/
// @description ツールバーのコンテキストメニュー(右クリックメニュー)を非表示にする。
// @include chrome://browser/content/browser.xul
// ==/UserScript==
(function(){
if (location == "chrome://browser/content/browser.xul") {
document.getElementById('nav-bar').removeAttribute('context');
jetpack.future.import("menu");
jetpack.menu.context.browser.beforeShow = function(menu, context) {
menu.reset();
jetpack.notifications.show("( *9_9)");
//menu.remove("copy"); // ok
menu.remove(/c|p/i); // aTarget is not defined menu.js#1165
/*
menu.replace(/c|p/i, new jetpack.Menu({
label: "replace"
<html>
<body>
<a href="http://www.google.com">[HOME]</a>here<a href="http://www.yahoo.com">[1]</a>
<script>
var t = document.evaluate('.//text()[preceding-sibling::a[contains(@href,"google")] and following-sibling::a[contains(@href,"yahoo")]]',document.body,null,7,null);
alert(t.snapshotItem(0).textContent);
var e = document.evaluate('//text()[preceding-sibling::a[text()="[HOME]"] and following-sibling::a[text()="[1]"]]',document.body,null,7,null);
alert(e.snapshotItem(0).textContent)
</script>