SimpleGesture.doCommand - utubo/firefox-simple_gesture GitHub Wiki

(DRAFT in version2.7) jp(./SimpleGesture.doCommand-[jp])


You can use SimpleGesutre.doCommand() to execute Simple-Gesutre's command.

Syntax

SimpleGesture.doCommand(commandName);

I'm still debating the name of this API.

Parameters

commandName

reload, close, etc... You can select with select box, if you enable "Experimental features" in Setting-page.

toggleUserAgent has a some options.

// toggle 'ABC' <-> default
SimpleGesture.doCommand('toggleUserAgent', { userAgent: 'ABC' });
// change to 'ABC'.
SimpleGesture.doCommand('toggleUserAgent', { userAgent: 'ABC', force: true });
// reset.
SimpleGesture.doCommand('toggleUserAgent', { userAgent: null });

Note

you can't change target of basic commands.

// when
// TAB-A = current tab
// TAB-B = next tab
SimpleGesture.doCommand('nextTab'); // Show TAB-B (this works. but...)
SimpleGesture.doCommand('reload'); // Reload TAB-A (NOT TAB-B !)

Because Simple-Gesture is simple.

P.S.

I'm still debating the name of this API. SimpleGesture.doCommand(), SimpleGesture.execute(), SimpleGesture.do(), SimpleGesture.execCommand() or SimpleGesture.exec() etc... Which is best?