[pasteboard] macOS files() treats copied web URLs as file paths
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 85/100
Research direction
Start in packages/pasteboard and read the macOS PasteboardPlugin.files() implementation, especially how it handles results from readObjects(forClasses: [NSURL.self]). Reproduce by copying a web URL and calling Pasteboard.files on macOS. Done means web URLs are omitted while file URLs are still reported.
Written by the indexing model from the issue text.
Description
In packages/pasteboard, the macOS PasteboardPlugin.files() reads NSPasteboard NSURL objects without checking isFileURL. When a user copies a web link (address bar, "Copy Link"), the URL is on the pasteboard as an NSURL, and url.path returns the URL's path portion without the host — e.g. copying https://example.com/docs/page makes Pasteboard.files return /docs/page, a file that does not exist.
Consumers can't recover the scheme on their side (the path string is all they get), so they either attach a phantom file or wrongly treat the URL as a real local file whose path coincides — e.g. copying https://example.com/etc/hosts looks exactly like the file /etc/hosts.
Reproduction: copy https://example.com/some/path in a browser, then call Pasteboard.files on macOS → returns /some/path.
Suggested fix: filter the readObjects(forClasses: [NSURL.self]) result to entries where isFileURL is true, so web URLs are simply not reported. (Found while debugging cedricziel/hermes-app#417.)
- Dominant language
- C
- Stars
- 512
- Forks
- 292
- PR merge metrics
- No merged PRs in 30d
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from MixinNetwork/flutter-plugins
-
Difficulty 1/5 Under an hour Newbie friendliness 82/100
MixinNetwork/flutter-plugins#507 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 68/100
MixinNetwork/flutter-plugins#413 · 8 reactions ·
-
Difficulty 1/5 Under an hour Newbie friendliness 68/100
MixinNetwork/flutter-plugins#401 · 2 reactions ·
-
Difficulty 3/5 1-2 days Newbie friendliness 50/100
MixinNetwork/flutter-plugins#509 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 55/100
MixinNetwork/flutter-plugins#506 ·
All issues in MixinNetwork/flutter-plugins
Similar issues
-
bug Component component: net
Difficulty 1/5 Under an hour Newbie friendliness 90/100
RT-Thread/rt-thread#11852 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
siderolabs/pkgs#1710 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
qmk/qmk_firmware#26498 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 1/5 Under an hour Newbie friendliness 85/100
betaflight/betaflight#15801 ·
Maintainers usually reply within 2 days