English 中文(简体)
接收浏览器图像负荷要求
原标题:Intercepting image load request of the browser

我愿知道,是否有办法拦截浏览器的图像装载要求,并增加服务器预期的一些申请头。

实际情况是这样。 该网站的镜头向服务器发送了XHR,并完成了认证手。 随后提出的所有要求都必须包括主人。 这些图像被打破,因为浏览器没有向图像申请发送头盔。

提前感谢。

问题回答

你们可以向适当的负责人申请使用AJAX图像。 然后,你必须把64条放在图像二字典上,并通过打造将其插入OMM。

<img src="data:image/png;base64,[base64 encoded image]" />

可在浏览器中截获图像要求:在Mobification.js中检查电动反应器:

无,没有办法这样做,也非常好。

(Well, no way to do it from your Code. 浏览器所有人当然可以安装一种工具,改变要求,如果他们有此愿望的话。

浏览器以自己的严格方式发出吉大港定居地许可证申请书和图像,这意味着使用XHR的网址可以防止某些类型的欧安论坛攻击(交叉点要求伪造),如果服务器没有包含该网址拥有XHR代码的特别头,则拒绝某些要求。

你们可以完全控制一个浏览器对担任职位的人所做的事情。

问题本身是奇怪的,我觉得大家重新采用错误做法。

但是,如果任何人仍然很奇怪,现在可以与服务工人一起做到这一点。

以下是我们如何做到这一点。

// Register the service worker
if ( serviceWorker  in navigator) {
  navigator.serviceWorker.register("/sw.js").then((registration) => {
    // Registration was successful
  }).catch((error) => {
    // Registration failed
  });
}

这是我们的服务工作者

self.addEventListener( fetch ,(event) => {
  if (/.jpg$|.png$/.test(event.request.url)) {
    console.log("Image request: ", event.request.url);
  }
});

基本上,这种办法允许拦截任何请求。

职业工人可以直接与你的页码沟通,因为他们可以单独操作,孤立。 但你可以使用<代码>后限量进行通信。





相关问题
selected text in iframe

How to get a selected text inside a iframe. I my page i m having a iframe which is editable true. So how can i get the selected text in that iframe.

How to fire event handlers on the link using javascript

I would like to click a link in my page using javascript. I would like to Fire event handlers on the link without navigating. How can this be done? This has to work both in firefox and Internet ...

How to Add script codes before the </body> tag ASP.NET

Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...

Clipboard access using Javascript - sans Flash?

Is there a reliable way to access the client machine s clipboard using Javascript? I continue to run into permissions issues when attempting to do this. How does Google Docs do this? Do they use ...

javascript debugging question

I have a large javascript which I didn t write but I need to use it and I m slowely going trough it trying to figure out what does it do and how, I m using alert to print out what it does but now I ...

Parsing date like twitter

I ve made a little forum and I want parse the date on newest posts like twitter, you know "posted 40 minutes ago ","posted 1 hour ago"... What s the best way ? Thanx.