How to remap a key using AHK to open and close Google Chrome - google-chrome

I am new to AHK and been trying to fidget around with it for quite some time, what I need to do is open a specific profile of Google Chrome when a key is pressed and if it's open close it when the same key is pressed. I tried many things but can't quite figure out how to do it, this is what I have right now.
PgDn::
Process, Exist, chrome.exe
If ErrorLevel <> 0
Process, Close, chrome.exe
Else
Run, "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --profile-directory="Profile 1"
return
This opens up the chrome to a profile I want but when I close press the button again it closes any and every chrome window open. I understand that's because I close the chrome.exe process, I cannot figure out how to close that specific profile.
Ultimately what I want to do is when the Page Down key is pressed
If Chrome Profile 1 is not opened, open it.
If Chrome Profile 1 is minimized, maximize it.
and if Chrome Profile 1 is opened and maximized, close it.
I would really appreciate if someone could assist with this.

AHK's Run command has a parameter named: OutputVarPID.
you can use this to store the process id of the started chrome instance in a variable, which you can then pass to your Exit command.

Related

How to create a Tab Group in Google Chrome from the command line

I use a script to open my browser and a bunch of tabs, for when I accidentally close the browser, with a small window still open in the background (SPAM windows, etc.). The problem is, with Google Chrome set to continue where I left off, when I restart the computer, or Google Chrome, I just get a single windows open with the tab, not my pinned tabs, and tab groups.
Is there a way to create a tab group from the command line?
I have tried a few ways of doing this, but the scripting I can find, will only open the tab in the browser, not actually allow me to create a tab group.
I have tried using:
"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" google.com mysite.com
This will load the pages as tabs, but I cannot create a tab group.
I have tried Python
python -m webbrowser google.com mysite.com
I cannot see anyway to create a tab group.

When trying to access the internet chrome is showing"google.com redirected you too many times" and throwing error"ERR_TOO_MANY_REDIRECTS"

Whenever I am trying to access any website in any browser I am getting the error
ERR_TOO_MANY_REDIRECTS
google.com redirected you too many times.
I tried to clear the cache, cookies,reset the setting in chrome, delete browser history, turning off the hardware acceleration, tried to create a new profile but nothing is working also I deleted all the extensions and uninstalled and reinstalled chrome. Even tor is not responding what should I do guys please help me I am not able to study and my exams are nearing.
Outdated date or time settings might be another reason for ERR_TOO_MANY_REDIRECTS
Chrome error.
Follow these steps to set proper date/time on your PC:
Click Win+R keys to open Run dialog.
Type control in the Run box and click OK.
Once you end up on Control Panel, choose Date and Time option.
Open Internet Time tab and click Change settings button.
In the newly appeared window, mark the checkbox next to Synchronize with an Internet time server option and select time server.
Click Update now button and then OK.
Try accessing the website again. Hopefully, this has helped to get rid of the Chrome redirect error.

Auto start and join google video hangout in chrome browser from ubuntu terminal

I have been looking all over for this and I feel like this should be very straight forward.
I am setting up a conference room computer and I want to automate starting AND joining a google video hangout in google chrome from a script that I run in the terminal. Very specific to start and join from terminal because I would like to do other scripting around starting, stopping, timing, etc.
google-chrome --start-fullscreen --app=https://hangouts.google.com/hangouts/_/company_name/room_name
This will open a new google-chrome web browser and get me all the way to the goal line, however I need to hit the 'Join' button to get into it. I was wondering how I can do something similar to what I have but automatically 'Join' the hangout?
I have also faced same issue while automating google hangouts.. You can below work around for ubuntu.
You can use xdotool utility to send keyboard/ mouse events. As you launch hangout conference call using CLI, focus already on join button. Just use below command just after launching hangouts.
xdotool key KP_Enter
Example:
google-chrome --start-fullscreen --app=https://hangouts.google.com/hangouts/_/company_name/room_name;
sleep 10;
xdotool key KP_Enter;
I was trying for the same thing but on OSX. I found that if you press the return key twice, it will join. I was unable to execute javascript to click on the button so I resorted to that.
I would think the answer be a script that does that first portion you mentioned adding on 2 return key presses on the active window which should be Google Chrome.

start google chrome without switches

Is there a way to start google chrome without switches?
Is there a file where I can see and manage all current enabled switches?
If I enter chrome://version in the URL, I can see that currently there are some enabled switches that I can't find under chrome://flags, and I need to know if is there some file where they are stored, and if can I edit it, or if can I start chrome from command line without switches..
Please help
Try start chrome.
You can also go to "Run..." by pressing "Windows Key" + R, and type chrome.
Try chrome --help to see the switches.
Also there is a web page that list all switches

Chrome dev tools console completely blank

The problem is not that my console.log is not printed in the console. The problem is that the console is initially blank. I need to switch the tabs back and forth to get it working. Steps to reproduce:
1. Open Google chrome
2. Open some page
3. Open the console with Ctrl+Shift+I or F12
I even reinstall the browser (I kept the settings, because I can't afford to delete everything). Of course I removed all the extensions and disabled all the plugins. Still the same thing. Is there any application cache which I could delete to fix the problem.
Here is a screenshot:
P.S.
The error which you see is actually from the current page. It is not from the console. Here is what I see when open dev tools inside dev tools:
Uncaught TypeError: Cannot call method 'statusBarResized' of undefined inspector.js:2181
And all this happen after the latest big update of the browser.
Your preferences have probably become corrupted. If you can reproduce the bug, please open a ticket at http://crbug.com/new.
Reset the preferences to resolve the issue. These are saved in localStorage on chrome-devtools://devtools, so you need to open the devtools of the devtools (step 1-2 of https://stackoverflow.com/a/21149275/938089), and either:
Run localStorage.clear() (switch to the Console tab or press Esc to open a drawer)
OR Go to Resources, Local Storage and delete all items of the dev tools one by one.
The suggestion of clearing localStorage either didn't work or only worked temporarily for me. As mentioned in some of the comments, the solution that worked for me was to:
Open developer tools
Open settings pane from top right (or F1)
Click the 'Restore defaults and reload' button
I should also mention that I'm using Google Chrome 53.0.2754.0 canary (64-bit).