Ferdi: Contextual menu doesn't work

Created on 10 Feb 2020  Â·  14Comments  Â·  Source: getferdi/ferdi

On many services, the context menu doesn't show up.

Expected Behavior

The menu should open with at least some option like "copy", "copy link address".

Current Behavior

If you right click on a link, the context menu opens and the closes in a few milliseconds. You can't use it.

Steps to Reproduce (for bugs)

  1. Open a service
  2. Right click somewhere
  3. The context menu popup and disappear in a few ms

Context

On services where the contextual menu is customized, it works as expected. Otherwise, the menu doesn't show up.

Works on :

  • WhatsApp
  • Slack (left panel only)

Breaks on:

  • Slack
  • Gmail
  • Google Calendar
  • Telegram

Your Environment

Desktop:
OS: Ubuntu 18.04.4 LTS // Linux 4.15.0-76-generic #86-Ubuntu SMP Fri Jan 17 17:24:28 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

Version: Ferdi 5.4.4-beta1 (x64), Electron 7.1.6, Node.js v12.8.1, on linux with I3 4.17.1.

➜ ./Ferdi-5.4.4-beta.1.AppImage
(electron) 'setBadgeCount function' is deprecated and will be removed. Please use 'badgeCount property' instead.
Starting local server on port 45569
info: serving app on http://127.0.0.1:45569
(electron) 'setAudioMuted function' is deprecated and will be removed. Please use 'audioMuted property' instead.
(ferdi:3241): IBUS-WARNING **: 13:21:34.476: Unable to connect to ibus: Could not connect: Connection refused
Gtk-Message: 13:21:43.380: GtkDialog mapped without a transient parent. This is discouraged.
Checking for update
Update for version 5.4.4-beta.1 is not available (latest version: 5.4.3, downgrade is disallowed).
Gtk-Message: 13:25:16.056: GtkDialog mapped without a transient parent. This is discouraged.

bug

Most helpful comment

Shipped in v5.4.4-beta.3.

All 14 comments

I can confirm that this is the case for me as well for a few betas by now, but I thought it was an install problem for me.

Works on:

  • Skype

Broken on:

  • Telegram
  • IRCCloud
  • FB Messenger
  • Discord

Unless I use it on a spellcheck error.
If I select a typo text and I get a spellchecker menu options it stays on.

OS:
Hungarian Win 7 x64 Ultimate

Can confirm that context menu doesn't work on slack, tweetdeck, twitter and reddit.

OS: Win 10 Home x64 (2004)

Can confirm it in everything that does not reimplement a context menu itself.

Seems like only custom context menus work, the default one does not.

Can confirm that the context menu doesn't work in most services. The only downside so far compared to Franz.. Hoping it gets fixed soon.

This seems to be Linux and Windows specific? I get a normal contextual menu on macOS

Update: The context menu seems to generally work on macOS but the menu that pops up is not the one that Ferdi tries to open:
Screenshot 2020-02-24 at 15 09 23
(👆context menu that opens)
Screenshot 2020-02-24 at 15 11 36
(👆context menu Ferdi wants to open)

It looks like the problem comes from this line:
https://github.com/getferdi/ferdi/blob/5b0af7342a0a04d18abd8d5f885f9cb7941cc471/src/webview/contextMenu.js#L321
Ferdi gets to the menu building just fine (i.e. the event listener is correct and the Menu building also works), its just that Ferdi can't actually let the context menu pop up after building it.
It looks like macOS is the only OS that opens some sort of "default popup menu".

Looking at how electron-context-menu does it, it seems like we need to use the webview context to create the context menu. The problem is that I can't find any way to get that context from inside the webview (I even tried using ICP events).
We may need to move the whole context menu logic outside of the webview preload script and into Ferdi's scripts.

This is what happens on Windows (10):
ferdi

I just experienced the following in Tweetdeck:

Uncaught (in promise) TypeError: e.getSuggestion is not a function
    at /Applications/Ferdi.app/Contents/Resources/app.asar/webview/contextMenu.js:1
    at CallbacksRegistry.apply (callbacks-registry.ts:45)
    at remote.js:286
    at EventEmitter.<anonymous> (remote.js:276)
    at EventEmitter.emit (events.js:203)
    at Object.onMessage (init.ts:50)

Leaving as a note for now for further investigation later.

Hi, I'm sorry that you guys are facing this issue. But if any good soul (contributor) here could also implement this feature meanwhile working on the fix.

Feature: #413

Submitted a pull request, this will be fixed in the next release.

Shipped in v5.4.4-beta.3.

Thanks a LOT it works !!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

yourcontact picture yourcontact  Â·  3Comments

kytwb picture kytwb  Â·  3Comments

AP-Hunt picture AP-Hunt  Â·  3Comments

YourWishes picture YourWishes  Â·  3Comments

webworker01 picture webworker01  Â·  3Comments