Community-edition: Add a way to send instagram direct messages by pressing ENTER

Created on 10 Mar 2020  路  6Comments  路  Source: ramboxapp/community-edition

It'd be incredible if you could send Instagram Direct messages by pressing the Enter key instead of having to click the send button with the mouse!

Is there any way to implement this?
Thanks

ENVIRONMENT

Rambox: v0.7.3-1

OS: Manjaro

Arch: x64

enhancement help wanted

All 6 comments

It could be done by adding a JS script.
I made a very simple one that works, I don't know if works for every scenario, please test it. It seems to me a good starting point for a more complex script. Sorry but I'm short of time but maybe someone could improve it.

document.addEventListener('keydown', function(e) {
    if (e.key === 'Enter') {
        let a = document.querySelectorAll('button[type=button]').length;
                a === 4 && document.querySelectorAll('button[type=button]')[a-1].click();
    }
});

@obvionaoe Did the script help you?

It did, I completely forgot you could add javascript to the services xD As you said it still needs a little bit of work, I'm going to mess with it a little bit to see if I can remove the new line it prints in the input :)

document.addEventListener('keydown', function(e) {
  if (e.key === 'Enter') {
    let a = document.querySelectorAll('button[type=button]').length;
    ["Enviar", "Send", "Senden", "Invia", "Skicka", "Envoyer", "Verzenden", "袨褌锌褉邪胁懈褌褜"].includes(document.querySelectorAll('button[type=button]')[a-1].innerText) && document.querySelectorAll('button[type=button]')[a-1].click();
  }
});

This one works better :-)

I added the script to the service.

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

leif picture leif  路  4Comments

saalkom picture saalkom  路  3Comments

Tseberechts picture Tseberechts  路  4Comments

jvdmeij picture jvdmeij  路  4Comments

arnauldb picture arnauldb  路  4Comments