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

获取cookie没有对message事件进行过滤,会被其他插件的postmassage影响导致cookie输入框被覆盖 #571

Closed
MapleRecall opened this issue Jan 13, 2025 · 2 comments
Labels
enhancement New feature or request

Comments

@MapleRecall
Copy link

如果安装了其他会postmessage的扩展,比如react devtool,qd的cookie输入框会被无限覆盖。简单debug了一下是因为没有对message的来源做限制造成的,需要添加一个标识符限制一下

@ckx000
Copy link
Contributor

ckx000 commented Jan 13, 2025

稍微了看了下 好像是那个扩展在以500ms的setInterval间隔来postMessage这个消息source: "react-devtools-content-script", hello: true 你的cookies输入框一直被这个消息覆盖吧。。即使你禁用[get-cookies]扩展也是一样。。因为处理postMessage消息的实现是在qd框架上。

挺麻烦的 如果要改 扩展和qd框架也要同步改变处理。回头我看看有没有更好的处理办法。

@ckx000 ckx000 added the enhancement New feature or request label Jan 13, 2025
@ckx000 ckx000 transferred this issue from qd-today/get-cookies Jan 14, 2025
@ckx000 ckx000 added this to QD Jan 14, 2025
@ckx000 ckx000 moved this to Done in QD Jan 14, 2025
ckx000 added a commit that referenced this issue Jan 14, 2025
修改与扩展插件的通信方法,防止因其他扩展滥用postMessage造成的插件失效
#571
@ckx000
Copy link
Contributor

ckx000 commented Jan 14, 2025

已完成,可以先更新插件。插件兼容之前的框架,但是防止cookie输入框被其他扩展的消息干扰得等qd框架更新

a76yyyy pushed a commit that referenced this issue Jan 28, 2025
* 修改getcookies扩展的通信方法

修改与扩展插件的通信方法,防止因其他扩展滥用postMessage造成的插件失效
#571

* fix format

* fixFormat

* Change(editor): 📝优化cookie处理逻辑,修复代码格式问题
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Done
Development

No branches or pull requests

2 participants