Repository navigation
feat(plugins): mfm-search-engine を追加 (MFM 検索ブロックの遷移先を好きな検索エンジンにする) - #99
Merged
Merged
Conversation
Misskey Web も NoteDeck も MFM の検索ブロック「foo 検索」の遷移先は Google 固定で、 設定もプラグインのフックも無い。note_view_interruptor で表示時に検索行だけを サイレントリンク `?[foo 検索 (duckduckgo.com)](https://duckduckgo.com/?q=foo)` に 書き換える。投稿そのものは変更しない。本家 Misskey Web にも同じフックがあるので両対応。 安全側の設計: - 遷移先はプリセット名 (duckduckgo / brave / startpage / searx / google / bing) か https:// の URL だけ。http / javascript / 未知の名前は書き換えを止めて起動時に警告 - リンクのラベルに遷移先ホストを出す - コードブロック内・引用行・検索語に [ ] を含む行は触らない AiScript の "\n" はエスケープにならない (`\n` → `n`) ので改行・タブは Str:lf / Str:from_codepoint から作る。受け入れテスト 11 件 (4 記法・CRLF・コードブロック・ 括弧・プリセット・https 限定・リノート・3000 字で 9k steps) を mfm-js 0.27 で裏取り。 Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
|
Caution Review failedThe pull request is closed.
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概要
MFM の検索ブロック「foo 検索」を押したときの遷移先を、DuckDuckGo などの好きな検索エンジンにするプラグイン。
Misskey Web (
MkGoogle.vue) も NoteDeck (MkMfm.vue) も遷移先は Google 固定で、設定もプラグインのフックも無い。yamisskey はフロントの preferencesearchEngineで切り替えられる (nexkey からの cherry-pick) が、本家 API には出ない。方式
Plugin:register_note_view_interruptorで表示時に検索行だけをサイレントリンクに書き換える。投稿そのものは変更しない。本家 Misskey Web にも同じフックがあるので両対応 (
runsOn: notedeck, misskey-web)。見た目は検索ボックスではなく通常のリンクになる。安全側の設計
https://の URL だけ。http / javascript / 未知の名前は書き換えを止めて起動時に警告ダイアログ( )は%28 %29に潰す (リンク構文と衝突する)。コードブロック内・引用行・検索語に[ ]を含む行は触らない検証
@syuilo/aiscript@1.2.1+mfm-js@0.27.0で裏取りpnpm contract:verify158 / 158 合格補足
AiScript の
"\n"はエスケープにならない (\n→n) ので、改行・タブはStr:lf/Str:from_codepointから作っている。本筋は NoteDeck 側に設定を足すこと (別途 issue)。このプラグインはそれまでの暫定策と、本家 Web 向けの手段。
🤖 Generated with Claude Code