Skip to content

🔎 Detect changes to the default PDF handler - #65

Merged
JFWooten4 merged 3 commits into
mainfrom
pdf-handler-takeover
Oct 27, 2026
Merged

JFWooten4 merged 3 commits into
mainfrom
pdf-handler-takeover

Conversation

@JFWooten4

Copy link
Copy Markdown
Member

Summary

Implement opener-0114 (§2.4, Detect when another application becomes the default PDF handler).

  • Add a read-only detect-pdf-handler-change utility that compares the macOS Launch Services PDF handler against PDF Magic Opener's installed bundle identifier.
  • Reuse the PDF-specific registeredPDFHandlerBundleIdentifier() lookup already merged in PR #59, rather than duplicating the native handler-query logic or using the unrelated default web browser.
  • Return distinct statuses: 0 when PDF Magic Opener remains default, 2 when another application has taken over (displaying its bundle ID), and 1 when the association cannot be determined. Re-read the association on every check and do not mistake an unknown handler for a change.
  • Build and deploy the check as an optional CLI utility; document its usage, result codes, and how to restore the opener only if the user chooses. The detector does not run persistently in the background or change the PDF association.

Why

The installed set-pdf-default-handler.swift can register the opener and the merged identify-pdf-handler.swift can report the current PDF handler, but no existing command distinguishes opener still default from another application has become default. This focused change provides that distinction without silently reverting user customizations.

Verification

  • Add synthetic macOS regression coverage for opener → Preview, opener → Adobe Reader, restoration, absent registration, and fresh lookup on each check.
  • Compile and execute the detector tests within the existing required macos-build CI job; keep scanner-tests unchanged.
  • Require both CI jobs to pass against the final PR head; confirm the PR is squash-merged and GitHub reports merged=true.

Scope and preservation

Only the PDF default-association detection is changed. There are no changes to ClamAV, quarantine, scanner caching, user-selected browsers, opener association registration, fallback behavior or user's PDF settings. No secret-bearing files were accessed. The isolated branch is pdf-handler-takeover. The available GitHub connection publishes as JFWooten4; no alternate identity or credentials were accessed.

JFWooten4 and others added 3 commits October 27, 2026 18:35
Compare each read-only Launch Services PDF-handler lookup with the PDF Magic
Opener bundle identity, returning separate statuses for unchanged, takeover,
and unknown registrations. Add native tests and installer/CLI documentation.

Co-authored-by: ChatGPT # 6 <noreply@openai.com>
Co-authored-by: ChatGPT # 6 <noreply@openai.com>
Preserve the merged read-only status command and its CI/installer/docs changes
alongside the distinct takeover detection exit statuses and native tests.

Co-authored-by: ChatGPT # 6 <noreply@openai.com>
@JFWooten4
JFWooten4 merged commit e3d4389 into main Oct 27, 2026
2 checks passed
@JFWooten4
JFWooten4 deleted the pdf-handler-takeover branch October 27, 2026 22:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant