bookmarklet
by
uneco
2012-04-05 [2012/04/05 17:22:42]
my bookmarklet
-
/*
* @title bookmarklet
* @description my bookmarklet
* @include http://dictionary.goo.ne.jp/srch/*
* @license MIT License
* @require
*/
var script = document.createElement('script');
script.textContent = '(' + (function () {
var $keys = [];
$('.allList>dt>a').each(function(i,e) {
$keys.push($(e).html())
});
var words = $.map($keys, function(key, i) {
return key + ' -> ' + $($('.allList>dd')[i]).html()
});
localStorage.uns += words.join('<>') + '<>';
$('a').each(function(i, e) {
if ($(e).attr('title') == "next page") {
location.href = $(e).attr('href');
}
});
}).toString() + ')();';
document.body.appendChild(script);
document.body.removeChild(script);
-
- Permalink
- このページへの個別リンクです。
- RAW
- 書かれたコードへの直接のリンクです。
- Packed
- 文字列が圧縮された書かれたコードへのリンクです。
- Userscript
- Greasemonkey 等で利用する場合の .user.js へのリンクです。
- Loader
- @require やソースコードが長い場合に多段ロードする Loader コミのコードへのリンクです。
- Metadata
- コード中にコメントで @xxx と書かれたメタデータの JSON です。