Page 1 of 1

Chrome Extension Autolaunch

Posted: 13 Aug 2018, 23:33
by specialised
Hi All,

Info seems to be scarce other than running a chrome extension dated from 2013.

I need to launch an extension in chrome on boot.

Has anyone got any experience with this?

I have successfully modified my policies file to automatically download the extension and it all works fine up to that point.
My default page is set to chrome://apps which is great but that one last step of full automation would be a huge win!

Thanks in advance guys.

Chrome Extension Autolaunch

Posted: 14 Aug 2018, 07:57
by fanthom
Not sure if this is what you want but I have installed this Chrome app:
https://chrome.google.com/webstore/deta ... ofgeadjhnf

And i'm able to run it during kiosk boot with following parameter (in a loop so it reopens when closed):

Code: Select all

run_command=while true; do su - guest -c "chrome --app-id=jfmhmcdjmeoihgkcnjgjopofgeadjhnf"; done

Chrome Extension Autolaunch

Posted: 14 Aug 2018, 12:12
by specialised
Thanks I'll let you know how it goes

Chrome Extension Autolaunch

Posted: 15 Aug 2018, 05:46
by specialised
Sorry, this didn't work.

I tried using root as the user, nothing

Steps I performed were
1/ Add the extension ID to the line above
2/ Added it to my config file

It now does not even load Chrome.

Chrome Extension Autolaunch

Posted: 15 Aug 2018, 07:00
by fanthom
Remember that you are starting with a clean profile and extensions are installed when Chrome is started, not before.

You would have to use 'persistence=full' and at least once start the Chrome or modify the ISO and include your extension in it by default.

Chrome Extension Autolaunch

Posted: 15 Aug 2018, 14:04
by specialised
I have full persistence on and am customising a few things with the ISO so I will take a look at that.

Chrome Extension Autolaunch

Posted: 17 Aug 2018, 04:52
by specialised
I can confirm once chrome has started I can SSH in and run (not a legit chrome app):

Code: Select all

su - guest -c "chrome --app-id=kjasdhflawnwfnasdfajsdnfkak"
But if I run it as part of "run_command" in the config file it never works.

Reading through the parameters guide it looks like run_command is executed just after the network is active:
Your commands will be executed once the network is established so utilities like rsync, wget and also graphical ones could work
So my guess is that Chrome is not running when the command is fired.

If I put the command in a loop as suggested Chrome never runs.

Is there a way to fire the command after Chrome has launched and the extension has downloaded?
Even if I bundle the extension (still trying to figure this out so hints welcomed) the run_command string will fire before Chrome starts.

Chrome Extension Autolaunch

Posted: 17 Aug 2018, 06:04
by fanthom
I thought you need to run just the Chrome app and not Chrome + app.

For second case use this:

Code: Select all

run_command=( sleep 20; su - guest -c "chrome --app-id=jfmhmcdjmeoihgkcnjgjopofgeadjhnf"; ) &
If you want to run your app in a loop then:

Code: Select all

run_command=( sleep 20; while true; do su - guest -c "chrome --app-id=jfmhmcdjmeoihgkcnjgjopofgeadjhnf"; done; ) &

Chrome Extension Autolaunch

Posted: 17 Aug 2018, 06:43
by specialised
OK Thanks, that did it.

I was trying to put sleep in there also but I wasn't sure of the formatting. ie 2m, 120s etc

Am I assuming 20 is in seconds? It seemed to boot that quick.

Thanks again for your help, I will be in touch for the other stuff.

For anyone reading this, the following worked for me (obviously you have to download the extension and change its ID below)

Code: Select all

run_command=( sleep 20; su - guest -c "chrome --app-id=gmdgbdlpbnhiogedlhmdiceocbgcbpgi"; ) &

Chrome Extension Autolaunch

Posted: 17 Aug 2018, 08:33
by fanthom