在 Chrome 扩展程序中获取 JSON [英] Get JSON in a Chrome extension

查看:33
本文介绍了在 Chrome 扩展程序中获取 JSON的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的 chrome 扩展程序的小问题.

Small problem with my chrome extension.

我只是想从另一台服务器获取一个 JSON 数组.但是清单 2 不允许我这样做.我尝试指定 content_security_policy,但 JSON 数组存储在没有 SSL 证书的服务器上.

I just wanted to get a JSON array from another server. But manifest 2 doesn't allow me to do it. I tried specify content_security_policy, but the JSON array is stored on a server without SSL cert.

那么,如果不使用清单 1,我该怎么办?

So, what should I do without using manifest 1?

推荐答案

CSP 不能导致你描述的问题.您很可能使用的是 JSONP 而不是普通的 JSON.JSONP 在 Chrome 中不起作用,因为 JSONP 通过在文档中插入

登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆