加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

bash – 从具有特定窗口坐标的命令行启动Google Chrome

发布时间:2020-12-15 18:45:59 所属栏目:安全 来源:网络整理
导读:我正在尝试找到一个 shell命令,它将打开具有特定x和y坐标的Google Chrome(这样我可以在打开窗口时设置窗口的位置.)可以使用命令行参数来执行此操作吗? 我需要修改以下命令才能实现: google-chrome http://www.google.com/ http://peter.sh/experiments/chr
我正在尝试找到一个 shell命令,它将打开具有特定x和y坐标的Google Chrome(这样我可以在打开窗口时设置窗口的位置.)可以使用命令行参数来执行此操作吗?

我需要修改以下命令才能实现:

google-chrome http://www.google.com/

http://peter.sh/experiments/chromium-command-line-switches/说–window-position = x,y是你要找的东西.

在几年前的更新中,包括几年前我写的一个小shell脚本(但在回答了这个问题之后),它提供了如何使用自定义窗口大小/位置启动chrome的示例,并且能够通过名称创建“假的”用户数据目录.

它可能或可能不会工作,并设置了一些危险的选项,但你得到的想法..不要使用这个逐字,一些标志可能已被重命名或完全删除..(像socks代理命令)

#!/bin/bash -x

FAKEUSER="${1:-fake-chrome-user}"
CHROMEROOT=$HOME/.chromeroot/

mkdir -p ${CHROMEROOT}

export PROFILE="${CHROMEROOT}/${FAKEUSER}-chromium-profile"
export DISK_CACHEDIR="${CHROMEROOT}/${FAKEUSER}-chromium-profile-cache"
export DISK_CACHESIZE=4096
export MEDIA_CACHESIZE=4096

PARANOID_OPTIONS="
        --no-displaying-insecure-content 
        --no-referrers 
        --disable-zero-suggest 
        --disable-sync  
        --cipher-suite-blacklist=0x0004,0x0005,0xc011,0xc007 
        --enable-sandbox-logging >/dev/null 2>&1
        "


/Applications/Google Chrome.app/Contents/MacOS/Google Chrome 
        --remember-cert-error-decisions 
        --ignore-certificate-errors 
        --ignore-urlfetcher-cert-requests 
        --allow-running-insecure-content 
        --window-position=2400,400 
        --window-size=1500,1000 
        --no-pings 
        --user-data-dir=${PROFILE} 
        --disk-cache-dir=${DISK_CACHEDIR} 
        --disk-cache-size=${DISK_CACHESIZE} 
        --media-cache-size=${MEDIA_CACHESIZE} 
        2>&1


#--proxy-server="socks4://localhost:30604" 
#--host-resolver-rules="MAP * 0.0.0.0,EXCLUDE localhost" 

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读