更新时间:2023-12-03 08:36:40
您可以使用内容脚本访问您访问的每个网站的 document.cookie
。然后,您可以使用消息传递将Cookie从您的内容脚本传递到您的后台页面。
I want to know how can we obtain the cookies of the current page being accessed using a communication link between the content script and background page. This is for an extension.
You can use Content Scripts to access document.cookie
for each website you visit. Then you can use Message Passing to pass the cookies from your Content Script to your Background Page.
There are many examples on Stack Overflow for example: