URI handling (WIP) #116

Merged
alexliebowitz merged 5 commits from uri-handling into master 2017-05-08 16:11:19 +02:00
alexliebowitz commented 2017-05-05 11:20:26 +02:00 (Migrated from github.com)

Implements opening LBRY URIs using Electron's built-in support.

Electron only has very basic support for this: on Mac it works well, but on Windows it can only pass the URI in as a command line argument (i.e. you can't launch URIs in an app that's already running), and there's no Linux support at all yet.

I'm thinking we'd be best off to use the built-in functionality like this, and then eventually hack on improvements for Win and Linux. Here are some ideas about how to do it in Linux.

Implements opening LBRY URIs using Electron's built-in support. Electron only has very basic support for this: on Mac it works well, but on Windows it can only pass the URI in as a command line argument (i.e. you can't launch URIs in an app that's already running), and there's no Linux support at all yet. I'm thinking we'd be best off to use the built-in functionality like this, and then eventually hack on improvements for Win and Linux. [Here are some ideas](https://github.com/electron/electron/issues/4857#issuecomment-201124281) about how to do it in Linux.
kauffj (Migrated from github.com) reviewed 2017-05-05 11:20:26 +02:00
lyoshenka commented 2017-05-08 16:02:34 +02:00 (Migrated from github.com)

Nice. Gonna test this after I'm done with api stuff. Should this validate that the requested URI is a valid URI? what if they request x&sendcreditstohacker=100000

Nice. Gonna test this after I'm done with api stuff. Should this validate that the requested URI is a valid URI? what if they request `x&sendcreditstohacker=100000`
kauffj commented 2017-05-08 16:12:07 +02:00 (Migrated from github.com)

Oops, possibly shouldn't have merged this, was discussing with Alex on Slack and missed @lyoshenka's latest comment.

Oops, possibly shouldn't have merged this, was discussing with Alex on Slack and missed @lyoshenka's latest comment.
alexliebowitz commented 2017-05-08 21:30:45 +02:00 (Migrated from github.com)

This doesn't directly alter window.location. It calls App.showUri() which updates the UI to display the Show page. That function does alter the current URI stored in state and creates a history item, but even there it runs the LBRY URI through encodeURIComponent so I don't think there's any potential for injection attacks.

We should probably add a separate error page for invalid URIs, though. Right now it just silently does nothing (at least on master; might have changed on Redux).

This doesn't directly alter window.location. It calls App.showUri() which updates the UI to display the Show page. That function does alter the current URI stored in state and creates a history item, but even there it runs the LBRY URI through encodeURIComponent so I don't think there's any potential for injection attacks. We should probably add a separate error page for invalid URIs, though. Right now it just silently does nothing (at least on master; might have changed on Redux).
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: LBRYCommunity/lbry-desktop#116
No description provided.