selenium chromedriver headless force youtube darkmode - selenium-chromedriver

i have a little webscrapping script in python for whom i need to take screenshots of youtube comments and i want to run the script in a selenium chrome instance headless and now the question is how can i force to run youtube in dark mode i already tried alot like to add the option:
options.add_argument("--force-dark-mode") #doesnt work with headless
or use a user-data- profile like:
options.add_argument(f"user-data-dir={chrome_path}"
but nothing is working consistent sometimes youtube is darkmode sometimes not that is what confuses me.
I was thinking of a workaround like toggle darkmode via a little javascript script everytime i start a instance of chrome, does anyone have any experience in stuff like that would helping me alot.
maybe a workaround to change pixel color from white to black and font color from black to white would be another way to do it

Related

The google translator icon disappears from my address bar when I load my website

I need to be able to translate my web application into another language. I enabled the google translate extension in chrome. When I load my company website with chrome the translate icon appears and I can translate the site. I then loaded my secure web application in chrome and the translate icon disappeared. My knowledge on how the translator works with web pages in minimal at best. Any help would be appreciated as I do not know where to begin. Any links to helpful articles on how the translator does its job would also be appreciated
I also had a problem with the google translate (gt) icon disappearing from the right side of the Chrome address bar. I believe I caused the problem myself as I was trying to come up with a way to use it to switch languages quickly using Keyboard Maestro.
I keep 2 Chrome windows open with 2 different gmail accounts, and the gt icon was only missing from one of the windows. I tried many things and couldn't get the gt icon to come back.
Eventually, I was able to fix the problem based on the procedure described on this page, which suggests going to this address: chrome://settings/languages to make sure the Offer to translate pages that aren't in a language you read option is on in the Languages section, as shown in this image:
In my case, the option was already set to on. So I turned it off, logged out of the account associated with that Chrome window, closed that browser window, and when I opened a fresh browser window for that gmail account the gt icon was back.
I'm using Chrome Version 96.0.4664.93 on a MacAir (M1, 2020) running MacOS 12.0.1

PDF Rendering Gibberish in Browser

I built a PDF in Illustrator, and am linking to it from a web page. It looks fine in SumatraPDF and in the Windows preview pane, but the browser renders this (just so you know, this is not how I want it to look)
Is this because I have font embedded? The only thing that I want to have happen with this is for a couple links on it to be clickable; otherwise, I'd convert it all to outlines. Is there something I need to do here that I haven't done?
EDIT: Here's a weird update about this. The browser follows the link embedded in the pdf when I click it. So it has the right data, but the wrong presentation apparently.
I'm assuming you are/were using either the Dev or Canary channel of Chrome. There was an experiment running in both channels that was causing this, which has since been reverted in Canary but is still affecting Dev 59.0.3053.X. For the more technical; this experiment enabled the PDFium code to use Skia to render paths instead of Anti-Grain Geometry and caused this font gibberish.
Here is the link to the bug report:
https://bugs.chromium.org/p/chromium/issues/detail?id=705039
UPDATE: This was fixed in the Dev Channel with update 59.0.3071.X

Ionic transitions getting white page only in ios

Im developing an app in ionic and its working perfectly fine in android, emulators and web (with ionic serve). But when is running in ios devices in transitions between pages suddenly it shows a white view instead the view that it have to display. This doesn't happen all time and i didn't figured out when specifically happen.
I appreciate any help.
it is probably a javascript error. To find it, the best way is:
first connect the phone with your mac (must be a mac) by USB.
Open Safary (no Chrome or Firefox)
In the Safary settings -> Advanced -> enable develop tools
Now on Safary will appear a develop menu on the top, click on it and you will see your phone and the app running, click on it.
In the develop tools, will appear all the console you normally see testing with ionic serve, but in the real device.
Just use the app and when you get a black page check the javascript error on safary develop tool.
I hope it helps, it did helped me a lot after discover it.
Finally I resolve it, it was a problem with transitions of ionic in ios. Adding this line to config in app.js like this
.config(function($stateProvider, $urlRouterProvider, $ionicConfigProvider) {
$ionicConfigProvider.views.swipeBackEnabled(false);
}
Disable all back navigations transitions with swipe.
For what I searched, it can be a lot of things.. What helped me to figure out my case was small commits.
Anyway, I tried to use default param values and it doesn't work for my webview in iOS. If that's your problem too, you can see an alternative way to do default param values here:
Set a default parameter value for a JavaScript function
didn't work:
function(param = defaultValue){}
did work:
function(param){
param = param ? param : defaultValue;
}
Simply use can-swipe-back="false" on your ion-view element.

unity player chrome error making me crazy

I want to open unity game in my chrome browser but it’s always showing me error that says Unity web Player Needs Your Permission and it’s not playing. I've installed unity player in my PC.
I have already tried all things but still it’s not working.
I don't know how to solve this... help please!
Enter chrome://plugins/ into the URL bar for Chrome. Find the Unity Player Plugin and check the box for Always Allowed.
I imagine you just haven't allowed the plugin to run. When you try and run it, do you see an icon at the right end of the URL bar? If you do, that icon indicates a plugin was blocked. When you click on it, you should be able to decide what to do with it (allow or continue blocking).
You can find some more info here.

Flash movie becomes while blank after switching browser tabs

I have the following issue:
When I load my flash app in Google Chrome everything works fine. But when I switch to another tab in browser, wait a bit and switch back instead of my flash app I see white area. Moreover, when I do right-click on it I see flash menu (that one you normally see on right-click).
I see this strange issue only in Google Chrome.
I have Google Chrome 19.0.1084.56 and it runs on Mac.
Any ideas and thoughts are welcome!