Skip to content

Conversation

@CodFrm
Copy link
Member

@CodFrm CodFrm commented Dec 16, 2025

概述 Descriptions

close #1083

变更内容 Changes

截图 Screenshots

@cyfung1031
Copy link
Collaborator

try{ ... } finally { ... } 改成 try{ ... } catch {...} finally { ... } 就能解决了吗?

@CodFrm
Copy link
Member Author

CodFrm commented Dec 16, 2025

try{ ... } finally { ... } 改成 try{ ... } catch {...} finally { ... } 就能解决了吗?

是的,抛出的错误没 catch 住,访问 chrome.userScripts 就会抛出错误,所以那些 ? 都是无效的

@cyfung1031
Copy link
Collaborator

cyfung1031 commented Dec 16, 2025

try{ ... } finally { ... } 改成 try{ ... } catch {...} finally { ... } 就能解决了吗?

是的,抛出的错误没 catch 住,访问 chrome.userScripts 就会抛出错误,所以那些 ? 都是无效的

不是

Chrome / Edge 有permission 但没 developer mode 打勾的话,会报错
只是我以为 try{ ... } finally { ... } 能接住

加一个空的 catch { } 就行
要不要加 debug log 你喜欢吧

这个是故意忽略错误的。1.3 也不用改


Vivaldi 好像是直接沒有 userScripts

@CodFrm CodFrm merged commit 959c4db into main Dec 17, 2025
3 checks passed
cyfung1031 added a commit to cyfung1031/scriptcat that referenced this pull request Dec 19, 2025
* 处理 只显示提示,不显示感叹号 的问题

* 优化弹出窗口的userscripts提示

* 该错误为预期内情况,无需记录 debug 日志

* 通过测试

* 删除日志

* 通过测试

* default isUserScriptsAvailableState to null

* 要求用户重启扩展/浏览器,会重置badge状态的

---------

Co-authored-by: cyfung1031 <44498510+cyfung1031@users.noreply.github.com>
@CodFrm CodFrm deleted the fix/1083 branch December 19, 2025 02:12
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

Successfully merging this pull request may close these issues.

[BUG] 开启用户脚本通知显示异常

3 participants