We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
缘由:临时起意,想看deno在【微博站点或者微信公众号】中被搜索引擎收录情况,并且把结果显示在指定站点
deno
关键点: 解决不同站点之间的跨域问题
例子总共分三步: -- 步骤一: 添加自定义规则 -- 步骤二: 打开站点 https://justjavac.com/ 页面下的web控制台,并执行下面的脚本 -- 步骤三:观察控制台结果(发现,跨域已经被解决)
步骤一: 自定义规则例子:
关键点: 设置access-control-allow-origin,最宽泛的是设置为*,当然也可以设置为指定的站点地址
access-control-allow-origin
*
{ "action": { "requestHeaders": [ { "header": "referer", "operation": "set", "value": "https://www.baidu.com" }, { "header": "origin", "operation": "set", "value": "https://www.baidu.com" } ], "responseHeaders": [ { "header": "access-control-allow-origin", "operation": "set", "value": "*" }, { "header": "set-cookie", "operation": "remove" } ], "type": "modifyHeaders" }, "condition": { "initiatorDomains": [ "justjavac.com", "jingingxyk.com" ], "requestDomains": [ "www.baidu.com" ], "resourceTypes": [ "main_frame", "sub_frame", "stylesheet", "script", "image", "font", "object", "xmlhttprequest", "ping", "csp_report", "media", "websocket", "webtransport", "webbundle", "other" ], "urlFilter": "https://www.baidu.com/s?ie=utf-8&wd=*" }, "id": 20015, "priority": 10 }
步骤二: web控制台执行如下代码
{ //let url='https://www.baidu.com/s?ie=utf-8&wd=deno%20site%3A%20weibo.com' let url='https://www.baidu.com/s?ie=utf-8&wd=deno%20site%3Amp.weixin.qq.com' fetch(url).then(res=>res.text()).then((res)=>{ let content=(new DOMParser()).parseFromString(res,'text/html').body console.log(content) }) }
测试例子: https://github.com/justjavac/ReplaceGoogleCDN/blob/master/extension/test/remove-csp-test.js
The text was updated successfully, but these errors were encountered:
No branches or pull requests
缘由:临时起意,想看
deno
在【微博站点或者微信公众号】中被搜索引擎收录情况,并且把结果显示在指定站点关键点: 解决不同站点之间的跨域问题
例子总共分三步:
-- 步骤一: 添加自定义规则
-- 步骤二: 打开站点 https://justjavac.com/ 页面下的web控制台,并执行下面的脚本
-- 步骤三:观察控制台结果(发现,跨域已经被解决)
步骤一: 自定义规则例子:
步骤二: web控制台执行如下代码
测试例子: https://github.com/justjavac/ReplaceGoogleCDN/blob/master/extension/test/remove-csp-test.js
The text was updated successfully, but these errors were encountered: