javascript - Trying to Detect Characters to determine if Page Should Reload, or not. (Safari Extension) -


just knows, i'm relatively new javascript, (and i've been trying things in pure js rather using jquery, etc.). @ place contract for, have exchange server, use webmail client.

to prevent timing me out when there isn't activity, started putting safari extension since inject js page using one. , thought exercise since i'm learning js scratch.

well, part of works, except when you're replying, or sending new email, tried adding in second bit of code prevent that, still refreshes. can't figure out why. appreciate help! going have add in rules if i'm replying, or replying all, think if can working, can going to.

so here's code:

if (location.host === "mail.exmx.net") {     /* domain https://mail.exmx.net/owa/?ae=folder&t=ipf.note */      var timer = settimeout(function() {         location.reload( );     }, 30000 /* 30 seconds used test speed waiting time*/ ); }  else (location.href.indexof("?ae=item&t=ipm.note&a=new") != -1) {     /* attempt @ using static part of string that's in location bar when new email created */     cleartimeout(timer); } 

your code wonky. instead of else, need else if.

of course, set timer if both conditions set (instead of setting timer, clearing it):

if (location.host == "mail.exmx.net" && location.href.indexof("?ae=item&t=ipm.note&a=new") == -1) {      /* domain https://mail.exmx.net/owa/?ae=folder&t=ipf.note */      var timer = settimeout(function() {         location.reload( );     }, 30000 /* 30 seconds used test speed waiting time*/ ); } 

Comments

Popular posts from this blog

android - Spacing between the stars of a rating bar? -

aspxgridview - Devexpress grid - header filter does not work if column is initially hidden -

c# - How to execute a particular part of code asynchronously in a class -