window.open with headers [英] window.open with headers
问题描述
我可以控制发送的HTTP标头window.open
(跨浏览器)?
Can I control the HTTP headers sent by window.open
(cross browser)?
如果没有,我可以以某种方式 window.open
一个页面,然后在其弹出窗口中发出我的请求和自定义标题?
If not, can I somehow window.open
a page that then issues my request with custom headers inside its popped-up window?
我需要一些狡猾的黑客。
I need some cunning hacks.
推荐答案
我可以控制window.open发送的HTTP头吗? (跨浏览器)?
Can I control the HTTP headers sent by window.open (cross browser)?
否
如果没有,我可以以某种方式window.open一个页面然后在其弹出窗口中发出我的请求与自定义标题?
If not, can I somehow window.open a page that then issues my request with custom headers inside its popped-up window?
- 您可以请求触发服务器端程序的URL,该程序使用任意标头生成请求然后返回响应
- 您可以运行JavaScript(可能告别了渐进增强)使用XHR以任意标头发出请求(假设URL符合同源策略)a d然后在JS中处理结果。
我需要一些狡猾的黑客......
I need some cunning hacks...
如果您描述了问题而不是询问可能的解决方案是否有效,这可能有所帮助。
It might help if you described the problem instead of asking if possible solutions would work.
这篇关于window.open with headers的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!