{{ message }}
Repository navigation
fix: #5757 restore pasted URL page titles through host transport - #5756
Merged
Merged
Conversation
Jocs
force-pushed
the
fix/paste-url-page-title
branch
from
October 15, 2026 12:32
66bb074 to
660c567
Compare
1 task done
Contributor
Jocs
force-pushed
the
fix/paste-url-page-title
branch
from
October 15, 2026 13:19
69bb959 to
9fc07e8
Compare
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.

Closes #5757
Relates to #1344 and #2525.
Summary
Restore page-title labels when pasting bare HTTP(S) URLs. The renderer's
default-src 'self'CSP blocks its existing cross-originfetch, and relaxing CSP alone would still leave target-site CORS restrictions.Muya now accepts an optional
fetchLinkHtmltransport hook, while title parsing, entity decoding, the 1.5-second deadline, URL fallback, and paste behavior remain in the standalone package. Without a hook, Muya keeps its browser-fetch fallback. MarkText supplies the hook through typed preload/IPC to an Electron main-process request; the renderer CSP remains unchanged.Also recognize URLs without a path, avoid HTML interpolation when promoting a plain URL, and skip title lookups for plain-text paste. The desktop transport accepts only HTTP(S), sends no session credentials, aborts after 1.5 seconds, and caps HTML at 1 MiB.
Type of change
Test plan
pnpm run build:unpack) passes.Notes for reviewers
Independent of #5755, which handles preserving selected text when pasting a URL. This PR does not include that selection behavior.
Muya's timeout stops waiting for an injected hook; each host owns cancellation and size limits for its transport. The new option is documented in the Muya README and TypeScript interface.
By submitting this pull request, I confirm that my contribution is made under the terms of the MIT license.