Skip to content

A games launcher for GOG, Amazon and Epic Games for Linux, Windows and macOS.

[Fix] Add itchio support to protocol handling (#6123)

Flávio Fearnd9ef8e6ecc27
diff --git a/src/backend/__tests__/protocol.test.ts b/src/backend/__tests__/protocol.test.ts
index 59f522103..0062ca1b9 100644
--- a/src/backend/__tests__/protocol.test.ts
+++ b/src/backend/__tests__/protocol.test.ts
@@ -73,6 +73,9 @@ jest.mock('../storeManagers', () => ({
},
steam: {
getGame: jest.fn()
+ },
+ itchio: {
+ getGame: jest.fn()
}
}
}))
@@ -158,6 +161,9 @@ describe('protocol.ts --no-gui behavior', () => {
;(libraryManagerMap.steam.getGame as jest.Mock).mockReturnValue(
emptyGameInfoMock
)
+ ;(libraryManagerMap.itchio.getGame as jest.Mock).mockReturnValue(
+ emptyGameInfoMock
+ )
})
describe('when game is not installed', () => {
diff --git a/src/backend/protocol.ts b/src/backend/protocol.ts
index d83ed58cd..dcfee1b76 100644
--- a/src/backend/protocol.ts
+++ b/src/backend/protocol.ts
@@ -12,7 +12,15 @@ import { Path } from './schemas'
import { isCLINoGui } from './constants/environment'
import { GlobalConfig } from './config'
-const RUNNERS = z.enum(['legendary', 'gog', 'nile', 'sideload'])
+// Every runner that gets heroic:// shortcuts, which excludes steam
+const RUNNERS = z.enum([
+ 'legendary',
+ 'gog',
+ 'sideload',
+ 'nile',
+ 'zoom',
+ 'itchio'
+])
function parseHeroicUrl(args: string[]): URL | undefined {
const urlStr = args.find((arg) => arg.startsWith('heroic://'))