zoukankan      html  css  js  c++  java
  • 谷歌浏览器插件 chrome.webRequest.onHeadersReceived 修改 无效问题

    // web响应
    chrome.webRequest.onHeadersReceived.addListener(
      (details) => {
        let responseHeaders = details.responseHeaders
        console.log('details', responseHeaders)
        let index = responseHeaders.findIndex((p) => p.name.toLowerCase() === 'x-frame-options')
        if (index > -1) {
          responseHeaders.splice(index, 1)
          console.log('删除 x-frame-options', responseHeaders)
        }

        return { responseHeaders }
      },
      { urls: ['<all_urls>'], types: ['main_frame', 'sub_frame'] },
      ['blocking', 'responseHeaders']
    )
      

    浏览器 f12 查看发现响应头 ,并没有变化,这时候  不要着急。  

    把原本不允许 签入 iframe 的页面签入 进入 iframe 发现浏览器已经不报错了,至此就明白了,原来f12 查看到的响应头已经 失效了

  • 相关阅读:
    Python 面向对象
    pymysql增删改查
    pymysql简单链接示例
    mysql权限管理
    mysql五补充部分:SQL逻辑查询语句执行顺序
    mysql安装与基本管理
    mysql索引原理与慢查询优化2
    ftp 服务
    Linux 并发链接数
    Linux
  • 原文地址:https://www.cnblogs.com/FlowLight/p/13432346.html
Copyright © 2011-2022 走看看