Skip to content

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

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

image.png

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

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

image.png

恢复 Chrome 翻译功能

最新谷歌翻译Ip: 142.250.4.90

方法一

host: win 与 macOS 同理

terminal
bash
# 查询域名所对应的IP地址
$ nslookup google.cn

# 进入 hosts 文件目录
$ cd /c/Windows/System32/drivers/etc/
# C:\Windows\System32\drivers\etc

# 打开 hosts
$ notepad hosts

# 添加
120.232.181.162 translate.googleapis.com

image.png

方法二

https://gist.github.com/bookfere

win

terminal
bash
:: Copyright (c)2022 https://bookfere.com
:: This is a batch script for fixing Google Translate and making it available
:: in the Chinese mainland. If you experience any problem, visit the page below:
:: https://bookfere.com/post/1020.html

@echo off
setlocal enabledelayedexpansion
chcp 437 >NULL

set "source_domain=google.cn"
set "target_domain=translate.googleapis.com"

set "hosts_file=C:\Windows\System32\drivers\etc\hosts"
for /f "skip=4 tokens=2" %%a in ('"nslookup %source_domain% 2>NUL"') do set ip=%%a
set "old_rule=null"
set "new_rule=%ip% %target_domain%"
set "comment=# Fix Google Translate CN"

for /f "tokens=*" %%i in ('type %hosts_file%') do (
    set "line=%%i"
    :: Retrieve the rule If the target domain exists.
    if not "!line:%target_domain%=!"=="%%i" set "old_rule=%%i"
)

if not "%old_rule%"=="null" (
    echo A rule has been added to the hosts file.
    echo [1] Update [2] Delete
    set /p action="Enter a number to choose an action: "
    if "!action!"=="1" (
        if not "%old_rule%"=="%new_rule%" (
            echo Deleting the rule "%old_rule%"
            echo Adding the rule "%new_rule%"
            set "new_line=false"
            for /f "tokens=*" %%i in ('type %hosts_file% ^| find /v /n "" ^& break ^> %hosts_file%') do (
                set "rule=%%i"
                set "rule=!rule:*]=!"
                if "%old_rule%"=="!rule!" set "rule=%new_rule%"
                if "!new_line!"=="true" >>%hosts_file% echo.
                >>%hosts_file% <NUL set /p="!rule!"
                set "new_line=true"
            )
        ) else (
            echo The rule already exists, nothing to do.
        )
    )
    if "!action!"=="2" (
        echo Deleting the rule "%old_rule%"
        set "new_line=false"
        for /f "tokens=*" %%i in ('
            type "%hosts_file%" ^| findstr /v /c:"%comment%" ^| findstr /v "%target_domain%" ^| find /v /n "" ^& break ^> "%hosts_file%"
        ') do (
            set "line=%%i"
            set "line=!line:*]=!"
            if "!new_line!"=="true" >>%hosts_file% echo.
            >>%hosts_file% <NUL set /p="!line!"
            set "new_line=true"
        )
    )
) else (
    echo Adding the rule "%new_rule%"
    echo.>>%hosts_file%
    echo %comment%>>%hosts_file%
    <NUL set /p="%new_rule%">>%hosts_file%
)

echo Done.
pause

macOS

terminal
bash
#!/bin/bash

# Copyright (c)2022 https://bookfere.com
# This is a batch script for fixing Google Translate and making it available
# in the Chinese mainland. If you experience any problem, visit the page below:
# https://bookfere.com/post/1020.html

SOURCE_DOMAIN=google.cn
TARGET_DOMAIN=translate.googleapis.com
HOSTS_FILE=/etc/hosts

HOST_CMD=/usr/bin/host
CUT_CMD=/usr/bin/cut
SED_CMD=/usr/bin/sed

IP=$($HOST_CMD -t A $SOURCE_DOMAIN | $CUT_CMD -d ' ' -f 4)
OLD_RULE=$(cat $HOSTS_FILE | grep $TARGET_DOMAIN)
NEW_RULE="$IP $TARGET_DOMAIN"
COMMENT="# Fix Google Translate CN"

if [ -n "$OLD_RULE" ]; then
    echo "A rule has been added to the hosts file. "
    echo "[1] Update [2] Delete"
    echo -n "Enter a number to choose an action: "
    read action
    if [ "$action" == "1" ]; then
        if [ "$OLD_RULE" != "$NEW_RULE" ]; then
            echo "Deleting the rule \"$OLD_RULE\""
            echo "Adding the rule \"$NEW_RULE\""
            $SED_CMD -i '' "s/.*${TARGET_DOMAIN}/${NEW_RULE}/" $HOSTS_FILE
        else
            echo 'The rule already exists, nothing to do.'
        fi
    fi
    if [ "$action" == "2" ]; then
        echo "Deleting the rule \"$OLD_RULE\""
        PATTERN="s/\n\{0,\}${COMMENT}\n.* ${TARGET_DOMAIN}//"
        $SED_CMD -i '' -e ':a' -e 'N' -e '$!ba' -e "$PATTERN" $HOSTS_FILE
    fi
else
    echo "Adding the rule \"$NEW_RULE\""
    echo -ne "\n${COMMENT}\n${NEW_RULE}" >> $HOSTS_FILE
fi

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

DevTools

过滤网络请求

  • 通过文本查找网络请求

analytics在过滤器文本框中键入。仅显示包含文本的文件analytics。

  • 通过正则表达式查找网络请求

键入/.*\min.[c]s+$/。DevTools 会过滤掉文件名以 结尾且min.c后跟 1 个或多个s字符的所有资源。

  • 过滤(排除)网络请求

键入-min.js。DevTools 过滤掉所有包含min.js. 如果任何其他文件与模式匹配,它们也将被过滤掉并且不会在网络面板中可见。

  • 使用属性过滤器查看某个域的网络请求

domain:code.jquery.com在过滤区输入。它只会显示属于 URL 的网络请求code.jquery.com。

  • 多选类型

command(Ctrl)

image.png

Layout Switch

Adjust the layout style of VitePress to adapt to different reading needs and screens.

Expand all
The sidebar and content area occupy the entire width of the screen.
Expand sidebar with adjustable values
Expand sidebar width and add a new slider for user to choose and customize their desired width of the maximum width of sidebar can go, but the content area width will remain the same.
Expand all with adjustable values
Expand sidebar width and add a new slider for user to choose and customize their desired width of the maximum width of sidebar can go, but the content area width will remain the same.
Original width
The original layout width of VitePress

Page Layout Max Width

Adjust the exact value of the page width of VitePress layout to adapt to different reading needs and screens.

Adjust the maximum width of the page layout
A ranged slider for user to choose and customize their desired width of the maximum width of the page layout can go.

Content Layout Max Width

Adjust the exact value of the document content width of VitePress layout to adapt to different reading needs and screens.

Adjust the maximum width of the content layout
A ranged slider for user to choose and customize their desired width of the maximum width of the content layout can go.

Spotlight

Highlight the line where the mouse is currently hovering in the content to optimize for users who may have reading and focusing difficulties.

ONOn
Turn on Spotlight.
OFFOff
Turn off Spotlight.