maple3142 / browser-extensions

我的一些 userjs & usercss
88 stars 33 forks source link

parsedecsig error: TypeError: Cannot read properties of null (reading '0') #33

Closed graphemecluster closed 1 year ago

graphemecluster commented 1 year ago

好久不見~ Error occurred at: https://github.com/maple3142/browser-extensions/blob/96bd0909b5eee7f9eb9b2879b7970fa38329b2a0/scripts/local-youtube-dl.user.js#L235 script content: https://www.youtube.com/s/player/11667490/player_ias.vflset/zh_HK/base.js

Some debug info:

Variable Value
fnname Xua
argname a
fnbody a=a.split("");MC["if"](a,71);MC.pn(a,3);MC.QO(a,27);MC.pn(a,2);MC["if"](a,36);MC.QO(a,14);MC.pn(a,3);MC.QO(a,68);MC.pn(a,3);return a.join("")
helpername MC["if"](a,71);MC

How come the minifier use if as a property name XD

So I managed to solve that by change helpernameresult to /;([a-zA-Z0-9$_]+?)\..+?\(/.exec(fnbody). And for safety let's also add _ to fnnameresult, i.e. /=([a-zA-Z0-9$_]+?)\(decodeURIComponent/.exec(data).

maple3142 commented 1 year ago

我自己是沒遇到現版本會遇到問題的狀況,不過既然有機會出現的話我就先更新 Regex 了,感謝!

graphemecluster commented 1 year ago

速い () 也謝謝你了(有點好奇為什麼在 helpernameresult 要把 $ escape 掉)

maple3142 commented 1 year ago

我猜你想說的是 fnnameresult? 可能只是我寫那個的時候不太清楚 Regex 哪裡該 escape 吧

graphemecluster commented 1 year ago

對,我說錯了,只是那樣而已(強迫症