解决 Chrome 提示“您的连接不是私密连接”

解决:在当前页面输入thisisunsafe就可(不是在 URL 输入,直接在页面输入)
原因:可能证书是自签名证书(SSL),为了安全起见,直接禁止访问了,thisisunsafe说明你已经了解并确认这是个不安全的网站,你仍要访问就给你访问了。
image.png

解决Chrome 更新到最新版本无法更新cookies

在新页面输入 chrome://flags/,查找 Partitioned cookies设置为 Enabled然后重启 Relaunch问题解决
image.png

恢复 Chrome 翻译功能

方法一

win 与 macOS 同理

  1. # 查询域名所对应的IP地址
  2. $ nslookup google.cn
  3. # 进入 hosts 文件目录
  4. $ cd /c/Windows/System32/drivers/etc/
  5. # 打开 hosts
  6. $ notepad hosts
  7. # 添加
  8. 120.232.181.162 translate.googleapis.com

image.png

方法二

https://gist.github.com/bookfere

win

  1. :: Copyright (c)2022 https://bookfere.com
  2. :: This is a batch script for fixing Google Translate and making it available
  3. :: in the Chinese mainland. If you experience any problem, visit the page below:
  4. :: https://bookfere.com/post/1020.html
  5. @echo off
  6. setlocal enabledelayedexpansion
  7. chcp 437 >NULL
  8. set "source_domain=google.cn"
  9. set "target_domain=translate.googleapis.com"
  10. set "hosts_file=C:\Windows\System32\drivers\etc\hosts"
  11. for /f "skip=4 tokens=2" %%a in ('"nslookup %source_domain% 2>NUL"') do set ip=%%a
  12. set "old_rule=null"
  13. set "new_rule=%ip% %target_domain%"
  14. set "comment=# Fix Google Translate CN"
  15. for /f "tokens=*" %%i in ('type %hosts_file%') do (
  16. set "line=%%i"
  17. :: Retrieve the rule If the target domain exists.
  18. if not "!line:%target_domain%=!"=="%%i" set "old_rule=%%i"
  19. )
  20. if not "%old_rule%"=="null" (
  21. echo A rule has been added to the hosts file.
  22. echo [1] Update [2] Delete
  23. set /p action="Enter a number to choose an action: "
  24. if "!action!"=="1" (
  25. if not "%old_rule%"=="%new_rule%" (
  26. echo Deleting the rule "%old_rule%"
  27. echo Adding the rule "%new_rule%"
  28. set "new_line=false"
  29. for /f "tokens=*" %%i in ('type %hosts_file% ^| find /v /n "" ^& break ^> %hosts_file%') do (
  30. set "rule=%%i"
  31. set "rule=!rule:*]=!"
  32. if "%old_rule%"=="!rule!" set "rule=%new_rule%"
  33. if "!new_line!"=="true" >>%hosts_file% echo.
  34. >>%hosts_file% <NUL set /p="!rule!"
  35. set "new_line=true"
  36. )
  37. ) else (
  38. echo The rule already exists, nothing to do.
  39. )
  40. )
  41. if "!action!"=="2" (
  42. echo Deleting the rule "%old_rule%"
  43. set "new_line=false"
  44. for /f "tokens=*" %%i in ('
  45. type "%hosts_file%" ^| findstr /v /c:"%comment%" ^| findstr /v "%target_domain%" ^| find /v /n "" ^& break ^> "%hosts_file%"
  46. ') do (
  47. set "line=%%i"
  48. set "line=!line:*]=!"
  49. if "!new_line!"=="true" >>%hosts_file% echo.
  50. >>%hosts_file% <NUL set /p="!line!"
  51. set "new_line=true"
  52. )
  53. )
  54. ) else (
  55. echo Adding the rule "%new_rule%"
  56. echo.>>%hosts_file%
  57. echo %comment%>>%hosts_file%
  58. <NUL set /p="%new_rule%">>%hosts_file%
  59. )
  60. echo Done.
  61. pause

macOS

  1. #!/bin/bash
  2. # Copyright (c)2022 https://bookfere.com
  3. # This is a batch script for fixing Google Translate and making it available
  4. # in the Chinese mainland. If you experience any problem, visit the page below:
  5. # https://bookfere.com/post/1020.html
  6. SOURCE_DOMAIN=google.cn
  7. TARGET_DOMAIN=translate.googleapis.com
  8. HOSTS_FILE=/etc/hosts
  9. HOST_CMD=/usr/bin/host
  10. CUT_CMD=/usr/bin/cut
  11. SED_CMD=/usr/bin/sed
  12. IP=$($HOST_CMD -t A $SOURCE_DOMAIN | $CUT_CMD -d ' ' -f 4)
  13. OLD_RULE=$(cat $HOSTS_FILE | grep $TARGET_DOMAIN)
  14. NEW_RULE="$IP $TARGET_DOMAIN"
  15. COMMENT="# Fix Google Translate CN"
  16. if [ -n "$OLD_RULE" ]; then
  17. echo "A rule has been added to the hosts file. "
  18. echo "[1] Update [2] Delete"
  19. echo -n "Enter a number to choose an action: "
  20. read action
  21. if [ "$action" == "1" ]; then
  22. if [ "$OLD_RULE" != "$NEW_RULE" ]; then
  23. echo "Deleting the rule \"$OLD_RULE\""
  24. echo "Adding the rule \"$NEW_RULE\""
  25. $SED_CMD -i '' "s/.*${TARGET_DOMAIN}/${NEW_RULE}/" $HOSTS_FILE
  26. else
  27. echo 'The rule already exists, nothing to do.'
  28. fi
  29. fi
  30. if [ "$action" == "2" ]; then
  31. echo "Deleting the rule \"$OLD_RULE\""
  32. PATTERN="s/\n\{0,\}${COMMENT}\n.* ${TARGET_DOMAIN}//"
  33. $SED_CMD -i '' -e ':a' -e 'N' -e '$!ba' -e "$PATTERN" $HOSTS_FILE
  34. fi
  35. else
  36. echo "Adding the rule \"$NEW_RULE\""
  37. echo -ne "\n${COMMENT}\n${NEW_RULE}" >> $HOSTS_FILE
  38. fi
  39. echo 'Done.'

方法三

科学上网(全局代理)

小技巧

节点保存图片

  1. F12 打开开发者工具台
  2. ctrl + shift + p(command+Shift+p),弹出搜索框之后输入: cap
  3. Capture full size screenshot(全部保存)
  4. Capture full size screenshot(选中当前节点保存)
  5. 回车即可,成功保存图片,

image.png