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

Use a content script to access the page context variables and functions

Underlying cause: Content scripts are executed in an “isolated world” environment. Solution: Inject the code into the page using DOM – that code will be able to access functions/variables of the page context (“main world”) or expose functions/variables to the page context (in your case it’s the state() method). Note in case communication with the … Read more

What is a user agent stylesheet?

What are the target browsers? Different browsers set different default CSS rules. Try including a CSS reset, such as the meyerweb CSS reset or normalize.css, to remove those defaults. Google “CSS reset vs normalize” to see the differences.

Javascript / Chrome – How to copy an object from the webkit inspector as code

Right-click an object in Chrome’s console and select Store as Global Variable from the context menu. It will return something like temp1 as the variable name. Chrome also has a copy() method, so copy(temp1) in the console should copy that object to your clipboard. Note on Recursive Objects: If you’re trying to copy a recursive … Read more

Differences between socket.io and websockets

Misconceptions There are few common misconceptions regarding WebSocket and Socket.IO: The first misconception is that using Socket.IO is significantly easier than using WebSocket which doesn’t seem to be the case. See examples below. The second misconception is that WebSocket is not widely supported in the browsers. See below for more info. The third misconception is … Read more

How to change the color of header bar and address bar in newest Chrome version on Lollipop?

Found the solution after some searching. You need to add a <meta> tag in your <head> containing name=”theme-color”, with your HEX code as the content value. For example: <meta name=”theme-color” content=”#999999″ /> Update: If the android device has native dark-mode enabled, then this meta tag is ignored. Chrome for Android does not use the color … Read more

Chrome ignores autocomplete=”off”

Prevent autocomplete of username (or email) and password: <input type=”email” name=”email”><!– Can be type=”text” –> <input type=”password” name=”password” autocomplete=”new-password”> Prevent autocomplete a field (might not work): <input type=”text” name=”field” autocomplete=”nope”> Explanation: autocomplete still works on an <input>despite having autocomplete=”off”, but you can change off to a random string, like nope. Others “solutions” for disabling the … Read more

Updating address bar with new URL without hash or reloading the page [duplicate]

You can now do this in most “modern” browsers! Here is the original article I read (posted July 10, 2010): HTML5: Changing the browser-URL without refreshing page. For a more in-depth look into pushState/replaceState/popstate (aka the HTML5 History API) see the MDN docs. TL;DR, you can do this: window.history.pushState(“object or string”, “Title”, “/new-url”); See my … Read more