Turn any website into a lightweight desktop app with one command, on macOS, Windows and Linux.
Rust chatgptclaudeclidesktopdesktop-appelectron-alternativegeminilinuxmacosnativefierno-electronrusttauriweb-to-desktopwebsite-to-appwebviewwindowsyoutube
fix: keep GitHub release pages in the webview (#1337)
MildyNora8d662a5369fc
diff --git a/src-tauri/src/inject/event.js b/src-tauri/src/inject/event.jsindex d0b980be..154e83a4 100644--- a/src-tauri/src/inject/event.js+++ b/src-tauri/src/inject/event.js@@ -451,7 +451,6 @@ const DOWNLOAD_PATH_PATTERNS = ["/files/","/attachments/","/assets/",- "/releases/","/dist/",];diff --git a/tests/unit/event-link-guard.test.js b/tests/unit/event-link-guard.test.jsindex 242e11d0..a6fbe1f3 100644--- a/tests/unit/event-link-guard.test.js+++ b/tests/unit/event-link-guard.test.js@@ -182,6 +182,51 @@ describe("event link guard", () => {);});+ it("navigates GitHub release pages instead of downloading them as documents", () => {+ const context = loadEventHelpers({ withTauri: true });+ context.window.location.href = "https://github.com/owner/repo/releases";+ runDomReady(context);++ const event = makeClickEvent(+ makeAnchor("https://github.com/owner/repo/releases/tag/v1.28.3", "_self"),+ );+ getClickGuard(context)(event);++ expect(event.preventDefault).not.toHaveBeenCalled();+ expect(event.stopImmediatePropagation).not.toHaveBeenCalled();+ expect(context.invokeCalls).not.toContainEqual([+ "download_file",+ expect.anything(),+ ]);+ });++ it("still downloads files linked from GitHub releases", () => {+ const context = loadEventHelpers({ withTauri: true });+ context.window.location.href = "https://github.com/owner/repo/releases";+ runDomReady(context);++ const event = makeClickEvent(+ makeAnchor(+ "https://github.com/owner/repo/releases/download/v1.28.3/app.dmg",+ "_self",+ ),+ );+ getClickGuard(context)(event);++ expect(event.preventDefault).toHaveBeenCalled();+ expect(event.stopImmediatePropagation).toHaveBeenCalled();+ expect(context.invokeCalls).toContainEqual([+ "download_file",+ {+ params: {+ url: "https://github.com/owner/repo/releases/download/v1.28.3/app.dmg",+ filename: "app.dmg",+ language: "en-US",+ },+ },+ ]);+ });+it("navigates macOS auth URLs in the current window", () => {const { openAuthNavigation, window } = loadEventHelpers({userAgent: "Mozilla/5.0 (Macintosh; Intel Mac OS X 15_5)",