JSREI / ast-hook-for-js-RE

浏览器内存漫游解决方案(探索中...)
Other
1.5k stars 393 forks source link

影响了页面原有逻辑-微信阅读 #4

Closed vlinz-git closed 3 years ago

vlinz-git commented 3 years ago

He 大佬您好,我在微信阅读上使用的时候会影响到原有逻辑,导致无法正常翻页,有时间的话给看下呗 链接:https://weread.qq.com/web/category/all

CC11001100 commented 3 years ago

你好,我是菜菜,我定位了一下原因,又是一个BUG...

是因为在处理HTML中的script标签的时候没有正确保存script标签原有的属性导致跨域失败进而导致后面一连串的问题,您可以先手动修改一下自己本地的代码,master的代码会随着下个版本更新一起修复。

修改global-assign-hook-component-main.jsprocessHtmlResponse方法循环最后的代码为:

        const newScript = cheerio.load("<script>" + newJsCode + "</script>")("script");
        for(let key in script.attribs) {
            newScript.attr(key, script.attribs[key]);
        }
        $(script).replaceWith(newScript);
vlinz-git commented 3 years ago

赞呀,不愧是大佬 👍