获取正在访问的页面的Cookie [英] Obtain cookies of the page being visited

查看:217
本文介绍了获取正在访问的页面的Cookie的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道如何使用内容脚本和背景页面之间的通信链接获取当前页面的Cookie。这是一个扩展。

解决方案

您可以使用内容脚本访问您访问的每个网站的 document.cookie 。然后,您可以使用消息传递将Cookie从您的内容脚本传递到您的后台页面



<例如:Stack Overflow有很多例子:


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:

这篇关于获取正在访问的页面的Cookie的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆