
Hacker news unofficial desktop app - dothash
https://github.com/bjarneo/HNU
======
Mithaldu
Note: This "desktop app" is a web app built on Electron, which is a JS library
that runs chrome for you. So this app will clock in at roughly 200+ mb ram, in
addition to what your system is already running.

~~~
cm3
Yeah, it's not a desktop app but web app running in a separate browser that
has no chrome. HN integration in Emacs is a desktop app because it actually
provides a different way to interact with HN and this is the same web page,
just rendered in a silo'd window.

------
Mister_Snuggles
Since this is an Electron-based app, I figure this is as good a place as any
to ask something that I don't understand about Electron...

How well can an Electron-based app fit in with the underlying operating
system?

If running on a Mac, can an Electron-based app expose itself via AppleScript
so that other applications can interact with them? If running on Windows, can
it expose itself via COM? On Linux can it register itself with DBus (I'm not
sure if this even makes sense - what's the Linux equivalent of
COM/AppleScript)?

On the Mac, does the stuff in the Services menu work? Do text fields get
automatic spell-check? Can I double-tap 'fn' to start dictation? Can it expose
itself to the Accessibility stuff in a meaningful manner?

These things don't make sense for all applications. I can't think of why I'd
want to interact with an HN application via AppleScript (or COM), for example,
but there are other types of applications where being able to do this would be
great (Excel and Word base their entire macro facility on COM, for example).

I can see wanting to use Dictation in an HN app as it might make commenting
easier for some people. Same goes for the text field spell-checking.

I guess the big question is, where can an Electron app fit in the spectrum
between 'web site rendered in a dedicated application' and 'full-blown
Windows/Mac/Linux desktop application'?

~~~
Mithaldu
Not an electron, or node developer, but based on my experience: As long as
there's a library to do this available for node, it can do all those things,
since the node part of the software can talk to the browser part, and the
browser part can talk back. So for anything you'd need to have the browser
talk to the OS to, if node can do the talking, then the web page running in
electron can do it too, via node.

~~~
Mister_Snuggles
So then the question becomes, how many developers take the extra effort to
make their Electron application a first-class citizen on each platform?

My guess is that almost none of them bother. I looked at the documentation for
Atom, which seems to be the flagship Electron application, and there's no
mention of its API being exposed to the system (AppleScript on MacOS and COM
on Windows), even though it does have a very rich API.

A quick search seems to confirm that there is no useful AppleScript support:

[https://discuss.atom.io/t/applescript-
support/1439](https://discuss.atom.io/t/applescript-support/1439)

[https://discuss.atom.io/t/accessing-the-contents-of-a-
window...](https://discuss.atom.io/t/accessing-the-contents-of-a-window-via-
applescript/22048)

The second discussion mentions that there is a dictionary, my guess would be
that it comes from the underlying Chrome browser. Interestingly enough,
looking at the dictionary for Google Chrome, it appears that they have made an
effort to expose things that make sense for a browser to expose to
AppleScript.

------
32XY
If you select "Add to desktop..." under "More tools" in Chrome and check the
"Open as window" option it will look the same as this :)

~~~
foxylion
I didn't know this, absolutely great. Now I have some of my "always open tabs"
as separate windows without the bookmarks and omnibox.

------
psheets
What is the benefit of this over using a browser?

~~~
PeCaN
None, given that it essentially runs in a browser anyway (Electron). I suppose
it's very useful if you have ~200MB of RAM and ~80MB disk space that you
really want to get rid of.

I hate Electron. :-|

~~~
tomc1985
Qt/GTK/WinForms or GTFO!

~~~
snuxoll
WPF/UWP instead of WinForms and I agree. I don't even get why so many people
like writing web apps, I feel a hell of a lot more comfortable working with a
proper widget toolkit (my preference being GTK or WPF) without the constraints
enforced on me by a browser and JavaScript.

~~~
tomc1985
It's because there are a lot of people here obsessed with reaching the largest
possible audience they possibly can. And since every brother and their mother
are on mobile, or, at least, a web browser...

The way I see it, mainstream masses are finally (FINALLY!) leaving the world
of desktop computing behind, so now it can return to the nerds and people who
just wanna do shit

~~~
iamcreasy
How about new ideas like WebAssembly?

~~~
snuxoll
WebAssembly just makes a better target for transpilers, it doesn't really do
anything to make developing "desktop" apps inside browsers easier.

