How can I make setInterval also work when a tab is inactive in Chrome?

On most browsers inactive tabs have low priority execution and this can affect JavaScript timers. If the values of your transition were calculated using real time elapsed between frames instead fixed increments on each interval, you not only workaround this issue but also can achieve a smother animation by using requestAnimationFrame as it can get … Read more

How to access the webpage DOM rather than the extension page DOM?

Extension pages/scripts such as the browser_action popup or ManifestV2 background script have their own DOM, document, window, and a chrome-extension:// URL (use devtools for that part of the extension to inspect it). ManifestV3 service worker doesn’t have any DOM/document. You need a content script to access DOM of web pages and interact with a tab’s … Read more

Can a website detect when you are using Selenium with chromedriver?

Basically, the way the Selenium detection works, is that they test for predefined JavaScript variables which appear when running with Selenium. The bot detection scripts usually look anything containing word “selenium” / “webdriver” in any of the variables (on window object), and also document variables called $cdc_ and $wdc_. Of course, all of this depends … Read more

Chrome / Safari not filling 100% height of flex parent

Solution Use nested flex containers. Get rid of percentage heights. Get rid of table properties. Get rid of vertical-align. Avoid absolute positioning. Just stick with flexbox all the way through. Apply display: flex to the flex item (.item), making it a flex container. This automatically sets align-items: stretch, which tells the child (.item-inner) to expand … Read more

Is Chrome’s JavaScript console lazy about evaluating objects?

Thanks for the comment, tec. I was able to find an existing unconfirmed Webkit bug that explains this issue: https://bugs.webkit.org/show_bug.cgi?id=35801 (EDIT: now fixed!) There appears to be some debate regarding just how much of a bug it is and whether it’s fixable. It does seem like bad behavior to me. It was especially troubling to … Read more