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

GM_addValueChangeListener函数问题 #52

Closed
Ming-Yue0 opened this issue Mar 29, 2022 · 2 comments
Closed

GM_addValueChangeListener函数问题 #52

Ming-Yue0 opened this issue Mar 29, 2022 · 2 comments
Labels
bug Something isn't working
Milestone

Comments

@Ming-Yue0
Copy link

最近在写一个跨网页的脚本,发现了GM_addValueChangeListener的这个问题。
同样的写法在 Tampermoney 里运行正常,而脚本猫里无效。由于脚本的代码过于复杂,下面的代码是同样的思路,能复现该问题。

// ==UserScript==
// @name         New Userscript
// @match        *://www.baidu.com/
// @match        *://fanyi.baidu.com/*
// @grant        GM_setValue
// @grant        GM_addValueChangeListener
// ==/UserScript==

if (document.domain == "fanyi.baidu.com")
    $('#baidu_translate_input').keyup(function () { GM_setValue("text", document.getElementById("baidu_translate_input").value) })
else
    GM_addValueChangeListener("text", function (name, old_value, new_value, remote) {
        console.log(name, old_value, new_value, remote)
        document.querySelector("#kw").value = new_value
    })

另外,脚本猫的编辑页面有些小问题:

  1. 脚本的META编辑后无法保存
  2. 打开多个编辑页使用快捷键Ctrl+S只保存最右侧标签
@CodFrm
Copy link
Member

CodFrm commented Mar 29, 2022

GM_addValueChangeListener之前反馈好像是有点问题,这几天开始闲下来了,继续更新脚本猫

  1. META页还没完善,只是能看
  2. 这个问题我看看,没注意过

@CodFrm CodFrm added the bug Something isn't working label Oct 10, 2022
@CodFrm CodFrm added this to the v0.10.0 milestone Oct 10, 2022
@CodFrm
Copy link
Member

CodFrm commented Nov 2, 2022

新版本已优化

image

@CodFrm CodFrm closed this as completed Nov 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants