悬赏 300 元,如何在老版本 Chrome 上正常访问 github - V2EX
V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
Get Google Chrome
Vimium 在 Chrome 里使用 vim 快捷键
IdontWanToBeBan
V2EX    Chrome

悬赏 300 元,如何在老版本 Chrome 上正常访问 github

  •  
  •   IdontWanToBeBan 2019-01-15 09:01:29 +08:00 4391 次点击
    这是一个创建于 2539 天前的主题,其中的信息可能已经有所发展或是发生改变。

    使用老版本的 Chrome 访问 Github 的时候,会收到” github 不再支持你的浏览器“的通告,这个时候,github 的 activities 无法加载,然后 issue 等许多地方都无法被编辑

    我用的是 chrome51

    之前还可以用修改 user-agent 的方法来欺骗一下 Github,但是最近 Github 不知道搞了什么鬼,反正这个方法是没用了,使用了这个方法之后,虽然说 Github 不再有任何提示,但是症状和不修改 user-agent 之前一样

    F12 可以看到如下错误

    Frameworks-be15e106b4a7518f3a8ee2f63fa595ba.js:1 Uncaught SyntaxError: Unexpected token function

    Github-a004f249d4a217e23cc0ccd89aa8f76c.js:1 Uncaught SyntaxError: Unexpected token function

    这俩文件的地址是

    Frameworks-be15e106b4a7518f3a8ee2f63fa595ba.js Github-a004f249d4a217e23cc0ccd89aa8f76c.js

    然后我还去找了下相关的油猴脚本,然后找到了这个

    然而使用之后症状还是一样,只不过错误变了,变成了

    userscript.html?id=7a7d91eb-35b9-4dda-ace0-06e30608174e:77 Refused to load the script 'https://assets-cdn.github.com/assets/frameworks-5cc68fa4a212f8349010ddff8198506c.js' because it violates the following Content Security Policy directive: "script-src 'unsafe-eval' github.githubassets.com"

    所以,各位有什么好主意么?

    PS:请不要劝我升级浏览器了....谢谢,特殊用途

    17 条回复    2019-02-11 23:08:00 +08:00
    IdontWanToBeBan
        1
    IdontWanToBeBan  
    OP
       2019-01-15 09:16:24 +08:00
    忘记说了,油猴脚本是这个 https://github.com/LEORChn/Github_Compat_For_Chrome
    IdontWanToBeBan
        2
    IdontWanToBeBan  
    OP
       2019-01-15 09:24:01 +08:00
    我初步怀疑是 github 的 js 里面用了 chrome 老版本不支持的功能,但具体找不出来不支持的是啥
    whattheh3ll
        3
    whattheh3ll  
       2019-01-15 11:14:28 +08:00
    async/await
    IdontWanToBeBan
        4
    IdontWanToBeBan  
    OP
       2019-01-15 11:33:04 +08:00
    @whattheh3ll 这玩意和处理我这个问题没有什么联系吧,能否具体说下?
    shadowyue
        5
    shadowyue  
       2019-01-15 11:37:38 +08:00
    @IdontWanToBeBan
    人家说的八成是对的,老版本浏览器不支持 async/await
    你上面两个 js 文件都用了这两个关键字
    whattheh3ll
        6
    whattheh3ll  
       2019-01-15 11:37:56 +08:00
    @IdontWanToBeBan 应该是这个版本的 Chrome 不支持这两个关键字吧。看了一下 Github 的代码是有这两个关键字的。关键字的话好像不容易解决。
    shadowyue
        7
    shadowyue  
       2019-01-15 11:38:41 +08:00
    @IdontWanToBeBan
    我觉得你可以试试伪装自己的浏览器是个 ie
    IdontWanToBeBan
        8
    IdontWanToBeBan  
    OP
       2019-01-15 11:51:18 +08:00
    @shadowyue #7 Github 已经全面不支持 IE 了...
    IdontWanToBeBan
        9
    IdontWanToBeBan  
    OP
       2019-01-15 11:51:57 +08:00
    @whattheh3ll #6 我看这个功能是在 Chrome55 之后才支持的...所以真的没有一点办法了么...
    SakuraKuma
        10
    SakuraKuma  
       2019-01-15 12:03:40 +08:00
    装个 firefox.用来上 github..
    abmin521
        11
    abmin521  
       2019-01-15 12:07:29 +08:00 via Android
    开一个虚拟机 装 chrome70 远程过去
    journey0ad
        12
    journey0ad  
       2019-01-15 13:10:01 +08:00
    1.安装这个插件 https://chrome.google.com/webstore/detail/modheader/idgpnmonknjnojddfkpgkljpfnnfcklj

    2.然后导入
    {"title":"Github","hideComment":"true","headers":[{"enabled":true,"name":"","value":"","comment":""}],"respHeaders":[{"enabled":true,"name":"Content-Security-Policy","value":"default-src 'none'; base-uri 'self'; block-all-mixed-content; connect-src 'self' uploads.github.com www.githubstatus.com collector.githubapp.com api.github.com www.google-analytics.com github-cloud.s3.amazonaws.com github-production-repository-file-5c1aeb.s3.amazonaws.com github-production-upload-manifest-file-7fdce7.s3.amazonaws.com github-production-user-asset-6210df.s3.amazonaws.com wss://live.github.com; font-src github.githubassets.com; form-action 'self' github.com gist.github.com; frame-ancestors 'none'; frame-src render.githubusercontent.com; img-src 'self' data: github.githubassets.com assets-cdn.github.com identicons.github.com collector.githubapp.com github-cloud.s3.amazonaws.com *.githubusercontent.com; manifest-src 'self'; media-src 'none'; script-src github.githubassets.com assets-cdn.github.com; style-src 'unsafe-inline' github.githubassets.com","comment":""}],"filters":[{"enabled":true,"type":"urls","urlPattern":"https://github.com/*"}],"appendMode":""}

    3.然后再试试那个油猴脚本
    Zy143L
        13
    Zy143L  
       2019-01-15 13:18:17 +08:00
    把 UA 设置为
    "Opera/9.80 (Windows NT 6.1; WOW64; U; en) Presto/2.10.229 Version/11.62"
    你是试试
    IdontWanToBeBan
        14
    IdontWanToBeBan  
    OP
       2019-01-15 13:32:20 +08:00
    @journey0ad #12 还是一样的问题,我怀疑 CSP 错误是假的

    @Zy143L #13 这次错误变了
    send-beacon.js:110Uncaught SyntaxError: Unexpected token function
    installation-repo-selection.js:85Uncaught SyntaxError: Unexpected token function
    这两个文件:
    https://github.githubassets.com/assets/app/assets/modules/github/send-beacon.js
    https://github.githubassets.com/assets/app/assets/modules/github/apps/installation-repo-selection.js
    journey0ad
        15
    journey0ad  
       2019-01-15 14:08:25 +08:00
    似乎是油猴插件与这个修改 Header 的插件冲突,手动执行油猴脚本是可以的
    似乎只能自己写一个插件了,把修改 Header 和执行 JS 封装到一个插件里
    LEORChn
        16
    LEORChn  
       2019-02-11 23:05:01 +08:00
    我本人觉得有必要亲自出面发布一下进度。脚本已从 v1.0.3 更新至 v1.1.1
    新仓库:(油猴脚本合集仓库,旧仓库已不更新)
    https://github.com/LEORChn/GreasyMonkey/tree/master/GithubCompatForChrome
    安装页面:
    https://greasyfork.org/scripts/369095
    LEORChn
        17
    LEORChn  
       2019-02-11 23:08:00 +08:00
    然后还有我本人的博客地址,捐款二维码等等乱七八糟的东西
    https://leorchn.github.io/?about
    关于     帮助文档     自助推广系统     博客     API     FAQ     Solana     2618 人在线   最高记录 6679       Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 36ms UTC 14:57 PVG 22:57 LAX 06:57 JFK 09:57
    Do have faith in what you're doing.
    ubao msn snddm index pchome yahoo rakuten mypaper meadowduck bidyahoo youbao zxmzxm asda bnvcg cvbfg dfscv mmhjk xxddc yybgb zznbn ccubao uaitu acv GXCV ET GDG YH FG BCVB FJFH CBRE CBC GDG ET54 WRWR RWER WREW WRWER RWER SDG EW SF DSFSF fbbs ubao fhd dfg ewr dg df ewwr ewwr et ruyut utut dfg fgd gdfgt etg dfgt dfgd ert4 gd fgg wr 235 wer3 we vsdf sdf gdf ert xcv sdf rwer hfd dfg cvb rwf afb dfh jgh bmn lgh rty gfds cxv xcv xcs vdas fdf fgd cv sdf tert sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf shasha9178 shasha9178 shasha9178 shasha9178 shasha9178 liflif2 liflif2 liflif2 liflif2 liflif2 liblib3 liblib3 liblib3 liblib3 liblib3 zhazha444 zhazha444 zhazha444 zhazha444 zhazha444 dende5 dende denden denden2 denden21 fenfen9 fenf619 fen619 fenfe9 fe619 sdf sdf sdf sdf sdf zhazh90 zhazh0 zhaa50 zha90 zh590 zho zhoz zhozh zhozho zhozho2 lislis lls95 lili95 lils5 liss9 sdf0ty987 sdft876 sdft9876 sdf09876 sd0t9876 sdf0ty98 sdf0976 sdf0ty986 sdf0ty96 sdf0t76 sdf0876 df0ty98 sf0t876 sd0ty76 sdy76 sdf76 sdf0t76 sdf0ty9 sdf0ty98 sdf0ty987 sdf0ty98 sdf6676 sdf876 sd876 sd876 sdf6 sdf6 sdf9876 sdf0t sdf06 sdf0ty9776 sdf0ty9776 sdf0ty76 sdf8876 sdf0t sd6 sdf06 s688876 sd688 sdf86