Skip to content

Commit 7524659

Browse files
author
Yi Fan Yu
committed
chromium: Add chrome-virtual-keyboard recipe
chrome-virtual-keyboard is an extension to chromium that has a javascript on-screen keyboard that allow users to use chromium without a physical keyboard. According to chrome webstore, there are over 700K users. limitations: * upstream hasn't maintained this extension for a long time * not all textbox will work, notably iframes How to use: Enable through chromium PACKAGECONFIG vkeyboard-extension. leveraging the chromium flag: --extension-load="" to load a local unpacked extension. Signed-off-by: Yi Fan Yu <[email protected]>
1 parent 1bff166 commit 7524659

File tree

3 files changed

+45
-3
lines changed

3 files changed

+45
-3
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# class for defining extension dir for chromium
2+
3+
CHROMIUM_EXTENSION_DIR = "${datadir}/chromium-extension"
4+
5+
VIRTUAL_KEYBOARD_DIR = "${CHROMIUM_EXTENSION_DIR}/chrome-virtual-keyboard"
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
SUMMARY = "Chromium Virtual Keyboard"
2+
DESCRIPTION = "Virtual Keyboard Extension for Chromium/Chrome"
3+
HOMEPAGE = "https://apps.xontab.com/VirtualKeyboard"
4+
LICENSE = "MIT"
5+
LIC_FILES_CHKSUM = "file://LICENSE;md5=a8366463bacd4f2ec5edd419e8a113ff"
6+
7+
SRC_URI = " \
8+
git://github.com/xontab/${BPN}.git \
9+
"
10+
SRCREV = "e2b9adf4885cc4ed600cd9bccb77e0df8ff549aa"
11+
S = "${WORKDIR}/git"
12+
PV = "1.11.3+git${SRCPV}"
13+
14+
inherit allarch chromium-extension-package
15+
16+
do_compile() {
17+
:
18+
}
19+
do_install() {
20+
install -d ${D}${CHROMIUM_EXTENSION_DIR}/
21+
cp -r ${S} ${D}${CHROMIUM_EXTENSION_DIR}/${BPN}
22+
23+
# remove unecessary artifacts
24+
rm -f ${D}${CHROMIUM_EXTENSION_DIR}/${BPN}/_config.yml
25+
rm -rf ${D}${CHROMIUM_EXTENSION_DIR}/${BPN}/.git/
26+
}
27+
28+
FILES_${PN} += "${CHROMIUM_EXTENSION_DIR}/${BPN}"

meta-chromium/recipes-browser/chromium/chromium-gn.inc

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ require chromium.inc
22
require chromium-unbundle.inc
33
require gn-utils.inc
44

5-
inherit features_check gtk-icon-cache qemu
5+
inherit features_check gtk-icon-cache qemu chromium-extension-package
66

77
# The actual directory name in out/ is irrelevant for GN.
88
OUTPUT_DIR = "out/Release"
@@ -116,14 +116,16 @@ PACKAGECONFIG[proprietary-codecs] = ' \
116116
ffmpeg_branding="Chrome" proprietary_codecs=true, \
117117
ffmpeg_branding="Chromium" proprietary_codecs=false \
118118
'
119-
120119
# Disable VA-API by default. It is compile time enabled since M88, but it's not
121120
# desired to make all the users of the Chromium meta-browser recipe depend on
122121
# libva without a real need. Both X11 (non-Ozone) and Wayland (Ozone) can use it,
123122
# but remember to also use proprietary codecs so that H.264 is supported. Also note
124123
# that not all the hardware configs might be supported.
125124
PACKAGECONFIG[use-vaapi] = "use_vaapi=true,use_vaapi=false,libva"
126125

126+
# chrome/chromium extension for virtual keyboard
127+
PACKAGECONFIG[vkeyboard-extension]= ",,,chrome-virtual-keyboard"
128+
127129
# Base GN arguments, mostly related to features we want to enable or disable.
128130
GN_ARGS = " \
129131
${PACKAGECONFIG_CONFARGS} \
@@ -309,10 +311,17 @@ GN_ARGS_append_armv6 += 'arm_use_neon=false'
309311
# https://github.com/gperftools/gperftools/issues/693
310312
GN_ARGS_append_libc-musl = ' use_allocator_shim=false'
311313

314+
315+
# Add chromium extensions here
316+
CHROMIUM_EXTENSIONS = " \
317+
${@bb.utils.contains('PACKAGECONFIG', 'vkeyboard-extension', '${VIRTUAL_KEYBOARD_DIR}', '', d)} \
318+
"
319+
312320
CHROMIUM_EXTRA_ARGS ?= " \
313321
${@bb.utils.contains('PACKAGECONFIG', 'use-egl', '--use-gl=egl', '', d)} \
314322
${@bb.utils.contains('PACKAGECONFIG', 'impl-side-painting', '--enable-gpu-rasterization --enable-impl-side-painting', '', d)} \
315323
${@bb.utils.contains('PACKAGECONFIG', 'kiosk-mode', '--kiosk --no-first-run --incognito', '', d)} \
324+
--load-extension=${@",".join(d.getVar('CHROMIUM_EXTENSIONS').split())} \
316325
"
317326

318327
# V8's JIT infrastructure requires binaries such as mksnapshot and
@@ -429,7 +438,7 @@ do_install() {
429438

430439
# Add extra command line arguments to the chromium-wrapper script by
431440
# modifying the dummy "CHROME_EXTRA_ARGS" line
432-
sed -i "s/^CHROME_EXTRA_ARGS=\"\"/CHROME_EXTRA_ARGS=\"${CHROMIUM_EXTRA_ARGS}\"/" ${D}${libdir}/chromium/chromium-wrapper
441+
sed -i "s#^CHROME_EXTRA_ARGS=\"\"#CHROME_EXTRA_ARGS=\"${CHROMIUM_EXTRA_ARGS}\"#" ${D}${libdir}/chromium/chromium-wrapper
433442

434443
# This is ANGLE, not to be confused with the similarly named files under swiftshader/
435444
if [ -e libEGL.so ]; then

0 commit comments

Comments
 (0)