Skip to content

armgit / cra

Public Imported from GitHub
0

The open-source Arc replacement for macOS. Spaces, pinned tabs, split view, Little Windows and Arc's shortcuts on Chromium, with your Arc sidebar imported in one go.

Support Cra: GitHub Sponsors button, README section, Help menu links

Victorce2cd5fe4e2b
diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml
new file mode 100644
index 0000000..e19ed02
--- /dev/null
+++ b/.github/FUNDING.yml
@@ -0,0 +1,2 @@
+github: VictorKildahl
+custom: ["https://crabrowser.app/support"]
diff --git a/README.md b/README.md
index 69c7dad..ac9e2d1 100644
--- a/README.md
+++ b/README.md
@@ -23,6 +23,14 @@ like any other app, and from then on it keeps itself up to date (Cra ▸ Check f
curl -fsSL https://raw.githubusercontent.com/VictorKildahl/cra/main/scripts/install.sh | bash
+## Support Cra
+
+Cra is free, open source and has no investors or ads. If it earns a place on your Mac,
+[sponsor it on GitHub](https://github.com/sponsors/VictorKildahl): it pays for the Chromium
+updates, the Apple signing and the time it takes to keep a browser going. Sponsoring unlocks
+nothing in the app; every feature stays free for everyone.
+[Where the money goes](https://crabrowser.app/support).
+
## Build
scripts/build.sh # fetches CEF on first run, builds build/Cra.app
diff --git a/Sources/Cra/App/AppDelegate.swift b/Sources/Cra/App/AppDelegate.swift
index 1aa0d80..6712294 100644
--- a/Sources/Cra/App/AppDelegate.swift
+++ b/Sources/Cra/App/AppDelegate.swift
@@ -900,12 +900,28 @@ final class AppDelegate: NSObject, NSApplicationDelegate, NSMenuItemValidation {
let help = NSMenu(title: "Help")
help.addItem(withTitle: "Chromium \(CraCEFRuntime.chromiumVersion()) · CEF \(CraCEFRuntime.cefVersion())", action: nil, keyEquivalent: "")
+ help.addItem(.separator())
+ for (title, url) in [("Cra Help", "https://crabrowser.app/help"), ("Release Notes", "https://crabrowser.app/release-notes"),
+ ("Report an Issue…", "https://github.com/VictorKildahl/cra/issues"), ("Support Cra…", "https://crabrowser.app/support")] {
+ let link = NSMenuItem(title: title, action: #selector(openHelpLink(_:)), keyEquivalent: "")
+ link.target = self
+ link.representedObject = url
+ help.addItem(link)
+ }
menubar.addItem(submenu: help, title: "Help")
NSApp.helpMenu = help
NSApp.mainMenu = menubar
}
+ /// Help menu links open as a tab in the normal window in use, like Arc's.
+ @objc private func openHelpLink(_ sender: NSMenuItem) {
+ guard let url = sender.representedObject as? String else { return }
+ useNormalWindow()
+ store.createTab(url: url, select: true)
+ main.showWindow(nil)
+ }
+
@objc private func showAbout() {
let info = Bundle.main.infoDictionary
let version = info?["CFBundleShortVersionString"] as? String ?? ""