Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open in editor #43

Open
andyherbert opened this issue May 12, 2020 · 9 comments
Open

Open in editor #43

andyherbert opened this issue May 12, 2020 · 9 comments

Comments

@andyherbert
Copy link

Theoretically I can register uri handler so a button on the page pointing to, for example moebius://fetch/16colo.rs/pack/... could direct Moebius to fetch the uri and open it directly in the editor, although this would mean on the Windows side registering a protocol handler which apparently requires one of those 'this application needs to make changes' security popup when the application is installed (and therefore unavailable in the portable version).

@andyherbert
Copy link
Author

Apparently there's a reliable cross platform way to detect if a protocol has a handler (which seems a minor security issue), so people unable to use the feature presumably wouldn't need to know about it.

@bart-d
Copy link
Contributor

bart-d commented May 12, 2020

Apparently there's a reliable cross platform way to detect if a protocol has a handler (which seems a minor security issue), so people unable to use the feature presumably wouldn't need to know about it.

what exactly is this reliable cross platform way to detect if a protocol has a handler?

@andyherbert
Copy link
Author

I'm only basing that on a very superficial google search and judging the reliability from comments to solutions.

@bart-d
Copy link
Contributor

bart-d commented May 12, 2020

what if we avoid the protocol handler and use a custom mimetype like eg application/vnd.moebius, do you have a way of registering that with the browser upon installation?

@andyherbert
Copy link
Author

It appears that Electron Builder has a method of registering mime-types as part of the linux app bundle specifically, I think it only has a provision for registering file associations based on the filename extension. There's no mention on how registering a mime type on Linux changes the behaviour of apps that recognise the mime-type.

@bart-d
Copy link
Contributor

bart-d commented May 17, 2020

i was thinking yesterday about a totally different way of handling this while avoiding URL hanlders and MIME types: we could constrauct a .ans which contains the location of the file to download. a capable editor would parse the URL and not show this 'placeholder' ansi and directly fetch the referenced .ans from 16c. a non-capable editor would open the .ans where we have some generic info display along the URL to inform the user his editor can't handle it.

@andyherbert
Copy link
Author

We could be talking past each other here because wouldn’t an ansi have to be loaded in an editor for that to work? I meant that there’s a button on a webpage saying ‘load in editor’ you click it and the editor fetches it. Sort of like the opposite of a paste service.

@bart-d
Copy link
Contributor

bart-d commented May 17, 2020

Yes, but both Moebius and PD register as default for opening files of certain extensions, so that part is already covered. but i realize now, that sort of already works. when i click the filename i get offered open or save. choosing open will open it in Moebius anyway.

@andyherbert
Copy link
Author

I see now that we're talking about different things. I meant circumventing the need to download a file, you click a link on the page, the app appears frontmost and fetches the ansi from the site. There's no saving to disk, or having to open manually.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants