日記
Sleipnir用メモ登録スクリプト (18:52)Edit

SleipnirでMMへの登録bookmarkletが動かない(というかbookmarklet一般が動かないんだけど)という嘆き(?)を目にしたんで、Sleipnir用スクリプトのサンプルを。というか、bookmarkletをSleipnirで動かしたい場合は、Sleipnirのスクリプトを(JavaScriptモードで)新規作成して、TODOのところにbookmarkletのJavaScriptコード部分をコピペして、もしwindowオブジェクトを使っているところがあったら、pnir.GetWindowObject(id)に書き換えればだいたい動くんじゃなかろうか? Sleipnirのスクリプトってほとんど使ったことないから知らないけど。

var pnir;
var document;
var id;
pnir     = new ActiveXObject("Sleipnir.API");
id       = pnir.GetDocumentID(pnir.ActiveIndex);
document = pnir.GetDocumentObject(id);
if (document == null)  {
pnir.MessageBox("Document オブジェクトを作成できません");
}
else {
pnir.GetWindowObject(id).open('http://1470.net/mm/memo_form.html?url=' + escape(document.location.href));
document = null;
}
pnir = null;

リンクバーに追加すればSleipnirでもbookmarkletを使えるんだそうな

リンクバーっていつも非表示にしていたから気づかなかった。

Published At2005-02-03 00:00Updated At2005-02-03 00:00