Open in desktop #6667

Closed
btzr-io wants to merge 13 commits from protocol into master
2 changed files with 7 additions and 10 deletions
Showing only changes of commit f87a212b32 - Show all commits

View file

@ -45,13 +45,12 @@ let daemon;
let lbryFirst;
const appState = {};
const PROTOCOL = 'lbry'
const PROTOCOL = 'lbry';
if (isDev && process.platform === 'win32') {
// Setting this is required to get this working in dev mode.
app.setAsDefaultProtocolClient(PROTOCOL, process.execPath, [
path.resolve(process.argv[1])
path.resolve(process.argv[1]),
]);
} else {
app.setAsDefaultProtocolClient(PROTOCOL);
@ -157,11 +156,11 @@ if (!gotSingleInstanceLock) {
// Send the url to the app to navigate first, then focus
if (rendererWindow) {
// External uri (last item on argv):
const EXTERNAL_URI = argv[argv.length ? (argv.length-1) : 0]
const EXTERNAL_URI = (argv.length) ? argv[argv.length - 1] : '';
// Handle protocol requests for windows and linux
const platforms = (process.platform === 'win32' || process.platform === 'linux')
const platforms = (process.platform === 'win32' || process.platform === 'linux');
// Is LBRY protocol
const isProtocolURI = String(EXTERNAL_URI).startsWith(PROTOCOL)
const isProtocolURI = String(EXTERNAL_URI).startsWith(PROTOCOL + '://');
// External protocol requested:
if (platforms && isProtocolURI) {
let URI = EXTERNAL_URI;
@ -210,7 +209,7 @@ if (!gotSingleInstanceLock) {
if (details.method === 'POST' && details.requestHeaders['Content-Type'] === 'application/json-rpc') {
delete details.requestHeaders['Origin'];
}
callback({ cancel: false, requestHeaders: details.requestHeaders });
callback({ cancel: false, requestHeaders: details.requestHeaders, });
});
});
}

View file

@ -2064,12 +2064,10 @@
"Skip Navigation": "Skip Navigation",
"Reset": "Reset",
"Reset to original (previous) publish date": "Reset to original (previous) publish date",
"Show reply": "Show reply",
"Show %count% replies": "Show %count% replies",
"Open in Desktop": "Open in Desktop",
"%title% by %channelTitle%": "%title% by %channelTitle%",
"%title% by %channelTitle% %ariaDate%": "%title% by %channelTitle% %ariaDate%",
"%title% by %channelTitle% %ariaDate%, %mediaDuration%": "%title% by %channelTitle% %ariaDate%, %mediaDuration%",
"Search for something...": "Search for something...",
"Open in Desktop": "Open in Desktop",
"--end--": "--end--"
}