Next/Previous tab with gesture

Pardon if I am violating or unclear.

My aim is for the following:

Target device: Laptops with touchpad
Two finger swipe left = go to tab left of the current tab
Two finger swipe right = go to tab right of the current tab

I borrowed this addon to handle most of the requirements:
https://addons.mozilla.org/en-US/firefox/addon/scrolling-gestures/

simply replacing history actions with go to left tab or right tab would satisfy my aim.

Made attempts with injecting the following into scrolling-gestures addon. My plan was to either fire a keyboardevent or use firefox library/api to control tab focusing

var objTag = document.getElementsByTagName(“BODY”)[0];
var e = document.createEvent(‘KeyboardEvent’);
e.initKeyEvent(‘keydown’, true, true, window, false, false, false, false, 9, 0);
objTag.dispatchEvent(e);

wnd.gBrowser.TabContainer.advanceSelectedTab(1, true);

When I temporarily install the modified addon in debugging nothing happens. I do see the arrows that the addon normally displays.

I would greatly appreciate help or possibly getting my aim in the right direction.

Thanks in advance