Doesn't work with Brave Browser-created "Chrome" apps
See original GitHub issueYour Environment
- Version used: 2.1.28
- Operating System and version: Ubuntu Linux 18.04
- Desktop Environment: Default (GNOME 3?)
- Node version: v8.10.0
Expected Behavior
“Apps” created by using More tools -> Create shortcut in Brave should be saved properly.
Current Behavior
This happens:
$ lwsm save
findDesktopFile cant find file; searched patterns [ '/home/kevin/.local/share/applications/*chrome-pofoocnjclhmhkhkgibipddgekdlnfmj*.desktop',
'/home/kevin/.local/share/applications/**/*chrome-pofoocnjclhmhkhkgibipddgekdlnfmj*.desktop',
'/home/kevin/.gnome/apps//*chrome-pofoocnjclhmhkhkgibipddgekdlnfmj*.desktop',
'/home/kevin/.gnome/apps//**/*chrome-pofoocnjclhmhkhkgibipddgekdlnfmj*.desktop',
'/usr/share/applications/*chrome-pofoocnjclhmhkhkgibipddgekdlnfmj*.desktop',
'/usr/share/applications/**/*chrome-pofoocnjclhmhkhkgibipddgekdlnfmj*.desktop',
'/usr/local/share/applications/*chrome-pofoocnjclhmhkhkgibipddgekdlnfmj*.desktop',
'/usr/local/share/applications/**/*chrome-pofoocnjclhmhkhkgibipddgekdlnfmj*.desktop',
'/usr/share/app-install/*chrome-pofoocnjclhmhkhkgibipddgekdlnfmj*.desktop',
'/usr/share/app-install/**/*chrome-pofoocnjclhmhkhkgibipddgekdlnfmj*.desktop',
'/home/kevin/.config/autostart//*chrome-pofoocnjclhmhkhkgibipddgekdlnfmj*.desktop',
'/home/kevin/.config/autostart//**/*chrome-pofoocnjclhmhkhkgibipddgekdlnfmj*.desktop',
'/var/lib/snapd/desktop/applications/*chrome-pofoocnjclhmhkhkgibipddgekdlnfmj*.desktop',
'/var/lib/snapd/desktop/applications/**/*chrome-pofoocnjclhmhkhkgibipddgekdlnfmj*.desktop',
'/var/lib/flatpak/app/*chrome-pofoocnjclhmhkhkgibipddgekdlnfmj*.desktop',
'/var/lib/flatpak/app/**/*chrome-pofoocnjclhmhkhkgibipddgekdlnfmj*.desktop',
'/snap/bin/*chrome-pofoocnjclhmhkhkgibipddgekdlnfmj*.desktop',
'/snap/bin/**/*chrome-pofoocnjclhmhkhkgibipddgekdlnfmj*.desktop' ]
util: Generic Error findDesktopFile cant find file; searched patterns undefined
util: { '0': 'findDesktopFile cant find file; searched patterns' }
Generic Error in Meta Wrapper TypeError: Cannot read property 'split' of undefined
at findDesktopFile.then (/usr/local/lib/node_modules/linux-window-session-manager/lib/metaWrapper.js:194:35)
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:188:7) TypeError: Cannot read property 'split' of undefined
at findDesktopFile.then (/usr/local/lib/node_modules/linux-window-session-manager/lib/metaWrapper.js:194:35)
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:188:7)
Generic Error in Meta Wrapper TypeError: Cannot read property 'split' of undefined
at findDesktopFile.then (/usr/local/lib/node_modules/linux-window-session-manager/lib/metaWrapper.js:194:35)
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:188:7) TypeError: Cannot read property 'split' of undefined
at findDesktopFile.then (/usr/local/lib/node_modules/linux-window-session-manager/lib/metaWrapper.js:194:35)
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:188:7)
Generic Error in Meta Wrapper TypeError: Cannot read property 'split' of undefined
at findDesktopFile.then (/usr/local/lib/node_modules/linux-window-session-manager/lib/metaWrapper.js:194:35)
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:188:7) TypeError: Cannot read property 'split' of undefined
at findDesktopFile.then (/usr/local/lib/node_modules/linux-window-session-manager/lib/metaWrapper.js:194:35)
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:188:7)
(node:31016) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'split' of undefined
at findDesktopFile.then (/usr/local/lib/node_modules/linux-window-session-manager/lib/metaWrapper.js:194:35)
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:188:7)
(node:31016) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)
(node:31016) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
Steps to Reproduce (for bugs)
- Install Brave Browser from https://brave.com/download/
- Go to any site. http://example.com will do
- Click the menu under the minimize/maximize/close buttons at the top-right of the window
- Under “More tools”, click “Create shortcut” and choose “Open as window” in the dialog that pops up.
- Once done, ensure the app is open and try
lwsm save
.
Notes
The issue is that Brave saves the files with a brave-
prefix instead of a chrome-
one. So you need to check WM_CLASS(STRING)
for something like:
WM_CLASS(STRING) = "crx_hppgbgfhlaeddfkdifgnpndnccffohpn", "Brave-browser"
Here we see "Brave-browser"
in the second position. It wasn’t immediately clear to me how to modify the program to do this, since by that point in the pipeline we’re already dealing with a filename, and I wasn’t sure if the WM_CLASS
value was still in scope anywhere.
Example Brave filename: /home/kevin/.local/share/applications/brave-ddiddklncfgbfaaahngklemobghhjkim-Default.desktop
I can work around this by just changing the prefix manually. It doesn’t seem to break the apps (haven’t tried uninstalling one yet; unsure if it would fail to clean up the desktop file).
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:8 (5 by maintainers)
Top GitHub Comments
Thanks for opening up this issue (and actually taking the time to fill out all the required information, people tend to forget 😉).
I’m pretty busy for the next weeks, but will probably check the one after that. Please remind me if I forget.
Seems OK now. I ran into another quirk that is separate; will open issue.