FellowshipOne Report Queue: Auto refresh

Refreshes Page every 5 seconds until the latest report in the queue is complete. Will beep when report is complete.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey, το Greasemonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

You will need to install an extension such as Tampermonkey to install this script.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Userscripts για να εγκαταστήσετε αυτόν τον κώδικα.

You will need to install an extension such as Tampermonkey to install this script.

Θα χρειαστεί να εγκαταστήσετε μια επέκταση διαχείρισης κώδικα χρήστη για να εγκαταστήσετε αυτόν τον κώδικα.

(Έχω ήδη έναν διαχειριστή κώδικα χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Έχω ήδη έναν διαχειριστή στυλ χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

// ==UserScript==
// @name         FellowshipOne Report Queue: Auto refresh
// @namespace    [email protected]
// @version      0.5
// @description  Refreshes Page every 5 seconds until the latest report in the queue is complete. Will beep when report is complete.
// @author       Tony Visconti
// @match        https://reportlibrary.fellowshipone.com/ReportLibrary/ReportsQueue/Index.aspx*
// @grant        none
// ==/UserScript==

function reloadPage() {
    setTimeout(function()
      {
        window.location.href = 'https://reportlibrary.fellowshipone.com/ReportLibrary/ReportsQueue/Index.aspx?refresh=true';
      }, 5000);
}

var img = document.querySelector("#ctl00_MainContent_grdReports > tbody > tr:nth-child(2) > td:nth-child(1) > img");

if(img !== null &&(img.alt === "Pending" || img.alt === "Submitted"))
{
    console.log("Page Reloading");
    reloadPage();
}
else
{
    if(window.location.href.includes('refresh'))
    {
        console.log("Report Complete");
        document.querySelector("body").innerHTML += '<audio id="audio" src="https://www.soundjay.com/button/beep-07.wav" autoplay="true" ></audio>';
    }
}