Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 0607040241911c1ec22afc4af1cb8c23498061b3
https://github.com/WebKit/WebKit/commit/0607040241911c1ec22afc4af1cb8c23498061b3
Author: Abrar Rahman Protyasha <[email protected]>
Date: 2025-05-27 (Tue, 27 May 2025)
Changed paths:
M Source/WTF/wtf/cocoa/FileSystemCocoa.mm
Log Message:
-----------
"Open with Preview" context menu option on a PDF doesn't do anything after
first invocation
https://bugs.webkit.org/show_bug.cgi?id=293633
rdar://148680145
Reviewed by Wenson Hsieh and Megan Gardner.
"Open with Preview" downloads the PDF file into a temporary directory
and then -[NSWorkspace launchURL:] with said temporary path. However,
after on successive invocations, /my/tmp/path/File.pdf already exists
from earlier runs. To work around this, we create a file with a named
placeholder template (i.e. /my/tmp/path/XXXXXX-File.pdf) instead.
In the WTF::createTemporaryFileInDirectory file system helper, though,
we ended up appending the template string `XXXXXX` as a path _component_
rather than a component prefix, so we instead ended up with a temporary
path like /my/tmp/path/XXXXXX/-File.pdf instead, so NSFileManager could
not successfully create the template path for a new instance of the PDF
document.
This patch addresses the issue by concatenating the template string to
the file name (so it's a prefix) before passing on to
pathByAppendingComponents.
No new tests: sadly, I could not figure out a convenient way to verify
consecutive -[NSWorkspace launchURL:] behaviors.
* Source/WTF/wtf/cocoa/FileSystemCocoa.mm:
(WTF::FileSystemImpl::createTemporaryFileInDirectory):
Canonical link: https://commits.webkit.org/295475@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes