マストドン横断検索 (自分用)
by
pacochi
2017-05-07 [2017/05/07 23:24:16]
自分用です。
@@ -1,12 +1,12 @@
/*
- * @title マストドン横断検索 (グローバル汚染しない版)
+ * @title マストドン横断検索 (グローバル汚染回避版)
* @description 自分用です。
* @include *
* @javascript_url
*/
/*
-元のスクリプト (ライセンス不明) :
+元のスクリプト (PublicDomain https://mstdn.jp/users/mastodonsearch/updates/951700) :
var txt=window.getSelection().toString();var key=window.prompt("横断検索したい言葉を入力",txt);if(key!=null){window.open("http://mastodonsearch.jp/cross/?q="+encodeURIComponent(key)+"&distinct=1")};
元のスクリプトが書かれてあるサイト :
@@ -15,4 +15,4 @@
(k =>
k && open('http://mastodonsearch.jp/cross/?distinct=1&q=' + encodeURIComponent(k))
-)(prompt('横断検索したい言葉を入力', '' + getSelection()));
+)(('' + getSelection()) || prompt('検索ワード', ''));
/*
* @title マストドン横断検索 (グローバル汚染回避版)
* @description 自分用です。
* @include *
* @javascript_url
*/
/*
元のスクリプト (PublicDomain https://mstdn.jp/users/mastodonsearch/updates/951700) :
var txt=window.getSelection().toString();var key=window.prompt("横断検索したい言葉を入力",txt);if(key!=null){window.open("http://mastodonsearch.jp/cross/?q="+encodeURIComponent(key)+"&distinct=1")};
元のスクリプトが書かれてあるサイト :
http://mastodonsearch.jp/
*/
(k =>
k && open('http://mastodonsearch.jp/cross/?distinct=1&q=' + encodeURIComponent(k))
)(('' + getSelection()) || prompt('検索ワード', ''));
- Permalink
- このページへの個別リンクです。
- RAW
- 書かれたコードへの直接のリンクです。
- Packed
- 文字列が圧縮された書かれたコードへのリンクです。
- Userscript
- Greasemonkey 等で利用する場合の .user.js へのリンクです。
- Loader
- @require やソースコードが長い場合に多段ロードする Loader コミのコードへのリンクです。
- Metadata
- コード中にコメントで @xxx と書かれたメタデータの JSON です。