N
N
Nadim Zakirov2019-10-27 21:24:27
Google Chrome
Nadim Zakirov, 2019-10-27 21:24:27

How to disable freezing tabs in a Google Chrome extension?

I am developing parsers and browser bots in JavaScript. As a rule, I design my products as an extension for the Google Chrome browser. In this connection, I have an important question for me.
Is it possible somehow to prescribe in the extension a prohibition to freeze the tabs (sites) on which the content script was loaded? Doesn't the extension API provide similar functionality by any chance? Can be in the manifesto it is possible to register such prohibition? Or can I open sites inside the background page, and then perform the necessary actions there? I heard that the background page is usually always active, I don't know if it's true.
Any advice, ideas or suggestions you may have.My ultimate goal is to be able to minimize the window with the bot and be sure that Chrome does not freeze the processes in this window, thereby killing the bot.

Answer the question

In order to leave comments, you need to log in

4 answer(s)
D
DevMan, 2019-10-27
@zkrvndm

IMHO, it's easier to run a separate chrome for the bot, and forbid him to freeze tabs at all.

R
rPman, 2019-10-27
@rPman

Since you have bots, throw away ready-made heavy browsers and write your own webkit based on 10-15 lines plus a couple of lines to launch your bot. In your application, you can create as many simultaneous frames as you want, multithreaded, any size, etc.
Disadvantage - pure webkit and chromium (with Google support, I remember exactly they basically refused to commit the gpu code for accelerating video playback into it) - brakes with video playback (because decoding on pure cpu), but I don’t think that bots watch it from your browser .
ps in .net from microsoft the WebBrowser component works on the basis of Internet Explorer, also without problems, on mono it works on the basis of mozilla firefox

S
Shohruh Shaimardonov, 2019-10-27
@joeberetta

I'm not sure, but it seems that chrome had a flag: automatic-tab-discarding
Go to chrome://flags and find the above flag. It needs to be turned off

S
Soul1Eat, 2019-10-28
@Soul1Eat

What's the problem with using nightmare or Puppeteer?
They have good docks, and the API is not complicated, you can safely use their functionality, or simply run them with injections.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question