bangumi/scripts

添加黄油助手坏了

Closed this issue · 5 comments

@22earth

浏览器:Chrome 66.0.3330.2
脚本管理器:TamperMonkey 4.5.5663
脚本版本:0.3.3

现象描述:直接从新建角色进入创建角色后,在(角色/条目)关联页面没有绿字链接。而通过直接新建条目后进入关联页面就又有了绿字链接......

控制台输出:

ERROR: Execution of script 'bangumi new game subject helper' failed! Unexpected token u in JSON at position 0
SyntaxError: Unexpected token u in JSON at position 0
at JSON.parse ()
at Object.addRelated (userscript.html?id=0…0c-e2ca8a38252a:661)
at Object.init (userscript.html?id=0…0c-e2ca8a38252a:456)
at init (userscript.html?id=0…0c-e2ca8a38252a:922)
at eval (userscript.html?id=0…0c-e2ca8a38252a:926)
at Object.eval (userscript.html?id=0…0c-e2ca8a38252a:927)
at webpack_require (userscript.html?id=0…f0c-e2ca8a38252a:84)
at module.exports.gmFetch (userscript.html?id=0…0c-e2ca8a38252a:127)
at Window.tms_0d732260_db9c_41b7_bf0c_e2ca8a38252a (userscript.html?id=0…0c-e2ca8a38252a:130)
at :2:120
at eval (userscript.html?id=0…bf0c-e2ca8a38252a:4)
at eval (userscript.html?id=0…bf0c-e2ca8a38252a:5)
at Object.eval (userscript.html?id=0…c-e2ca8a38252a:1199)
at :2:120
at Object.E_c (:2:433)
at oa (eval at exec_fn (game:1), :61:203)
at Object.create (eval at exec_fn (game:1), :72:116)
at e (eval at exec_fn (game:1), :16:131)
at Object.runListeners (eval at exec_fn (game:1), :16:90)
at eval (eval at exec_fn (game:1), :73:201)
at HTMLDocument.k (:9:9)

获取游戏封面的时候也是一样的问题。

Uncaught SyntaxError: Unexpected token u in JSON at position 0
at JSON.parse ()
at HTMLInputElement.eval (userscript.html?id=0…0c-e2ca8a38252a:724)
at HTMLInputElement.dispatch (userscript.html?id=0…bf0c-e2ca8a38252a:8)
at HTMLInputElement.r.handle (userscript.html?id=0…bf0c-e2ca8a38252a:8)

我测试了一下 Firefox 53.0 Greasemonkey 3.17 功能都正常。
Chrome 64.0.3282.119 Tampermonkey 4.4 获取封面的功能有问题。(已修复 这个问题)
你检查一下 getchu bangumi的域名是否在 Tampermonkey 的 XHR的白名单里面。
2018-01-26_195654

2018-01-26_193411

白名单里有那几个域名的,还是不行。
算了,我每次手动保存一下条目信息吧。

额 抱歉 是我理解错了。 在Getchu的页面 现在的版本是默认需要用户点击 “新建条目”才会保存条目信息。以前的版本是打开Getchu页面就保存了,后来我考虑到影响打开页面速度。就改成现在这种方式,这种方式造成只添加角色的时候,没有条目信息。

更新一下 0.3.5 看看还有这个问题没?

没有问题了,谢谢!