Be Excellent To Each Other

And, you know, party on. Dude.

All times are UTC [ DST ]




Reply to topic  [ 8 posts ] 
Author Message
 Post subject: Chrome question
PostPosted: Thu Aug 03, 2017 2:27 
User avatar
Can you dig it?

Joined: 5th Apr, 2008
Posts: 4861
Hello chums,

My workplace is using a load of Atlassian platforms now (I quite like them actually) and I've set my mac to open chrome on log in, with a couple of tabs (dashboards, calendars, whatever).

However, Chrome opens before the computer has properly connected to the network and done the authentication thingies, so I get a window with 4 blank tabs showing the 'reload' message.

Can I either make Chrome refresh all tabs at once? (edit - I found an extension that does that, I sometimes forget about Chrome Extensions...) ... Or even better, wait for a bit before loading?

I realise that I could stop Chrome opening at startup and manually click on the icon in the dock, but where's the fun in that?

_________________
rumours about the high quality of the butter reached Yerevan


Top
 Profile  
 
 Post subject: Re: Chrome question
PostPosted: Thu Aug 03, 2017 8:10 
Awesome
User avatar
Yes

Joined: 6th Apr, 2008
Posts: 12342
Sir Taxalot wrote:
Hello chums,

My workplace is using a load of Atlassian platforms now (I quite like them actually) and I've set my mac to open chrome on log in, with a couple of tabs (dashboards, calendars, whatever).

However, Chrome opens before the computer has properly connected to the network and done the authentication thingies, so I get a window with 4 blank tabs showing the 'reload' message.

Can I either make Chrome refresh all tabs at once? (edit - I found an extension that does that, I sometimes forget about Chrome Extensions...) ... Or even better, wait for a bit before loading?

I realise that I could stop Chrome opening at startup and manually click on the icon in the dock, but where's the fun in that?

However you're setting Chrome to open on startup, can you not add a delay to that of a few seconds to allow the network to initialise, same as a delay in a batch file on Windows?

_________________
Always proof read carefully in case you any words out


Top
 Profile  
 
 Post subject: Re: Chrome question
PostPosted: Thu Aug 03, 2017 11:07 
SupaMod
User avatar
Est. 1978

Joined: 27th Mar, 2008
Posts: 69756
Location: Your Mum
Bear with.

_________________
Grim... wrote:
I wish Craster had left some girls for the rest of us.


Top
 Profile  
 
 Post subject: Re: Chrome question
PostPosted: Thu Aug 03, 2017 11:13 
User avatar
Noob as of 6/8/10

Joined: 6th Aug, 2010
Posts: 5605
Location: , Location, Location.
I haven't set Chrome to open at logon, but a couple of weeks ago it just started doing so, with no intervention from me. I've tried to disable it, but it just keeps re-enabling itself.

I suspect sabotage.


Top
 Profile  
 
 Post subject: Re: Chrome question
PostPosted: Thu Aug 03, 2017 11:32 
SupaMod
User avatar
Est. 1978

Joined: 27th Mar, 2008
Posts: 69756
Location: Your Mum
Okay, save this html file somewhere onto your computer, and set it as your homepage.

Code:
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Wait!</title>

    <link href='http://fonts.googleapis.com/css?family=Open+Sans' rel='stylesheet' type='text/css'>

    <style>
        body {
            font-family: 'Open Sans', sans-serif;
            padding: 20px;
            color: #444;
        }

        textarea {
            width: 50%;
            height: 100px;
        }

        input {
            width: 100px;
        }

        .hide {
            opacity: 0;
            transition: all 2s;
        }

        .hide.show {
            opacity: 1;
        }

        .warning {
            border: 1px solid rgba(85, 0, 0, 0.5);
            background: rgba(85, 0, 0, 0.3);
            padding: 20px;
            display: inline-block;
            border-radius: 5px;
            box-shadow: 5px 5px 20px -5px rgba(0, 0, 0, 0.5);
        }

    </style>

</head>

<body>
<h1 id="title">Wait!</h1>
<p>Off you go in <span id="secs-holder">999</span> seconds...</p>

<div id="warning" class="warning hide">Oh noes! Allow this site to open new windows!</div>

<h3>Settings</h3>
Pages to open (one per line):<br/>
<textarea id="pages"></textarea><br/><br/>

Seconds to wait:<br/>
<input type="number" id="secs"><br/><br/>
<button type="button" id="save" onclick="save()">Save changes</button>

<script>
   document.getCookie = function (sName) {
      sName = sName.toLowerCase();
      var oCrumbles = document.cookie.split(';');
      for (var i = 0; i < oCrumbles.length; i++) {
         var oPair = oCrumbles[i].split('=');
         var sKey = decodeURIComponent(oPair[0].trim().toLowerCase());
         var sValue = oPair.length > 1 ? oPair[1] : '';
         if (sKey == sName) {
            return decodeURIComponent(sValue);
         }
      }
      return '';
   };

   document.setCookie = function (sName, sValue) {
      var oDate = new Date();
      oDate.setYear(oDate.getFullYear() + 1);
      var sCookie = encodeURIComponent(sName) + '=' + encodeURIComponent(sValue) + ';expires=' + oDate.toGMTString() + ';path=/';
      document.cookie = sCookie;
   };


   var secs = document.getCookie('secs');
   var pages = document.getCookie('pages');

   if (secs) {
      document.getElementById('secs-holder').innerHTML = secs;
      document.getElementById('secs').value = secs;
   }

   if (pages) {
      document.getElementById('pages').value = pages;
   }

   if (secs && pages) {
      setTimeout(function () {
         hitTicker(secs);
      }, 1000);
   }

   function save() {
      document.setCookie('secs', document.getElementById('secs').value);
      document.setCookie('pages', document.getElementById('pages').value);
      location.reload();
   }

   function hitTicker(s) {
      s--;
      document.getElementById('secs-holder').innerHTML = s;
      if (!s) {
         go();
         return;
      }

      setTimeout(function () {
         hitTicker(s);
      }, 1000);
   }

   function go() {
      document.getElementById('title').innerHTML = "Go!";
      var page_array = pages.split("\n");
      var first = page_array.shift();
      var good = false;
      page_array.forEach(function (p) {
         var h = window.open(p, '_blank');
         if (h) {
            good = true;
         }
      });
      if (good) {
         window.location = first;
      } else {
         document.getElementById('warning').className += ' show';
      }

   }
</script>


Example here: http://www.mosttriumphant.co.uk/random/wait.htm

_________________
Grim... wrote:
I wish Craster had left some girls for the rest of us.


Top
 Profile  
 
 Post subject: Re: Chrome question
PostPosted: Thu Aug 03, 2017 11:34 
SupaMod
User avatar
Est. 1978

Joined: 27th Mar, 2008
Posts: 69756
Location: Your Mum
Oh, the font styling won't work, d'uh. Never mind.

It could automatically open the pages when you've got an internet connection, actually. That would be much more sensible.

_________________
Grim... wrote:
I wish Craster had left some girls for the rest of us.


Top
 Profile  
 
 Post subject: Re: Chrome question
PostPosted: Thu Aug 03, 2017 11:52 
SupaMod
User avatar
Est. 1978

Joined: 27th Mar, 2008
Posts: 69756
Location: Your Mum
Here you go - you've got two seconds to click inside the box (once you set it up) if you want to change it. I also stopped using cookies because we live in the future now.

Code:
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Wait!</title>

    <link href='http://fonts.googleapis.com/css?family=Open+Sans' rel='stylesheet' type='text/css'>

    <style>
        body {
            font-family: 'Open Sans', sans-serif;
            padding: 20px;
            color: #444;
        }

        textarea {
            width: 50%;
            height: 100px;
        }

        .hide {
            opacity: 0;
            transition: all 2s;
        }

        .hide.show {
            opacity: 1;
        }

        .warning {
            border: 1px solid rgba(85, 0, 0, 0.5);
            background: rgba(85, 0, 0, 0.3);
            padding: 20px;
            display: inline-block;
            border-radius: 5px;
            box-shadow: 5px 5px 20px -5px rgba(0, 0, 0, 0.5);
        }
    </style>
</head>

<body>
<h1 id="title">Wait!</h1>

<div id="warning" class="warning hide">Oh noes! Allow this site to open new windows!</div>

<h3>Settings</h3>
Pages to open (one per line):<br/>
<textarea id="pages" onfocus="te_focus()" onblur="te_blur()"></textarea><br/><br/>

<button type="button" id="save" onclick="save()">Save changes</button>

<script>
   var pages = localStorage.getItem('pages');
   var hit_timeout = -1;

   if (pages) {
      document.getElementById('pages').value = pages;
      hit_timeout = setTimeout(function () {
         hitTicker();
      }, 2000);
   }

   function save() {
      localStorage.setItem('pages', document.getElementById('pages').value);
      location.reload();
   }

   function hitTicker() {
      if (navigator.onLine) {
         go();
         return;
      }

      hit_timeout = setTimeout(function () {
         hitTicker();
      }, 1000);
   }

   function go() {
      document.getElementById('title').innerHTML = "Go!";
      var page_array = pages.split("\n");
      var first = page_array.shift();
      var good = false;
      page_array.forEach(function (p) {
         if (p) {
            var h = window.open(p, '_blank');
            if (h) {
               good = true;
            }
         }
      });
      if (good) {
         window.location = first;
      } else {
         document.getElementById('warning').className += ' show';
      }
   }

   function te_focus() {
      clearTimeout(hit_timeout);
   }

   function te_blur() {
      hit_timeout = setTimeout(function () {
         hitTicker();
      }, 3000);
   }
</script>
</body>
</html>


Example here: http://www.mosttriumphant.co.uk/random/wait_auto.htm

_________________
Grim... wrote:
I wish Craster had left some girls for the rest of us.


Top
 Profile  
 
 Post subject: Re: Chrome question
PostPosted: Thu Aug 03, 2017 12:43 
User avatar
Can you dig it?

Joined: 5th Apr, 2008
Posts: 4861
I shall try that tomorrow. I have basically no idea how you've done that, but I appreciate it :)

_________________
rumours about the high quality of the butter reached Yerevan


Top
 Profile  
 
Display posts from previous:  Sort by  
Reply to topic  [ 8 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: Vogons and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search within this thread:
You are using the 'Ted' forum. Bill doesn't really exist any more. Bogus!
Want to help out with the hosting / advertising costs? That's very nice of you.
Are you on a mobile phone? Try http://beex.co.uk/m/
RIP, Owen. RIP, MrC. RIP, Dimmers.

Powered by a very Grim... version of phpBB © 2000, 2002, 2005, 2007 phpBB Group.