鍍金池/ 問答/人工智能  Linux  網(wǎng)絡(luò)安全  HTML/ jsonp跨域被CORB攔截,有何解決方法?

jsonp跨域被CORB攔截,有何解決方法?

* 最近在用vue仿寫QQ音樂的web移動(dòng)端,使用jsonp請(qǐng)求數(shù)據(jù)。在請(qǐng)求排行榜數(shù)據(jù)的時(shí)候Chrome報(bào)CORB攔截問題,具體的URL為

https://c.y.qq.com/v8/fcg-bin/fcg_myqq_toplist.fcg?g_tk=5381&uin=704838764&format=json&inCharset=utf-8&outCharset=utf-8&notice=0&platform=h5&needNewCode=1&jsonpCallback=__jp0

* 已知URL沒有問題,在瀏覽器地址輸入可以獲取得到數(shù)據(jù)

在開發(fā)者工具查看了Response Header的Content-type為application/x-javascript,不知道會(huì)不會(huì)與這個(gè)有關(guān)呢

clipboard.png

求教各位大佬有沒有什么解決方案o(╥﹏╥)o

回答
編輯回答
妖妖
2018年3月25日 15:21
編輯回答
終相守

clipboard.png

這里qq音樂已經(jīng)指定了只有人家qq的域名才可以用這個(gè)js。就是防止你直接盜用。

你直接把代碼手動(dòng)下載下來, 然后地址指向本地不就好了嗎

2017年9月9日 07:18
編輯回答
久舊酒

是瀏覽器的安全策略禁止了這個(gè),防止跨域攻擊啥的 參考 https://www.chromium.org/Home...

Cross-Origin Read Blocking (CORB) is a new web platform security feature that helps mitigate the threat of side-channel attacks (including Spectre). It is designed to prevent the browser from delivering certain cross-origin network responses to a web page, when they might contain sensitive information and are not needed for existing web features. For example, it will block a cross-origin text/html response requested from a <script> or <img> tag, replacing it with an empty response instead. This is an important part of the protections included with Site Isolation.

2018年2月15日 15:09