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

打开StackOverFlow总是会弹出“Accept all cookies”的策略,而且点击上面的按钮无效 #162

Open
heyzoeys opened this issue Feb 26, 2023 · 4 comments

Comments

@heyzoeys
Copy link

请教大家该如何解决这个问题, 谢谢!!

image

@justjavac
Copy link
Owner

安装插件 Accept All Cookies

@jingjingxyk
Copy link
Contributor

jingjingxyk commented Feb 27, 2023

@justjavac 通过下载扩展,并查看源码,发现上述扩展是注入JS, 修改CSS 优先级,把框隐藏了。并没有解决问题

问题所在:
image

控制台执行下列命令即可,重现问题:

document.cookie.split(";")

办法:往下看

@jingjingxyk
Copy link
Contributor

jingjingxyk commented Feb 27, 2023

解决办法:暂列三种解决办法 (推荐办法一)

办法一: 清除本域名(stackoverflow.com) 下的cookie 信息即可

关键点: including third-party cookies 这里要打勾

image

办法二: 执行一条规则即可

关键点 规则执行以后,记得把本条规则删了

[
  {
    "action": {
      "requestHeaders": [
        {
          "header": "cookie",
          "operation": "remove"
        }
      ],
      "type": "modifyHeaders"
    },
    "condition": {
      "requestDomains": ["stackoverflow.com"],
      "resourceTypes": [
        "main_frame",
        "sub_frame",
        "stylesheet",
        "script",
        "image",
        "font",
        "object",
        "xmlhttprequest",
        "ping",
        "csp_report",
        "media",
        "websocket",
        "webtransport",
        "webbundle",
        "other"
      ],
      "urlFilter": "*"
    },
    "id": 1,
    "priority": 100
  }

]

办法三: 浏览器的安全选项:设置为停用 ( chromium 启动参数里 添加 -–disable-web-security)

参考这里: https://www.cnblogs.com/jingjingxyk/p/16577987.html

@jingjingxyk
Copy link
Contributor

jingjingxyk commented Feb 27, 2023

@heyzoeys
最快捷的解决办法: 就是清空本域名下的 cookie 信息 ,刷新以后会重新生成跟踪信息

image

刷新以后,查看响应头,已经重新生成跟踪信息了(set-cookie)
image

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

3 participants