afr / auto-login-WarRoom

// ==UserScript==
// @name         auto-login-WarRoom
// @namespace    http://tampermonkey.net/
// @version      1.1
// @description  try to take over the world!
// @author       afr
// @match        https://node-b.telkom.co.id/index.php
// @match        https://node-b.telkom.co.id/
// @match        https://node-b.telkom.co.id/index.php?c=dashboard_performansi
// @icon         https://www.google.com/s2/favicons?sz=64&domain=co.id
// @match        http://node-b.telkom.co.id/index.php
// @match        http://node-b.telkom.co.id/
// @match        http://node-b.telkom.co.id/index.php?c=dashboard_performansi
// @grant        none
// @copyright    2022
// @license      MIT
// @updateURL    https://openuserjs.org/meta/afr/auto-login-WarRoom.meta.js
// ==/UserScript==

(function () {
  'use strict';

  $(document).ready(() => {

    function login() {
      const input = document.querySelectorAll('input')
      input[0].value = 'nochi'
      input[1].value = 'ostsel'
      input[3].click()
    }

    login()

    function openNewTab() {
      if (sessionStorage.getItem("isOpen") === null) {
        console.log('false ==> open new tab')
        sessionStorage.setItem("isOpen", true)
        window.open('http://node-b.telkom.co.id/index.php?c=redeploy&mitra=&onairAwal=&onairAkhir=&status=po')
        window.open('http://node-b.telkom.co.id/index.php?c=project_radioip&&&&statusproject=po&cat=1')

      }
      else if (sessionStorage.getItem("isOpen") === "true") {
        console.log(sessionStorage.getItem("isOpen"))

      }
    }

    setTimeout(openNewTab, 2000)

    setInterval(() => {
      location.reload()
    }, 120000)

  })

})();