How to open url in existing active tab of chromium - tabs

I have chromium running in kiosk mode, sometime I want to open different url in same existing tab using command, I don't want to open new tab because I want to show something different every other time of day (it would otherwise open hundreds of new tabs after long time). I want to use bash script launched using cron.
Is there some parameter like chromium --same-tab <URL> ? Or do I need to do something using xdotool.
I don't want to killall chromium because it will for few second show black screen until new instance appears (I have desktop with black background, openbox only).

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.

save state chrome extension with event pages

I have a Chrome extension I am working on that queries a remote server and shows a desktop notification when it changes. I am using an event page which will frequently go to sleep so I use a Google Alarm to have it do a check every 5 minutes. I save the last state out into a variable and compare it to current state to determine if a desktop notification should be displayed. I'm finding this last state variable is frequently going undefined when chrome is not in the foreground or under other conditions. I have a few variables this may be happening to as well.
How do I prevent this from happening?

how to run batch file in chrome

I tried using very simple HTML to create several links to several batch files on my server that are intended to run when users click on the links. Using Chrome, every time I click on one of those files my browser displays the script itself (even though its a .bat) and doesn't actually run the script. Internet Explorer runs it every time, however all the users on the network use Chrome for web browsing.
Is there any way to force Chrome (preferably through HTML or VB or some other scripting on the page itself rather than change all of the users' browser settings) to run these batch files when the user clicks on the link?
The answers given so far - that it's "not possible" - are incorrect or outdated. Using Chrome Apps you can call executables (called "hosts") if they are registered with Chrome. Of course a Chrome App is a client application so you need to distribute it.
See https://developer.chrome.com/extensions/nativeMessaging#examples
HTML, JS on browser cannot run shell command, command line. You have to implement server script to execute your bat file then call it from HTML, JS via Ajax or direct link.

"Chrome legacy Window" when launching chrome with RunAs

I am trying to use MSAA (on Win7) to get the addressbar in chrome browser and replace it with a different url. When chrome is launched normally (as the loggedon user), I am able to find the addressbar using the IAccessible interface by traversing through the UI tree of the window classes owned by the process.
However, if I launch chrome as a different user (by using RunAs in windows), I see window with name, "chrome legacy window" when going through the classes owned by the "RunAs" process. The window hierarchy and the content within is vastly different from what I see if I scan the process that is running as the logged on user.
Although I can see (window classnames) Chrome_WidgetWin_0 & Chrome_WidgetWin_1 in both the browser instances, only the one running as the current user is giving access to the address bar.
Any idea on what is happening when chrome is launched as a different user? Is there any workaround or should I be looking at a different technology?
As Penn has noted this may have something to do with the PDF view which has caused peculiar problems in the strangest of places.
Looking at the bug tracker here it looks like sporadic behaviour with PDFs and the "legacy window" has been introduced in a recent build so perhaps try rolling back to an earlier version of Chrome.
Also I presume you are using chrome://accessibility with
Global accessibility mode: on
Show internal accessibility tree instead of native: on
or starting chrome with the flag --force-renderer-accessibility it seems to be a prerequisite for other automation programs like autoit as seen here.
If you can't get this method working I'd recommend trying the autoit script there.
Here is an autoit code example that shows grabbing the address bar and using it for general navigation, upon other things!
I have found that if a PDF file is open in the chrome viewer (in some versions of chrome) the window you referred to appears. Please confirm what URL is being used when you open chrome.
I have also read that a password request prompt can cause the same window to open. The PDF window only appears if the window is launched by certain processes/users

Chrome only works on the first session for multi-session logins

I haven't found anything looking like a good answer to my problem, so I'll articulate my own question:
On a Terminal-/Remote Desktop Server (2012 R2), we have a problem running Chrome where there are multiple sessions for the same user. (e.g. a shared "Front Desk" AD user where 2 or 3 people at work may be logged into 4 or 5 RDP sessions with the same user account)
The first launch of Chrome works fine for whichever session opens it. None of the other sessions can use Chrome, however, at least not until the initially launched program instance is closed.
I found an explanation followed by a very unsexy suggestion in the Chromium forums (https://code.google.com/p/chromium/issues/detail?id=160676), so I'm trying to ask here instead in hope that there is a better and more intuitive solution to the problem.
Thank you!
I've solved by, for each concurrent session needed:
In chrome click on Manage people, then Add person, checking Create a desktop shortcut for this user.
Chrome will create a desktop shortcut with the Target property such as:
"C:\......\chrome.exe" --profile-directory="Profile 1"
Edit the Target property of the created desktop shortcut and add a unique folder value for the --user-data parameter:
"C:\......\chrome.exe" --profile-directory="Profile 1" --user-data-dir="C:\temp\user1"
I don't see your log or any other trace clue.
One of my guess chrome's user data directory was locked by the chrome opened.
You might try open the chrome from cmd with this command:
chrome.exe --user-data-dir="C:\temp\user1"
It is starting chrome with a new user data directory.
Workaround details for this issue are here:
https://code.google.com/p/chromium/issues/detail?id=160676
You may want to uncheck the option that lets Chrome run in the background even if "closed"
Click on the Chrome menu (or press Alt+E) Select Settings Click on the link titled ‘Show advanced settings‘ Under the section headed ‘System‘ untick the box next to “Continue running background apps when Google Chrome is closed”