brave / browser-laptop

[DEPRECATED] Please see https://github.com/brave/brave-browser for the current version of Brave
https://www.brave.com
Other
7.94k stars 975 forks source link

Support for "Add to desktop" (PWA support) #8239

Closed sorin-davidoi closed 6 years ago

sorin-davidoi commented 7 years ago

Cannot seem to find an official description of this feature in the Chrome documentation, but what it essentially does (at least on Linux) is integrate with the desktop environment (KDE Plasma 5.9.4 in this case) - appears in the start menu, is launched in "Application Mode" and appears to be a native app.

More specifically, for hangouts.google.com it creates a file called chrome-odadmohlkalmmfdgjdlbjdpoekbijhcc-Default in ~/.local/share/applications/:

[Desktop Entry]
Comment[en_US]=
Comment=
Exec=/opt/google/chrome/google-chrome --profile-directory=Default --app-id=odadmohlkalmmfdgjdlbjdpoekbijhcc
GenericName[en_US]=
GenericName=
Icon=/home/<name>/.local/share/icons/hicolor/256x256/apps/chrome-odadmohlkalmmfdgjdlbjdpoekbijhcc-Default.png
MimeType=
Name[en_US]=Google Hangouts
Name=Google Hangouts
Path=
StartupNotify=true
StartupWMClass=crx_odadmohlkalmmfdgjdlbjdpoekbijhcc
Terminal=false
TerminalOptions=
Type=Application
Version=1.0
X-DBUS-ServiceName=
X-DBUS-StartupType=
X-KDE-SubstituteUID=false
X-KDE-Username=

The following screenshots are takes with an "App" created with Chrome Version 57.0.2987.133 (64-bit).

screenshot_20170411_225102 screenshot_20170411_225447 screenshot_20170411_225527

bobsobol commented 6 years ago

Obviously, the tag "OS/unix-like/linux" applies to the specifics, but the general issue exists on all OS. As stated, the option is missing on Mac, (still, Unix-like) but I can confirm there is no such option on Windows either, where Chrome does offer it on all supported OS. A .lnk file is created in leau of the .desktop found on Free Desktop compliant desktop OS, but the target is in the same format. I presume xdg-utils is used to determine the "desktop" location on desktop Linux, as some distros no longer support icons on the desktop, and it will appear in the launcher menu under the group "Other" or "Internet" on those.

On Windows, a "Add to desktop..." icon also appears under "Chrome Apps..." on the Start Menu / Screen. Presumably in case you (or your system \ domain administrator) have enabled the Group Policy template "Hide and disable all items on the desktop" from User Configuration -> Administrative Templates -> Desktop.

In any case, I'd like to promote this option, since whatever OS I'm using, this feature, to enable Web Apps to operate seamlessly alongside locally installed software, (with the "Open as window" option checked) is probably my primary use of Chrome / Chromium. If Firefox started implementing it, I'd look more favourably upon it than Brave, and the WebPin project (primarily targeting elementaryOS ... https://github.com/artemanufrij/webpin) is the biggest thing freeing systems I can use it on from the bloat of Chrome.

I believe Mozilla.org, having tried such a project, cancelled it again, primarily on the grounds that it was a security risk. I disagree, but respect that decision. I think it would be great if Brave also disagreed with them, and I'll also note that Chrome originally had a --app switch which opened any URI passed Chromeless, which mean you could open arbitrary addresses programatically (potential threat?) but also meant icons weren't tied to a Chrome user profile, and where human readable. The app-id specified relates to a hash, based upon the user profile in which the "app" is installed, as it would be on the ChromeOS of a Chromebook. Installed desktop icons may be local apps from the Play Store, listed as "Offline" apps for ChromeOS. If an --app switch could be passed to Brave, which opened an address in a window with no tabs, and no bookmark bar, that would be very close to a complete implementation. Though I'm sure you'd want to consider, and discuss the implications further first.

The feature is also similar to .hta files on Windows, which (being bound to IE, and Explorer) really were a security threat, and have limited functionality now.