Chromium亭模式:全屏和删除地址栏



我试图在Raspberry Pi 3(官方Jessie)的售货亭模式下运行Chromium浏览器。

这是我在AutoStart文件中添加了

@point-rpi
@xset s noblank
@xset s off
@xset -dpms
@chromium-browser --kisok www.fb.com

这很好,但是发生了一些问题。

在整个窗口中未打开浏览器,地址栏仍然存在于Chromium

因此,如何删除上面的两个项目

对于完整的售货亭模式,您可能需要始终隐藏Chromium scrollbars以获取网页。这不会在触摸屏上禁用滚动。它只是禁用滚动条。

使用铬 - 浏览器使用 - 启用功能标志为我做到了。

--enable-features=OverlayScrollbar,OverlayScrollbarFlashAfterAnyScrollUpdate,OverlayScrollbarFlashWhenMouseEnter

这是我的完整命令:

    /usr/bin/chromium-browser --kiosk --noerrdialogs --enable-features=OverlayScrollbar --disable-restore-session-state http://10.10.0.16:8123

另外,为了完全隐藏鼠标光标,我在/etc/lightdm/lightdm.conf上更改了x命令,从 xserver-command=X更改为 xserver-command=X -nocursor

我也有类似的问题...我最终在主目录中的.xinitrc文件中使用了此问题。

#Disable DPMS.
xset -dpms
xset s off
xset s noblank
#Lets remove a lock file that could be caused due to a crash.
rm /home/pi/.config/chromium/SingletonLock
while true; do
    # Clean up previously running apps, gracefully at first then harshly
    killall -TERM chromium-browser 2>/dev/null;
    killall -TERM matchbox-window-manager 2>/dev/null;
    sleep 2;
    killall -9 chromium-browser 2>/dev/null;
    killall -9 matchbox-window-manager 2>/dev/null;
    # Launch window manager without title bar.
    exec matchbox-window-manager -use_titlebar no -use_cursor no -theme bluebox &
    # Run unclutter
    unclutter &
    # Launch browser.
    chromium-browser --incognito --kiosk --noerrdialogs --disable-translate --disable-cache --disk-cache-dir=/dev/null --disk-cache-size=1 --app=http://URL_TO_GO_TO
done;

我使用Matchbox Windows Manager,必须进行其他一些调整,但这是我使用的。

尝试更改为此

#@xscreensaver -no-splash  # comment this line out to disable screensaver
@xset s off
@xset -dpms
@xset s noblank
@chromium-browser --incognito --kiosk http://www.fb.com/

对于从Google到达这里的人:

这个问题的答案将有所不同,具体取决于您如何自动运行的设置铬(使用OpenBox,Xsession等)。答案也将根据您正在运行的raspbian版本(完整,精简版或超级精简版)而有所不同。

我建议使用以下文章正确设置Raspberry Pi执行此操作:https://blockdev.io/raspberry-pi-2-and-3-chromium-in-kiosk-mode/<<<<<<<</p>

Note :虽然本文非常擅长您浏览如何正确设置PI以在适当的售货亭模式下运行,但您将需要更改" SED"/"@"@SED命令(s)如果您不希望提示铬不能正确退出。要解决此问题,请将您的" SED"(或" @Sed")命令更改为以下:

  • sed -i's/" exited_cleanly":false/" exited_cleanly":true/'〜/.config/.config/chromium/default/prexences
  • sed -i’s/" exit_type":"崩溃"/" exit_type":" normal"/’〜/.config/chromium/default/prefiness

如果您应该使用" @sed",请在上面的每个命令之前提供一个"@"。

  1. 创建一个用户,在此示例中,为autologin at Boot

    创建一个用户

    adduser op
    USERMOD –A –G OP OP
    USERMOD –A - G用户OP
    USERMOD –A –G音频op
    USERMOD –A –G视频op

  2. 通过创建file/etc/systemd/system/getty@tty1.service.d/autologin.conf配置自动神经,并使用以下内容

    [服务]
    execstart =
    execstart = -/sbin/agetty -autologin op -noclear%i 38400 linux

  3. 使用以下命令启用autologin

    systemctl启用getty@tty1.service

  4. 使用以下命令模仿OP用户

    sudo su -op

  5. 在/home/op/.bashrc的末尾插入以下行

    如果[$(tty)=="/dev/tty1"];然后
    虽然是真的;做startx--名人;回声"再次[$?] ...";完成
    fi

  6. 使用以下内容创建文件/home/op/.xinitrc

    Chromium-Browser -window-size = 7000,7000 - start-fullscreen -Kiosk -app = http://www.fb.com/

  7. 重新启动

在raspbian中隐藏光标的其他方法是使用 unclutter

sudo apt-get update
sudo apt-get install unclutter

然后在脚本中插入以下行:

unclutter &

最新更新