Google 地图 Javascript blob url 的 RefererNotAllowedMapError
Google Maps Javascript RefererNotAllowedMapError for blob urls
我从服务器 api 获取 HTML 代码并创建如下链接:
const blob = new Blob([page], { type: "text/html" });
const url = URL.createObjectURL(blob);
然后创建一个 iframe 来显示此页面:
const iframe = document.createElement("iframe");
iframe.src = url;
但是我得到了一个 RefererNotAllowedMapError,
Your site URL to be authorized: blob:http://xxx.example.com/****
我已经在 Website restrictions
中添加了 *.example.com/*
、blob:*.example.com/*
。
根据报错信息中的文字,您需要添加:
blob:http://xxx.example.com/*
(或 blob:http://*.example.com/*
) 根据 OP
不起作用
我从服务器 api 获取 HTML 代码并创建如下链接:
const blob = new Blob([page], { type: "text/html" });
const url = URL.createObjectURL(blob);
然后创建一个 iframe 来显示此页面:
const iframe = document.createElement("iframe");
iframe.src = url;
但是我得到了一个 RefererNotAllowedMapError,
Your site URL to be authorized: blob:http://xxx.example.com/****
我已经在 Website restrictions
中添加了 *.example.com/*
、blob:*.example.com/*
。
根据报错信息中的文字,您需要添加:
blob:http://xxx.example.com/*
(或 根据 OPblob:http://*.example.com/*
)