How to disable Google Chrome extension autoupdate

前端 未结 6 1728
执笔经年
执笔经年 2020-12-22 21:40

How do I disable Google Chrome extension autoupdate?

6条回答
  •  情书的邮戳
    2020-12-22 21:42

    this is a complementary answer to the accepted one https://stackoverflow.com/a/27657703/1422630 , allowing disable all at once on chromium

    this is also only for linux (may be run on windows thru cygwin tho, not tested..)

    this script will

    • backup the prefs file,
    • modify it,
    • if didnt succeed will output "FAILED"
    • show the differences using meld if installed
    #!/bin/bash
    
    set -ue
    
    strPref="$HOME/.config/chromium/Default/Preferences"
    cat "$strPref" |egrep "\"update_url[^,]*," -o |sort -u
    read -p "existing unique urls above..." -n 1
    
    strBkp="${strPref}.`date +"%Y%m%d%H%M%S"`.bkp"
    if cp -v "$strPref" "$strBkp";then
      strUpdUrl="clients2.google.com/service/update2/crx" #change this if needed  #TODO should match any URL...
      sed -i -r "s@(update_url\":\"https{,1}://)(${strUpdUrl})@\1127.0.0.1@g" "$strPref"
      if grep "$strUpdUrl" "$strPref";then echo FAILED >&2;exit 1;fi
    
      cmdDiff=colordiff
      if which meld;then cmdDiff=meld;fi
      #$cmdDiff <(cat "$strPref" |egrep "\"update_url[^,]*," -o) <(cat "$strBkp" |egrep "\"update_url[^,]*," -o)
      $cmdDiff <(cat "$strPref" |sed -r 's@","@",\n"@g') <(cat "$strBkp" |sed -r 's@","@",\n"@g')
    fi
    

    tested on chromium: Version 63.0.3239.84 (Official Build) Built on Ubuntu , running on Ubuntu 16.04 (64-bit)

    obs.: that script also works for google-chrome, just change the preferences file path

提交回复
热议问题