Page 1 of 1

How to add old or own Chrome extension

Posted: 09 May 2019, 21:40
by tomas_223
Hi guys.
This is little tutorial how to add some unsupported, old or your own extension (add-on) to Google Chrome.
I was struggling with this for longer time and couldn't find suitable solution for my use case
when I want to be loaded without any cooperation with user and can kiosk can be restarted.
So maybe it will help to somebody else too.

1)
Prepare your own module that will contain unpacked Chrome extension.
Create directories "home", "guest" and "keyboard_extension" like this

Code: Select all

./home/guest/keyboard_extension

and put your unpacked extension there.

2)
Create file

Code: Select all

./home/guest/on_startup.sh
and put following code in it:

Code: Select all

#!/bin/sh

CHKEYFLAG="--load-extension=/home/guest/keyboard_extension/"

# add chrome startup flag
grep -q load-extension $chflags || echo $CHKEYFLAG >> $chflags
3)
Give it exec rights

Code: Select all

chmod 755 on_startup.sh
4)
Put following code somewhere online.

Code: Select all

// enable adding custom chrome extension
"ExtensionInstallBlacklist": [],
Or feel free to use link to my gitlab:
https://gitlab.com/tomas223/porteus-kio ... licies.txt

5)
Put following lines to your portreus config:

Code: Select all

browser_preferences=https://gitlab.com/tomas223/porteus-kiosk-config/raw/master/chrome-policies.txt
run_command=sh /home/guest/on_startup.sh
6)
Now pack whole "home" directory with mksquash command. For how to check: https://porteus-kiosk.org/modules.html
And finally prepare kiosk ISO file. Check https://porteus-kiosk.org/kiosk-customization.html

How to add old or own Chrome extension

Posted: 10 May 2019, 04:56
by fanthom
Great tutorial tomas,

I'm sure it will be useful to others.

One thing to note, this command:

Code: Select all

grep -q $CHKEYFLAG || echo $CHKEYFLAG >> $chflags
should be:

Code: Select all

grep -q load-extension $chflags || echo $CHKEYFLAG >> $chflags
otherwise your flag will be added to flags file during every session restart.

Thank you.

How to add old or own Chrome extension

Posted: 10 May 2019, 17:47
by tomas_223
Thanks fanthom!

I see that little bug there now :)
I will fix my post