My main browser is Opera, under which the add-ons were originally developed, and then transferred to Google Chromium (build from the Ubuntu repository). I use the web version of twitter and it almost completely suits me, but it was decided to correct a few minor nuances. Then you can find out what problems got out when “porting” the extension.
First, I would like to send statuses by CTRL + ENTER. Secondly, the old style retweets (RT user_name text). ')
var pr_key = 0; function submit_status(event) { alert(''); } (function () { try { submit_status = function (event) { if(pr_key == 17 && event.keyCode == 13) { $('#status_update_form').submit(); } pr_key = event.keyCode; } jQuery('#status').attr('onKeyDown', 'submit_status(event);'); } catch(e) { } })();
The first was implemented fairly quickly using JS. It was not desirable to use third-party libraries therefore it is made with small crutches. Everything worked in Opera and then it was time to build an extension for Chromium. jQuery was added to manifest.json, twi JS itself also started the tests. And immediately all the problems surfaced, as it turned out in Chromium problems with the visibility of the function definition area, onKeyDown simply did not see the submit_status () function. The problem was solved by adding a script element to the twitter code.