panorama-tab-groups icon indicating copy to clipboard operation
panorama-tab-groups copied to clipboard

Version 0.8.12 breaks Gesturefy compatibility for toggleView

Open ttonyh opened this issue 4 years ago • 7 comments

Looks like the new version now supports "activate-next-group" and "activate-previous-group" but removes support to "toggleView" which was there in previous versions.

Updated Code

https://github.com/projectdelphai/panorama-tab-groups/blob/master/src/js/background.js#L156

Previous Code

https://github.com/projectdelphai/panorama-tab-groups/blob/ea50dd70a5a9179cdb95457bfb0f82363b0ca5ec/src/js/background.js#L158

ttonyh avatar May 19 '20 07:05 ttonyh

I think it was necessary, but I will look into it. Could please provide more info on your use case.

vaxul avatar May 19 '20 11:05 vaxul

This also affects FoxyGestures and any other extension that would want to trigger opening or closing the panorama view.

Previously, this would be done with the snippet: browser.runtime.sendMessage("[email protected]", "toggle-panorama-view"); but this no longer works in the latest version

bakkerthehacker avatar May 19 '20 13:05 bakkerthehacker

It looks like, by evaluating the new background.js file; the ability to call "toggleView()" from another extension has been removed. Please see the original post for the code locations.

ttonyh avatar May 19 '20 17:05 ttonyh

Proposed fix:

https://github.com/projectdelphai/panorama-tab-groups/blob/master/src/js/background.js#L156

  if (command === "activate-next-group") {
    await changeActiveGroupBy(1);
  } else if (command === "activate-previous-group") {
    await changeActiveGroupBy(-1);
  } else if (command === "toggle-panorama-view") {
    await toggleView();
  }

ttonyh avatar May 19 '20 17:05 ttonyh

Would you please provide a step by step guide to reconstruct your environment?

It was necessary to remove the custom toggle command so the keyboard shortcut (default CTRL+SHIFT+F) could work for classic and popup view, which uses the _execute_browser_action command. https://github.com/projectdelphai/panorama-tab-groups/blob/dee8b3aaca99228957ef7852e1b2c797fb62a08c/src/manifest.json#L20-L39

Maybe you could configure the _execute_browser_action instead of toggle-panorama-view?

vaxul avatar May 22 '20 11:05 vaxul

Here's a step by step way to re-create:

  1. Install the following gesture add-on: https://addons.mozilla.org/en-US/firefox/addon/gesturefy/?src=search

  2. Go to the add-ons settings page in your browser, then to the "Gestures" section: moz-extension://7754bbb0-840d-492c-b553-d9618df7e422/views/options/html/index.html#Gestures

  3. Click on the "+" circle button at the top (green color).

  4. Find the top "Command" input box, click inside of it to activate a right-aligned pop-up config panel

  5. In the right config panel, scroll it down all the way to the bottom, where you'll see the following option: "Send message to other add-on". Click it.

  6. The side panel window will change to an input panel for setting the options for "Send message to other add-on" setting.

  7. Enter "[email protected]" for setting named "Add-on ID"

  8. Now enter "toggle-panorama-view" for setting named "Message".

  9. Click "Save" button to close side panel

  10. Add a gesture, for example, an upward movement of the mouse while holding right-click (you might need to add one that doesn't already exist)

  11. Click "Save" button.

  12. Open a new tab, and navigate to a random web page and test out your new gesture.

Desired Effect: The Panorama View opens Actual Effect: Nothing happens.

Try this with a previous version, and it will work.

WHY? Because you removed the link between the message of "toggle-panorama-view" to the function of "toggleView()". The above code I demonstrated will add it back again. If the "keyword" of "toggle-panorama-view" is now taken by something else for whatever reason, you can change it to something else; anything you want it doesn't matter... just as long as other plugins are able to send THAT particular message and be able to trigger the "toggleView()" function.

ttonyh avatar May 23 '20 05:05 ttonyh

I forked this repo to debug and found some issues; in addition to the PR please check the following commit to see what more needs to be done to get this functionality back:

https://github.com/ttonyh/tab-groups-dashboard/commit/bc2354af74498e21d7dfc62437f23273cc331b99

ttonyh avatar Jul 31 '21 17:07 ttonyh