Skip to content

Comments

fix: extensions stuff and safari import#303

Merged
judekim0507 merged 2 commits intonook-browser:devfrom
judekim0507:dev
Feb 18, 2026
Merged

fix: extensions stuff and safari import#303
judekim0507 merged 2 commits intonook-browser:devfrom
judekim0507:dev

Conversation

@judekim0507
Copy link
Member

@judekim0507 judekim0507 commented Feb 18, 2026

WIP for oauth

Summary by CodeRabbit

Release Notes

  • New Features

    • Added Safari Extensions discovery and installation support for macOS 15.5+
    • Implemented automatic URL permission approval for pre-authorized domains
  • Improvements

    • Enhanced macOS trackpad scroll and page navigation with snappier transitions
    • Improved extension window state management (minimize, maximize, fullscreen)
    • Strengthened native messaging protocol with improved error handling and diagnostics

@judekim0507 judekim0507 marked this pull request as ready for review February 18, 2026 05:33
@judekim0507 judekim0507 merged commit 6e16021 into nook-browser:dev Feb 18, 2026
1 of 2 checks passed
@coderabbitai
Copy link

coderabbitai bot commented Feb 18, 2026

Caution

Review failed

The pull request is closed.

📝 Walkthrough

Walkthrough

Adds Safari Extension discovery/installation UI and workflows, introduces WebKit MAIN-world bridge for externally_connectable messaging, improves extension manager diagnostics and native messaging buffering, ensures per-tab userContentController isolation, and adds macOS horizontal scroll-driven page navigation.

Changes

Cohort / File(s) Summary
Safari Extensions UI
Nook/Components/Settings/SettingsView.swift
Adds Safari extensions discovery UI, scan/install flows, SafariExtensionRowView, and conditional macOS 15.5+ section to list available/installed Safari extensions.
Extension Manager Core
Nook/Managers/ExtensionManager/ExtensionManager.swift, Nook/Managers/ExtensionManager/ExtensionBridge.swift
Implements externally_connectable bridge (injects nook_bridge.js), MAIN‑world manifest patching, Safari extension discovery/install (resolve .app/.appex resources), enhanced diagnostics/logging, background health probes, and native messaging buffering/robust I/O. Also refines window state transitions and replaces prints with Logger.
WebView userContentController sharing
Nook/Models/BrowserConfig/BrowserConfig.swift, Nook/Managers/WebViewCoordinator/WebViewCoordinator.swift
Adds freshUserContentController() to clone shared user scripts into per-tab controllers; replaces direct WKUserContentController() use to avoid cross-tab handler conflicts while preserving shared scripts.
macOS Page Navigation
Nook/ThirdParty/BigUIPaging/.../PlatformPageView+macOS.swift
Adds coordinator scroll-wheel handling, horizontal gesture detection, navigateByDirection() animated page switching, NSPageController integration, and view lifecycle/caching adjustments for snappy navigation.
Misc Diagnostics & Logging
Nook/Managers/ExtensionManager/...
Many internal files updated to use structured Logger, add diagnostic helpers, and improve logging across extension lifecycle and probes.

Sequence Diagrams

sequenceDiagram
    participant User as User
    participant UI as SettingsView
    participant Mgr as ExtensionManager
    participant Sys as System/FS
    
    User->>UI: Tap "Scan for Safari Extensions"
    UI->>Mgr: scanForSafariExtensions()
    Mgr->>Sys: discoverSafariExtensions()
    Sys-->>Mgr: [SafariExtensionInfo...]
    Mgr-->>UI: Return results (main thread)
    UI->>UI: showSafariSection = true / render list

    User->>UI: Tap "Install" on extension
    UI->>Mgr: installSafariExtension(info)
    Mgr->>Mgr: resolve resources, patch manifest, setup bridge
    Mgr->>Sys: copy/install to temp/location
    Sys-->>Mgr: success / error
    Mgr-->>UI: completion handler (update UI / show alert)
Loading
sequenceDiagram
    participant User as User/ScrollWheel
    participant Coord as Page Coordinator
    participant NSPg as NSPageController
    participant Views as Hosted Views

    User->>Coord: scrollWheel(event)
    alt horizontal swipe detected
        Coord->>Coord: compute direction & trigger navigateByDirection()
        Coord->>NSPg: go(to: targetIndex)
        NSPg->>Views: animate transition (0.18s)
        Views-->>NSPg: transition complete
        NSPg-->>Coord: selection updated
        Coord->>Parent: update selection binding
    else vertical/other
        Coord-->>Views: forward event (default handling)
    end
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

  • refactor: extension #299: Overlapping extension-related changes touching ExtensionsSettingsView, ExtensionBridge, and WebView userContentController logic — likely continuation or related integration work.

Suggested labels

in progress

Poem

🐰 I hopped through bridges, scripts, and spice,
Found Safari bundles, tidy and nice.
I scanned, I patched, then helped them land,
Scrolls now glide with a gentle hand.
Hop on — the browser blooms tonight! 🚀

✨ Finishing Touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Comment @coderabbitai help to get the list of available commands and usage tips.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant