A Windows XP help forum. PCbanter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » PCbanter forum » Microsoft Windows 7 » Windows 7 Forum
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

browser tab focus



 
 
Thread Tools Rate Thread Display Modes
  #1  
Old February 15th 19, 04:02 PM posted to alt.windows7.general
Jean Fredette
external usenet poster
 
Posts: 47
Default browser tab focus

For some things like speedtests and video downloads, the web servers stop
working if you don't keep "their tab" in "focus" (I think that's the word
to use).

An example is speedtest.comcast.net which doesn't like when you focus on
something else while it's running. Luckily it doesn't take long but plenty
of other things do.

Is there a way to trick a browser tab into THINKING it's in focus?
Ads
  #2  
Old February 16th 19, 12:33 AM posted to alt.windows7.general
J. P. Gilliver (John)[_4_]
external usenet poster
 
Posts: 2,679
Default browser tab focus

In message , Jean Fredette
writes:
For some things like speedtests and video downloads, the web servers stop
working if you don't keep "their tab" in "focus" (I think that's the word
to use).

An example is speedtest.comcast.net which doesn't like when you focus on
something else while it's running. Luckily it doesn't take long but plenty
of other things do.

Is there a way to trick a browser tab into THINKING it's in focus?


Surely for the speedtests at least, any answer that lets you do that
will make the speedtest invalid?
--
J. P. Gilliver. UMRA: 1960/1985 MB++G()AL-IS-Ch++(p)Ar@T+H+Sh0!:`)DNAf

The desire to remain private and/or anonymous used to be a core British value,
but in recent times it has been treated with suspicion - an unfortunate by-
product of the widespread desire for fame. - Chris Middleton,
Computing 6 September 2011
  #3  
Old February 16th 19, 06:15 AM posted to alt.windows7.general
Jean Fredette
external usenet poster
 
Posts: 47
Default browser tab focus

"J. P. Gilliver (John)" posted:

Surely for the speedtests at least, any answer that lets you do that
will make the speedtest invalid?


I'm not sure what you mean.

I chose the speedtest as a simple example of the problem that many web
pages just STOP working when you simply change the browser tab focus
and do nothing else different.

For example if I open up a browser and set up two tabs the first to
speedtest.comcast.net and the second a blank tab.

If I go to the first tab the speedtest.comcast.net tab and press the "Start
Test" button and then if I just watch the paint dry it will work.

But if I go to that first speedtest.comcast.net tab and press the "Start
Test" button and then all I do is switch to that second blank tab (doing
NOTHING ELSE different) the speedtest page will fail.

At least it does for me when I tested it just now on one of my browsers.

Why would it MATTER that the focus is on a different tab for a speedtest?
The ONLY thing different is the FOCUS on a specific browser tab.

Even though the speedtest is just a simple example of what happens all the
time the reason I'm confused about your question is that the speedtest
should be valid whether the focus is on the first tab or the second tab.

Can you clarify your question?
  #4  
Old February 16th 19, 06:32 AM posted to alt.windows7.general
Hathie
external usenet poster
 
Posts: 2
Default browser tab focus

Jean Fredette wrote:
For some things like speedtests and video downloads, the web servers stop
working if you don't keep "their tab" in "focus" (I think that's the word
to use).

An example is speedtest.comcast.net which doesn't like when you focus on
something else while it's running. Luckily it doesn't take long but plenty
of other things do.

Is there a way to trick a browser tab into THINKING it's in focus?


Open the tab in a separate browser window.

In case that does not work for you, some browsers have their own options
to let background tabs run like they were still in focus. The details
will depend on which browser you use.

  #5  
Old February 16th 19, 09:11 AM posted to alt.windows7.general
Jean Fredette
external usenet poster
 
Posts: 47
Default browser tab focus

Hathie posted:

Open the tab in a separate browser window.


I just tested that suggestion which works, at least with the speedtest
testcase where I just have to ensure that each browser tab is a separate
window on the screen.

Of course that limits the number of browser windows given that each browser
tab when broken off the main browser tab takes up room where the main
example of the problem set is downloading videos that won't download unless
the focus is on them.

If I want to download ten at a time, I guess it will work like the testcase
just did, where I open ten separate browser windows each "thinking" it's
the focus.

It seems to work so that's a good suggestion. It's only limited by the
amount of usable screen space.

In case that does not work for you, some browsers have their own options
to let background tabs run like they were still in focus. The details
will depend on which browser you use.


I need to find a browser that has THAT option to make every browser tab in
focus simultaneously!
  #6  
Old February 16th 19, 09:29 AM posted to alt.windows7.general
Paul[_32_]
external usenet poster
 
Posts: 11,873
Default browser tab focus

Jean Fredette wrote:
For some things like speedtests and video downloads, the web servers stop
working if you don't keep "their tab" in "focus" (I think that's the word
to use).

An example is speedtest.comcast.net which doesn't like when you focus on
something else while it's running. Luckily it doesn't take long but plenty
of other things do.

Is there a way to trick a browser tab into THINKING it's in focus?


Interesting.

Now I can see from how this thread developed,
there are two concepts at work.

1) Only one item on the desktop can have the focus. The focus
implies "capture of keyboard" input as one element. I was prepared
to answer "you cannot cheat on focus". But this isn't your
actual question.

2) I didn't think about this, but tabs within a browser
have foreground and background. Only one tab in a browser
window can be in the foreground. But this is not "focus",
since if Notepad is clicked in Windows and is ready for
input from the keyboard, that is "focus".

The concept in (2) of a foreground tab, is addressed here.

https://developer.mozilla.org/en-US/...Visibility_API

Paul
  #7  
Old February 16th 19, 12:35 PM posted to alt.windows7.general
J. P. Gilliver (John)[_4_]
external usenet poster
 
Posts: 2,679
Default browser tab focus

In message , Jean Fredette
writes:
"J. P. Gilliver (John)" posted:

Surely for the speedtests at least, any answer that lets you do that
will make the speedtest invalid?


I'm not sure what you mean.

I chose the speedtest as a simple example of the problem that many web
pages just STOP working when you simply change the browser tab focus
and do nothing else different.

[]
Can you clarify your question?


I see; you were just using the speedtest as an example of a page that
stops working when it isn't the primary tab (I would have said "doesn't
have focus", but as Paul has pointed out, that has a specific meaning
relating to Windows as a whole rather than browser tabs). You weren't
trying to run an actual valid speed test. (Which obviously does need to
both be the primary tab and for there to be no other online activity for
the actual speed test to give a valid result.)
--
J. P. Gilliver. UMRA: 1960/1985 MB++G()AL-IS-Ch++(p)Ar@T+H+Sh0!:`)DNAf

Never make the same mistake twice...there are so many new ones to make!
  #8  
Old February 16th 19, 03:06 PM posted to alt.windows7.general
JJ[_11_]
external usenet poster
 
Posts: 744
Default browser tab focus

On Sat, 16 Feb 2019 03:29:49 -0500, Paul wrote:

Interesting.

Now I can see from how this thread developed,
there are two concepts at work.

1) Only one item on the desktop can have the focus. The focus
implies "capture of keyboard" input as one element. I was prepared
to answer "you cannot cheat on focus". But this isn't your
actual question.

2) I didn't think about this, but tabs within a browser
have foreground and background. Only one tab in a browser
window can be in the foreground. But this is not "focus",
since if Notepad is clicked in Windows and is ready for
input from the keyboard, that is "focus".

The concept in (2) of a foreground tab, is addressed here.

https://developer.mozilla.org/en-US/...Visibility_API

Paul


AFAIK, Chrome introduces a more aggresive way to "optimize" web browser
performance by throttling down or even suspend script executions in non
active tabs.
  #9  
Old February 16th 19, 04:33 PM posted to alt.windows7.general
Jean Fredette
external usenet poster
 
Posts: 47
Default browser tab focus

Paul posted:

but tabs within a browser have foreground and background.


Thank you for the clarification words that "focus" is the Windows thing
where the mouse and keyboard act currently.

This is about "foreground" and "background" of a given browser window.

There's one more complexity that Hathie brought up which I didn't consider
at first which is that we can start a browser and open the two tabs, one
pointed to speedtest and the other blank and then we can break them apart.

I followed Hathie's suggestion and broke those two tabs into two separate
"windows" which I made so small that they fit on the one screen with no
overlap where each now separated tab could be in the foreground
simultaneously I think

With three Windows open (one being this edit) I was able to cycle the
Windows "focus" between the three "windows" where the speedtest worked
without stopping.

I then overlapped all three windows and tried again and it still worked.
That means the focus doesn't matter as you were telling me.

The browser "window" just has to be in the foreground state.
It seems by "definition" any single-tab browser "is" in foreground state.
It's only with multi-tab browser windows where background exists.

What I want is to just trick a multi tab browser into thinking it is
foreground on all the tabs. That might be impossible or maybe not since
those annoying videos play even when the browser isn't the foreground tab
when I open a dozen google news links.

I'm always hunting for the one browser tab that was in background but which
still played the annoying news video or advertisement.

Even without being able to put all the browser tabs of a multi tab session
into foreground mode, the workaround by Hathie works which is to separate
the individual tabs into single tab browser windows which are by definition
in foreground mode.
  #10  
Old February 16th 19, 04:37 PM posted to alt.windows7.general
Jean Fredette
external usenet poster
 
Posts: 47
Default browser tab focus

"J. P. Gilliver (John)" posted:

You weren't
trying to run an actual valid speed test. (Which obviously does need to
both be the primary tab and for there to be no other online activity for
the actual speed test to give a valid result.)


I wrote back to Paul about his correction to use "foreground" instead of
"focus".

I only want to correct what you said which is that if all you do is open a
single browser session which has two tabs, one of which is blank, I don't
think switching the "foreground" from the speedtest tab to the blank tab
"should" have any impact on the speed test.

Why would just switching the speedtest tab to "background" mode have any
"real" impact on the speedtest results?

The impact would be that "advertising" or some other thing wouldn't happen
if you didn't watch the paint dry on the speedtest (where the speedtest is
just an easy example that happens to be fast).

A proof of that is I can break the two-tab browser into two separate tabs
both of which are now by definition in "foreground" mode, and then the
speedtest runs to completion.

The only difference was that the speedtest tab was in foreground mode the
whole time after I press the button to run the test.
  #11  
Old February 16th 19, 08:03 PM posted to alt.windows7.general
J. P. Gilliver (John)[_4_]
external usenet poster
 
Posts: 2,679
Default browser tab focus

In message , Jean Fredette
writes:
"J. P. Gilliver (John)" posted:

You weren't
trying to run an actual valid speed test. (Which obviously does need to
both be the primary tab and for there to be no other online activity for
the actual speed test to give a valid result.)


I wrote back to Paul about his correction to use "foreground" instead of
"focus".

I only want to correct what you said which is that if all you do is open a
single browser session which has two tabs, one of which is blank, I don't
think switching the "foreground" from the speedtest tab to the blank tab
"should" have any impact on the speed test.


True, if that's _all_ you do. The usual reason for opening more tabs,
however, is to load more pages (-:

Why would just switching the speedtest tab to "background" mode have any
"real" impact on the speedtest results?

The impact would be that "advertising" or some other thing wouldn't happen
if you didn't watch the paint dry on the speedtest (where the speedtest is
just an easy example that happens to be fast).

A proof of that is I can break the two-tab browser into two separate tabs


ITYM Windows (-:

both of which are now by definition in "foreground" mode, and then the
speedtest runs to completion.

[]
--
J. P. Gilliver. UMRA: 1960/1985 MB++G()AL-IS-Ch++(p)Ar@T+H+Sh0!:`)DNAf

Security is the perfect excuse to lock you out of your own computer.
- Mayayana in alt.windows7.general, 2015-12-4
  #12  
Old February 16th 19, 09:35 PM posted to alt.windows7.general
Zaidy036[_5_]
external usenet poster
 
Posts: 427
Default browser tab focus

On 2/16/2019 2:03 PM, J. P. Gilliver (John) wrote:
In message , Jean Fredette
writes:
"J. P. Gilliver (John)" posted:

You weren't
trying to run an actual valid speed test. (Which obviously does need to
both be the primary tab and for there to be no other online activity for
the actual speed test to give a valid result.)


I wrote back to Paul about his correction to use "foreground" instead of
"focus".

I only want to correct what you said which is that if all you do is
open a
single browser session which has two tabs, one of which is blank, I don't
think switching the "foreground" from the speedtest tab to the blank tab
"should" have any impact on the speed test.


True, if that's _all_ you do. The usual reason for opening more tabs,
however, is to load more pages (-:

Why would just switching the speedtest tab to "background" mode have any
"real" impact on the speedtest results?

The impact would be that "advertising" or some other thing wouldn't
happen
if you didn't watch the paint dry on the speedtest (where the
speedtest is
just an easy example that happens to be fast).

A proof of that is I can break the two-tab browser into two separate tabs


ITYM Windows (-:

both of which are now by definition in "foreground" mode, and then the
speedtest runs to completion.

[]

Speed tests do NOT give correct results when you are running something
else on the 'net.


--
Zaidy036
  #13  
Old February 16th 19, 10:49 PM posted to alt.windows7.general
Jean Fredette
external usenet poster
 
Posts: 47
Default browser tab focus

Zaidy036 posted:

Speed tests do NOT give correct results when you are running something
else on the 'net.


We all agree.

The speedtest case was just a simple example so the fact it's running a
speed test is only an artifact of that example. Had I picked a different
example, the network speed would not have been an issue but the foreground
problem would have remained.

For two reasons, that's not important though.

The first reason is that the speedtest was just an easy example that anyone
could reproduce in seconds.

The second reason is that we're NOT running anything else on the net ANYWAY
for these tests. We're just shifting the background from the speedtest tab
to a blank tab. That doesn't use up ANY network resources.

Back to the advice you make and that John made, where we can ask WHY any
web site (not just this simple made up example) might set up their software
to only work if the focus is on "their" tab.

I can think of two obvious reasons where there may be more.

One obvious reason for any given web site is that the web site likely has a
vested interest on you STAYING on their tab if they're "doing work" for you
on their servers.

The other obvious reason for any web site is that they might have
advertisements running, which again is a vested interest in you STAYING on
their tab as the foreground tab.
  #14  
Old February 17th 19, 07:36 AM posted to alt.windows7.general
Hathie
external usenet poster
 
Posts: 2
Default browser tab focus

Jean Fredette wrote:

Why would just switching the speedtest tab to "background" mode have any
"real" impact on the speedtest results?


Each browser manufacturer has its own reasons and viewpoint.

For example, here is Google's (Chrome) viewpoint:
https://developers.google.com/web/up...ackground_tabs

And this is a more technical view from Mozilla (Firefox):
https://hacks.mozilla.org/2017/06/an...om-scheduling/

  #15  
Old February 17th 19, 04:57 PM posted to alt.windows7.general
Jean Fredette
external usenet poster
 
Posts: 47
Default browser tab focus

Hathie posted:

Each browser manufacturer has its own reasons and viewpoint.


That's intriguing that it's the "browser" and not the "web site" making
that determination of how to handle an action once a tab is "backgrounded".

For example, here is Google's (Chrome) viewpoint:
https://developers.google.com/web/up...ackground_tabs


Thank you for that page where they start off talking about "battery life".
They go into more details such as audio is always considered foreground.

They refer to a "page visibility API" to detect browser tab backgrounding.
They also have a "requestAnimationFrame" which only works in foreground.
In addition, each background tab has a "time budget" for running timers.
That time budget is 10 seconds but confusingly, it can be "regenerated".

There is also an "opt out" named "--disable-background-timer-throttling"

I just tried it with the speedtest example but the speedtest still stopped.
https://www.askvg.com/how-to-enable-...-web-browsers/
chrome://flags/
Throttle expensive background timers = disabled

And this is a more technical view from Mozilla (Firefox):
https://hacks.mozilla.org/2017/06/an...om-scheduling/


It seems that the browser manufacturer is the one who cares most.
They seem to care about cpu performance and battery life.
They don't want the cpu "crowded with tasks."
And they worry about the lacks of prioritization between tasks.

But then it got too complex for me.
 




Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off






All times are GMT +1. The time now is 10:45 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 PCbanter.
The comments are property of their posters.