Hello John, great idea. I second Joseph on working together for an extension of the same (that can be used by non-devs and devs)

On 18 November 2016 at 12:00, <skunkworks-request@lists.my.co.ke> wrote:
Send skunkworks mailing list submissions to
        skunkworks@lists.my.co.ke

To subscribe or unsubscribe via the World Wide Web, visit
        http://lists.my.co.ke/cgi-bin/mailman/listinfo/skunkworks
or, via email, send a message with subject or body 'help' to
        skunkworks-request@lists.my.co.ke

You can reach the person managing the list at
        skunkworks-owner@lists.my.co.ke

When replying, please edit your Subject line so it is more specific
than "Re: Contents of skunkworks digest..."


Today's Topics:

   1. Re: Tiny script for WhatsApp Web on Chrome (You Yuxi)


----------------------------------------------------------------------

Message: 1
Date: Fri, 18 Nov 2016 10:54:32 +0300
From: You Yuxi <josephkoech.dev@gmail.com>
To: Peter Karunyu <pkarunyu@gmail.com>, Skunkworks Mailing List
        <skunkworks@lists.my.co.ke>
Subject: Re: [Skunkworks] Tiny script for WhatsApp Web on Chrome
Message-ID:
        <CAJwV-uea5N-VVTvM32bq95SKY+05sLv_Sz_i0LNcQhC0grstfA@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"

Hi John,
Why can't you make it a chrome/firefox/edge extension? It's will be much
easier for devs & non-devs. I can help with this.

Kind regards,
Joseph.

On Thu, Nov 17, 2016 at 4:52 PM, Peter Karunyu via skunkworks <
skunkworks@lists.my.co.ke> wrote:

> This is pretty nice dude!
>
> On Thu, Nov 17, 2016 at 1:16 PM, John K. via skunkworks <
> skunkworks@lists.my.co.ke> wrote:
>
>> Hi,
>> Not sure if I'm alone here, but I use WhatsApp web on chrome like all
>> day, and one thing that really bothers me is accidentally sending a message
>> to the wrong group. We've all seen the consequences online, for some it's
>> just a funny mistake, for others it's disastrous.
>>
>> So I wrote a tiny little script that you can inject into chrome that
>> prompts a confirmation before you send a message to any group. You'll need
>> to install a chrome extension
>> <https://chrome.google.com/webstore/detail/custom-javascript-for-web/poakhlngfciodnhlhhgnaaelnpjljija>
>> that can inject javascript into the web page, and enable jQuery 2.xxx.
>>
>>
>> Here's the script, hope someone else finds it useful. Improvements &
>> suggestions, are welcome. It's very brittle since I rely on class names to
>> find out what's going on in the page, but at least for now it works.
>>
>> Note: Once you "Save" the script in the extension, reload the page,
>> noticed that jQuery fails to load 1st time round, after that it's ok.
>>
>> //----------------Script start
>> jQuery.noConflict();
>> jQuery(document).keydown(function(e) {
>>     var groupIconCount = jQuery('.pane-chat .icon-group-default').length;
>>     if(groupIconCount > 0 ){
>>         var groupName = jQuery('.pane-chat .chat-title
>> .emojitext:first').text();
>>
>>         if(e.which == 13) {
>>             if(confirm('Are you sure you want to send that message to ' +
>> groupName + '?')==false){
>>                  e.preventDefault();
>>                  e.stopPropagation();
>>                  jQuery('.input-placeholder .input').text('');
>>                  return false;
>>             }
>>         }
>>     }
>>     else{
>>         console.log('Not in group, confirm aborted!');
>>     }
>>
>> });
>>
>> jQuery(document).click(function(){
>>     var groupName = jQuery('.pane-chat .chat-title
>> .emojitext:first').text();
>>     jQuery('.input-emoji .input-placeholder').html('Type a message to <b
>> style="color:' + getRandomColor() + '">' + groupName.toUpperCase() +
>> '</b>.');
>> })
>>
>> function getRandomColor() {
>>     var letters = '0123456789ABCDEF';
>>     var color = '#';
>>     for (var i = 0; i < 6; i++ ) {
>>         color += letters[Math.floor(Math.random() * 16)];
>>     }
>>     return color;
>> }
>>
>> //--------------------Script End
>>
>> Regards,
>> John K.
>>
>> _______________________________________________
>> skunkworks mailing list
>> skunkworks@lists.my.co.ke
>> ------------
>> List info, subscribe/unsubscribe
>> http://lists.my.co.ke/cgi-bin/mailman/listinfo/skunkworks
>> ------------
>>
>> Skunkworks Rules
>> http://my.co.ke/phpbb/viewtopic.php?f=24&t=94
>> ------------
>> Other services @ http://my.co.ke
>>
>
>
> _______________________________________________
> skunkworks mailing list
> skunkworks@lists.my.co.ke
> ------------
> List info, subscribe/unsubscribe
> http://lists.my.co.ke/cgi-bin/mailman/listinfo/skunkworks
> ------------
>
> Skunkworks Rules
> http://my.co.ke/phpbb/viewtopic.php?f=24&t=94
> ------------
> Other services @ http://my.co.ke
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.my.co.ke/cgi-bin/mailman/private/skunkworks/attachments/20161118/46c15dbe/attachment-0001.html>

------------------------------

Subject: Digest Footer

_______________________________________________
skunkworks mailing list
skunkworks@lists.my.co.ke
http://lists.my.co.ke/cgi-bin/mailman/listinfo/skunkworks
------------
Skunkworks Server donations spreadsheet
http://spreadsheets.google.com/ccc?key=0AopdHkqSqKL-dHlQVTMxU1VBdU1BSWJxdy1fbjAwOUE&hl=en
------------
Skunkworks Rules
http://my.co.ke/phpbb/viewtopic.php?f=24&t=94
------------
Other services @ http://my.co.ke

------------------------------

End of skunkworks Digest, Vol 30, Issue 85
******************************************