joao-carloto / FireRobot

Firefox extension for Robot Framework/Selenium.
Other
28 stars 6 forks source link

ShortKey for the selection mode (Alt + Z) #57

Closed Cryton1000 closed 9 years ago

Cryton1000 commented 9 years ago

I would love to have a shortkey for the selection mode to turn it on and off. Could that be something?

joao-carloto commented 9 years ago

I'm glad you posted this.

This is actually already implemented but has a bug that was introduced at some point. To toggle the selection mode on/off use Ctrl + Alt + S. Yes, the combination is tricky but many easy combinations were already taken by the browser. If you have any suggestion for another combination please let me know.

Now for the bug: If you have focus on the FireRobot GUI it works fine (but it's not very useful). If you have focus on the page under test it will work to get out of the select mode but not back again.

Beware that it's only supposed to work after you put select mode ON by pressing on the button at least once (it has to load some event listeners on the page). If you navigate to another page (e.g. by pressing a link) the new page will no longer have the event listeners and you'll have to click on the button again. Due to this limitation I never advertised the feature, but I'll try to think on a better way to implement this.

Not sure when I'll release a fix. If you want to correct it yourself you can follow these steps:

Got to %APPDATA%\Mozilla\Firefox\Profiles\extensions{91d9d8dc-09f8-4890-b6d8-32cbbf0a2f0e}\content\fr-modules

Edit the select.jsm file and comment or delete line 151:

//doc.removeEventListener('keydown', _keyDown, true);

Again, thanks for the input.

joao-carloto commented 9 years ago

This was badly implemented. It should now work without the need of toggling select mode on once with the button. Fix available on next release.

joao-carloto commented 9 years ago

Ctrl + Alt + S wasn't working in Linux (not sure why). Changed it to Alt + Z (which is easier to use anyway).

I'll take the liberty of editing the issue name so it's more clear on the release notes.