fix: Discord上でメモのテキスト選択ができない問題 - #147
Merged
Merged
Conversation
pm-onyx-bot
force-pushed
the
fix/discord-text-selection
branch
2 times, most recently
from
June 24, 2026 05:39
51ef05a to
0ac0bcb
Compare
Discordのbodyに設定された user-select: none が原因で、 メモウィジェット内でテキスト選択ができない問題を修正。 user-select はShadow DOM境界を越えた継承が Chromium/Electron上で確実ではないため、 以下の要素に直接 user-select:text を指定: - shadow host (#ls-memo-final) - wrap(メインコンテナ) - 設定ダイアログ overlay(PopupModal) - 変数編集ダイアログ overlay - テンプレート入力フォーム overlay v61→v62
pm-onyx-bot
force-pushed
the
fix/discord-text-selection
branch
from
June 24, 2026 05:41
0ac0bcb to
dfd4126
Compare
Contributor
🎉 Build Successful!🔗 即座に動作確認以下のリンクから、ダウンロード不要でブックマークレットを確認できます: このページでブックマークレットをブックマークバーにドラッグ&ドロップして、すぐに動作確認できます。 |
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.
概要
Discord(Electron/Chromium)上でメモブックマークレットを起動すると、メモ本文がテキスト選択できない問題を修正。
原因
Discord の CSS で
body { user-select: none; }が設定されている。Shadow DOM のホスト要素は Shadow DOM の内側と外側を継承でつなぐため、
user-selectのような inherited property は shadow host を介して Shadow DOM 内部に継承される。その結果、Discord の
body { user-select: none }がメモウィジェット内部まで浸透してテキスト選択が効かない状態になっていた。修正
wrap要素(メモウィジェットの最上位コンテナ)にuser-select: text/-webkit-user-select: textを明示的に指定し、継承を打ち消す。wrapは Shadow DOM 内部で最初に実コンテンツを持つ要素であり、ここで指定すればすべての子孫要素に正しく継承される。確認
node build.js成功