mcawesomept / LinkedIn - Select all messages

// ==UserScript==
// @name         LinkedIn - Select all messages
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  Selects all messages in linked in. You must go into 3 dots > Edit Conversations and scroll down to a few messages that you want the script to select. May require the page to be refreshed for the button to appear.
// @author       mcawesomept
// @match        https://www.linkedin.com/messaging/*
// @grant        none
// @license      MIT
// @require     https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js
// ==/UserScript==

(function() {
    'use strict';

    // Your code here...
    console.log("linkedin user script loaded");
    var selectAllBtnHtml = "<input id='selectAllBtn' type='button' value='select all messages' />";
    $(".authentication-outlet").prepend("<div>" + selectAllBtnHtml + "</div>");

    $("#selectAllBtn").click(function(){
        if($(".msg-selectable-entity__checkbox-only").length === 0)
        {
            alert("please select 3 dots > manage conversations first!");
        }
        else
        {
            $(".msg-selectable-entity__checkbox-only").click()
            alert("all visible messages were selected.");
        }
    });



})();