google-chrome - 打开 Chrome ://URL's from the command line?

标签 google-chrome

您可以从命令行在 chrome 中打开一个 URL:

google-chrome https://example.com

有没有办法打开chrome:// URL(例如 chrome://bookmarks/ )以这种方式?当我尝试打开 chrome://来自 shell 的 URL,chrome 只是打开一个空的浏览器选项卡。

如果 Chrome 只是出于用户保护的考虑而拒绝这样做,也就不足为奇了。如果恰好是这种情况:这是在哪里记录的?

最佳答案

X Window 系统的解决方案,使用 xdotool :
把它放在一个shell脚本中:

# Usage example: $0 chrome://settings/ #even works for https:// links
chromium& #opens new tab. (Maybe your browser is called chrome.)
sleep 2
xdotool type $@$'\n'

关于google-chrome - 打开 Chrome ://URL's from the command line?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53694504/

相关文章:

google-chrome - 通过popup修改本地存储,并在contentscript中使用存储值

google-chrome - 在 chrome 开发工具中过滤掉预检/选项请求

javascript - 谷歌浏览器扩展制作中的内容安全策略错误

Javascript 确认在 chrome 中立即关闭

javascript - 除非我手动检查,否则无法在 Chrome 开发工具中获取元素

javascript - 在 popup.html Chrome 扩展程序中保存用户首选项

css - 焦点边框未出现在 html 按钮上或在 Google Chrome 中选择(仅限 OSX 10.10.3)

javascript覆盖新标签页chrome

html - Internet Explorer 中图像的大小问题

javascript - 无法强制 Chrome 使用 Javascript 滚动到页面顶部