Skip to content

Commit f2125d0

Browse files
committed
feat(lib/createProtocol): support custom partitions
fixes #1150
1 parent 443660e commit f2125d0

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

lib/createProtocol.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ import * as path from 'path'
33
import { readFile } from 'fs'
44
import { URL } from 'url'
55

6-
export default (scheme) => {
7-
protocol.registerBufferProtocol(
6+
export default (scheme, customProtocol) => {
7+
(customProtocol || protocol).registerBufferProtocol(
88
scheme,
99
(request, respond) => {
1010
let pathName = new URL(request.url).pathname

lib/index.d.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
1-
export function createProtocol(scheme: string): void
1+
import { Protocol } from 'electron'
2+
3+
export function createProtocol(scheme: string, customProtocol?: Protocol): void
24
export function installVueDevtools(forceDownload?: boolean): Promise<string>

0 commit comments

Comments
 (0)