You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Exception:error log is working ("Error: error log is working\n at chrome-extension://jklfcpboamajpiikgkbjcnnnnooefbhh/generated/troubleshooting.js:1:9323")
Exception in Promise:async error log is working ("Error: async error log is working\n at chrome-extension://jklfcpboamajpiikgkbjcnnnnooefbhh/generated/troubleshooting.js:1:9280\n at chrome-extension://jklfcpboamajpiikgkbjcnnnnooefbhh/generated/troubleshooting.js:1:9320")
是否可以稳定复现
是
复现步骤
使用如下用户脚本,没有任何额外内容:
然后在任意一个B站视频页打开浏览器控制台,并刷新。
预期行为
debugger 能正常暂停运行
实际行为
debugger 会跳转到 sources 页面进入调试,但不到1秒后该页面会消失。此时
console.log
打印的对象也无法点击展开,阅读代码后推测可能是此时执行用户脚本的 web worker 已被销毁。禁用 pakku 后 bug 是否存在
不存在
是否与其他插件有关
无关
B 站播放器版本号
4.9.20-0773c501
pakku 调试信息
如果 pakku 完全无法工作,请完整地复制蓝框里的所有文字,并在反馈 bug 时附上。
[Debug Info]
Version: 2024.12.2
Channel: chrome
User Agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36
Incognito:
false
Has Session Storage:
true
localStorage:
{}
Views:
chrome-extension://jklfcpboamajpiikgkbjcnnnnooefbhh/page/userscript_editor.html
chrome-extension://jklfcpboamajpiikgkbjcnnnnooefbhh/page/troubleshooting.html
Permissions:
{"origins":["*://*.bilibili.com/*","https://www.bilibili.com/robots.txt?pakku_sandbox"],"permissions":["contextMenus","notifications","storage","scripting","declarativeNetRequestWithHostAccess"]}
Content Scripts:
[{"allFrames":true,"css":["generated/injected.css"],"excludeMatches":["https://message.bilibili.com/*","https://www.bilibili.com/robots.txt?pakku_sandbox"],"id":"pakku-ajax","js":["generated/xhr_hook.js"],"matchOriginAsFallback":false,"matches":["*://*.bilibili.com/*"],"persistAcrossSessions":true,"runAt":"document_start","world":"MAIN"}]
State:
{"GLOBAL_SWITCH":true,"STATS_1484333765":{"combined_cosine_distance":0,"combined_edit_distance":0,"combined_identical":0,"combined_pinyin_distance":0,"deleted_blacklist":0,"deleted_blacklist_each":{},"deleted_dispval":0,"download_time_ms":17,"ignored_script":0,"ignored_type":0,"ignored_whitelist":0,"modified_enlarge":0,"modified_scroll":0,"modified_shrink":0,"num_max_combo":1,"num_max_dispval":0,"num_onscreen_danmu":297,"num_taolu_matched":0,"num_total_danmu":297,"num_userscript":1,"parse_time_ms":123,"type":"done","userscript_time_ms":0},"STATS_1484333913":{"badge":"↓","message":"正在下载弹幕(0/0/0)","type":"message"},"_INITIALIZED":true}
Tabs:
DNR Rules:
[]
Config:
{"_LAST_UPDATE_TIME":11738832702083,"_CONFIG_VER":4,"ADVANCED_USER":true,"THRESHOLD":-1,"MAX_DIST":3,"MAX_COSINE":85,"TRIM_PINYIN":true,"TRIM_ENDING":true,"TRIM_SPACE":true,"TRIM_WIDTH":true,"FORCELIST":[],"WHITELIST":[],"CROSS_MODE":false,"PROC_TYPE7":false,"PROC_TYPE4":true,"PROC_POOL1":false,"DANMU_MARK":"suffix","MARK_THRESHOLD":1,"DANMU_SUBSCRIPT":true,"ENLARGE":true,"SHRINK_THRESHOLD":0,"DROP_THRESHOLD":0,"MODE_ELEVATION":true,"REPRESENTATIVE_PERCENT":0,"TOOLTIP":true,"TOOLTIP_KEYBINDING":true,"AUTO_DISABLE_DANMU":false,"AUTO_DANMU_LIST":false,"FLUCTLIGHT":true,"BREAK_UPDATE":false,"TAKEOVER_AIJUDGE":true,"SCROLL_THRESHOLD":1200,"USERSCRIPT":"tweak_proto_view(view => {\n console.log(\"!!!\", view)\n debugger\n})","POPUP_BADGE":"percent","COMBINE_THREADS":1,"READ_PLAYER_BLACKLIST":true}
Wasm Validate: `true (60625 bytes)
Worker is Simulated:
false
Exception:
error log is working ("Error: error log is working\n at chrome-extension://jklfcpboamajpiikgkbjcnnnnooefbhh/generated/troubleshooting.js:1:9323")
Exception in Promise:
async error log is working ("Error: async error log is working\n at chrome-extension://jklfcpboamajpiikgkbjcnnnnooefbhh/generated/troubleshooting.js:1:9280\n at chrome-extension://jklfcpboamajpiikgkbjcnnnnooefbhh/generated/troubleshooting.js:1:9320")
补充说明
如果在脚本中增加任意一个空的 tweak_before_pakku 或 tweak_after_pakku 都可以让 debugger 能正确暂停执行:
此时观察 pakku 的日志能看到 pakku 应该是在阻塞等待 web worker 返回消息。
另外似乎用户脚本执行完成后,web worker 会被 terminate 掉,从而导致使用
console.log
打印在控制台的对象都无法点击展开,这个体验很不好(尤其是 debugger 又无效,我折腾了好几小时)。我目前只发现了三种绕过的方式:null["raise an error"]
),可以让打印出的对象可以展开onmessage
函数,阻止 web worker 调用postMessage
返回消息,可以让 worker 不被终止从而可以点击展开打印的对象但感觉这样也太麻烦了,关键是这都会阻止 pakku 正常运行。和真正的油猴脚本相比体验差太多了,不知道有没有什么办法改进。
以及我还有一个疑问,这三种不同的回调目前运行的顺序有保证吗?通过覆盖 onmessage 的尝试,我发现似乎目前的顺序是 tweak_proto_view、tweak_before_pakku、tweak_after_pakku,一个返回后才会执行下一个。这确实是我在 #178 (comment) 中想要的行为,但不知道这个顺序是否有保证,或者能否一定程度上自定义它们运行的先后顺序?我看到昨天最新的提交里支持在回调中运行 async 函数,不太清楚对此是否会有影响。
The text was updated successfully, but these errors were encountered: