URL Helper à la "atom://"


#1

Hi

The ability to open a file via HREF would be very nice e.g. when working with Ruby gems such as Better Errors.

This is how TextMate does it:

https://manual.macromates.com/en/using_textmate_from_terminal.html

(Jump to “21.2 URL Scheme (HTML)”)

Cheers!

PS: Good job so far!


#2

Looks like atom:// is registered in OSX to Atom.app as a URL handler however it’s only being used internally to show things like the release notes and settings pages.


#3

I’ve configured Better Errors to build Sublime-like URLs such as:

atom://open?url=file://%2FUsers%2Fsvoop%2FDevelopment%2Fmyproject%2Fapp%2Fcontrollers%2Fapplication_controller.rb&line=41

On Firefox, I’ve chosen this URL to open Atom. Yet Atom throws quite a spectacular exception:

http://tinypic.com/r/1zykb2e/8


Using atom:// to open a file from the web?
#4

I’ve attempted to create a URL handler atom-handler, similar to TextMate’s and Sublime’s. I’ve used atm:// as the URL scheme to avoid conflicting with the atom:// scheme registered by Atom.app as noted by @rjocoleman.

It works for me locally. I’m interested to see if it works for others.


Atom:// protocol handler
#5

I was thinking this’d be really nice for installing packages. For instance, on a package page like this, it could have an Install button directly on the package page, rather than requiring I go to prefs, search, and then hit install in there.


#6

@WizardOfOgz Works like a charm, thank you! However, I hope Atom will register a handler itself in a future release because it’s pretty ridiculous having to use utilities for such a basic use case.


#7

Oh, I see now that it works almost like a charm. The file is opened, but the cursor is not set to the specified line.


#8

I’ve logged an issue about the cursor and scrolling when a file is opened. File is not always scrolled to the correct line number [Command Line]


#9

Exactly. This would be so helpful. Sorry for bumping this thread.

I want to promote my package on my website, and explain how to install the package in Atom. Ideally I provide my users an install link e.g. atom://packages/koala?install=true which opens the package preview page in Atom and asks for confirmation to install the package. Additionally, all packages on the site can have an install button on it as well.

It’s key the url handling becomes available in core and not as a separate package.


#10

Sweet, this works like a charm! Thank you!!!


#11

To those coming here for the same reason as I did there’s both:


#12