Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

功能使用六:使用请求头重写功能,解决CSDN上老博客,引用它站图片,图片不显示问题 #142

Open
jingjingxyk opened this issue Jan 6, 2023 · 0 comments

Comments

@jingjingxyk
Copy link
Contributor

jingjingxyk commented Jan 6, 2023

案例一: 打开页面 六大算法之三:动态规划,发现图片不显示 ,为了解决这个问题,写了一下规则:

{
  "action": {
    "requestHeaders": [
      {
        "header": "referer",
        "operation": "set",
        "value": "https://www.cnblogs.com/"
      }
    ],
    "type": "modifyHeaders"
  },
  "condition": {
    "initiatorDomains": [
      "blog.csdn.net"
    ],
    "requestDomains": [
      "cnblogs.com"
    ],
    "resourceTypes": [
      "main_frame",
      "sub_frame",
      "stylesheet",
      "script",
      "image",
      "font",
      "object",
      "xmlhttprequest",
      "ping",
      "csp_report",
      "media",
      "websocket",
      "webtransport",
      "webbundle",
      "other"
    ],
    "urlFilter": "cnblogs.com"
  },
  "id": 20010,
  "priority": 100
}

案例二: 打开页面 时间管理——永远做重要不紧急的事情,发现图片不显示 ,为了解决这个问题,写了以下规则:

[
  {
    "action": {
      "redirect": {
        "transform": {
          "host": "img1.doubanio.com",
          "scheme": "https"
        }
      },
      "type": "redirect"
    },
    "condition": {
      "initiatorDomains": [
        "blog.csdn.net"
      ],
      "requestDomains": [
        "douban.com"
      ],
      "resourceTypes": [
        "main_frame",
        "sub_frame",
        "stylesheet",
        "script",
        "image",
        "font",
        "object",
        "xmlhttprequest",
        "ping",
        "csp_report",
        "media",
        "websocket",
        "webtransport",
        "webbundle",
        "other"
      ],
      "urlFilter": "img*.douban.com"
    },
    "id": 20008,
    "priority": 100
  },
  {
    "action": {
      "requestHeaders": [
        {
          "header": "referer",
          "operation": "set",
          "value": "https://www.douban.com/"
        }
      ],
      "type": "modifyHeaders"
    },
    "condition": {
      "initiatorDomains": [
        "blog.csdn.net"
      ],
      "requestDomains": [
        "img1.doubanio.com"
      ],
      "resourceTypes": [
        "main_frame",
        "sub_frame",
        "stylesheet",
        "script",
        "image",
        "font",
        "object",
        "xmlhttprequest",
        "ping",
        "csp_report",
        "media",
        "websocket",
        "webtransport",
        "webbundle",
        "other"
      ],
      "urlFilter": "img1.doubanio.com"
    },
    "id": 20009,
    "priority": 100
  }
]

其他例子: 解决老博客引用新浪图片或者微信公众号的图片不显示,规则例子

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant