我想将计算机配置为启动Google Chrome Windows启动。它应该以全屏模式启动并打开一些网页。
我尝试使用以下命令行运行Chrome:
chrome.exe --start-fullscreen --app=https://google.com
但是,Chrome会以窗口模式而非全屏模式打开。
有什么方法可以在全屏模式下运行chrome吗?
更新19年10月3日
显示10秒倒计时的新脚本,然后在全屏信息亭模式下启动chrome / chromiumn。
chrome的更多更新需要脚本更新,以允许自动播放带音频的视频。注意--overscroll-history-navigation = 0当前不起作用,需要通过在浏览器中转到chrome:// flags /#overscroll-history-navigation并将其设置为Disabled来禁用此标志。
@echo off
echo Countdown to application launch...
timeout /t 10
"C:\Program Files (x86)\chrome-win32\chrome.exe" --chrome --kiosk http://localhost/xxxx --incognito --disable-pinch --no-user-gesture-required --overscroll-history-navigation=0
exit
如果运行旧版chrome(低于60,则可能需要设置chrome:// flags /#autoplay-policy)
更新16年5月11日
自从我发布chrome以来,对chrome进行了许多更新,并且不得不大量更改脚本以使其按需运行。
较新版本的chrome有几个问题:
由于还原错误切换到隐身模式,因为它始终启动一个清晰的版本,并且不保存用户正在查看的内容,因此如果崩溃,则无法还原任何内容。另外,在较新版本的chrome中自动启动是一种尝试和禁用的痛苦,我转而使用chrome,因为它无法自动更新,并且仍然具有chrome的所有现代功能。请注意,请确保下载所有音频和视频编解码器随附的最高版本的铬,因为铬的基本版本不支持所有编解码器。
@echo off echo Step 1 of 2: Waiting a few seconds before starting the Kiosk... "C:\windows\system32\ping" -n 5 -w 1000 127.0.0.1 >NUL echo Step 2 of 5: Waiting a few more seconds before starting the browser... "C:\windows\system32\ping" -n 5 -w 1000 127.0.0.1 >NUL echo Final 'invisible' step: Starting the browser, Finally... "C:\Program Files (x86)\Google\Chromium\chrome.exe" --chrome --kiosk http://127.0.0.1/xxxx --incognito --disable-pinch --overscroll-history-navigation=0 exit
过时的
我用它来展览锁定屏幕。我认为这是您的寻找。
下一部分是我用来在信息亭模式下开始关闭并再次重新启动chrome的脚本。这些位置是我安装chrome的位置,因此根据您的安装,它可能对您有所不同。
打开您选择的文本编辑器或仅打开记事本,并在下面的代码中输入以下内容,确保其格式/顺序与下面相同。将其保存到您想要的桌面上,对于本示例chrome_startup_script.txt,接下来右键单击它并重命名,从末尾删除txt,然后放入bat中。双击以启动脚本以查看其是否正常运行。
应出现一个命令行框并贯穿脚本运行,chrome将启动,然后关闭,这样做的原因是删除所有错误报告,例如,如果电脑崩溃,则chrome如果再次启动则没有此错误,它将显示黄色错误栏最上方说的是chrome无法正常关闭,您想恢复它吗。几秒钟后,Chrome应该会再次以信息亭模式启动,并指向您设置的首页。
@echo off
echo Step 1 of 5: Waiting a few seconds before starting the Kiosk...
"C:\windows\system32\ping" -n 31 -w 1000 127.0.0.1 >NUL
echo Step 2 of 5: Starting browser as a pre-start to delete error messages...
"C:\google_homepage.url"
echo Step 3 of 5: Waiting a few seconds before killing the browser task...
"C:\windows\system32\ping" -n 11 -w 1000 127.0.0.1 >NUL
echo Step 4 of 5: Killing the browser task gracefully to avoid session restore...
Taskkill /IM chrome.exe
echo Step 5 of 5: Waiting a few seconds before restarting the browser...
"C:\windows\system32\ping" -n 11 -w 1000 127.0.0.1 >NUL
echo Final 'invisible' step: Starting the browser, Finally...
"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --kiosk --overscroll-history-navigation=0"
exit
注意: ping -n之后的数字是启动链接(或下一行中的应用程序)之前要等待的秒数(减去一秒)。
最后,如果一切正常,则可以将.bat文件拖放到Windows的启动文件夹中,并且该脚本将在每次Windows启动时启动。
更新:
在最新版的chrome中,他们真正地启用了触摸手势,这意味着在触摸屏上向左或向右滑动会导致浏览器在历史记录中前进或后退。为避免这种情况,我们需要禁用“后退”和“前进”按钮上的历史记录导航,--overscroll-history-navigation=0
以在脚本末尾添加以下内容。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句