Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/402.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 浏览器在头标记之前插入的标记_Javascript_Content Security Policy_Brave Browser - Fatal编程技术网

Javascript 浏览器在头标记之前插入的标记

Javascript 浏览器在头标记之前插入的标记,javascript,content-security-policy,brave-browser,Javascript,Content Security Policy,Brave Browser,我在我的网页上的头标签前发现了一个标签,由勇敢的浏览器插入。 如果我的内容安全策略不允许运行没有有效nonce或integrity属性的脚本,我的问题将在我的页面上运行以下内容。 第二个问题,脚本要求禁用(disableDappDetectionInsertion)??? 第三,这个脚本做什么?此脚本具有“数据dapp检测”属性。 它发生在窗口模糊一段时间后。 勇敢的控制台中也没有错误。 Brave版本1.10.97铬:83.0.4103.116(正式版本)(64位) 安装brave浏览器并转到

我在我的网页上的头标签前发现了一个标签,由勇敢的浏览器插入。 如果我的内容安全策略不允许运行没有有效nonce或integrity属性的脚本,我的问题将在我的页面上运行以下内容。 第二个问题,脚本要求禁用(disableDappDetectionInsertion)??? 第三,这个脚本做什么?此脚本具有“数据dapp检测”属性。 它发生在窗口模糊一段时间后。 勇敢的控制台中也没有错误。 Brave版本1.10.97铬:83.0.4103.116(正式版本)(64位)


安装brave浏览器并转到此站点,查看您的CSP策略是否允许

关于dapp检测,本网站将详细介绍:

但简而言之。。。勇敢者使用BAT(基本注意标记),并附带一个已经安装的广告拦截器(勇敢者盾牌)。BAT基于以太区块链,是他们允许广告和盈利的方式,同时也尊重用户隐私

(function() {
  let alreadyInsertedMetaTag = false

  function __insertDappDetected() {
    if (!alreadyInsertedMetaTag) {
      const meta = document.createElement('meta')
      meta.name = 'dapp-detected'
      document.head.appendChild(meta)
      alreadyInsertedMetaTag = true
    }
  }

  if (window.hasOwnProperty('web3')) {
    // Note a closure can't be used for this var because some sites like
    // www.wnyc.org do a second script execution via eval for some reason.
    window.__disableDappDetectionInsertion = true
    // Likely oldWeb3 is undefined and it has a property only because
    // we defined it. Some sites like wnyc.org are evaling all scripts
    // that exist again, so this is protection against multiple calls.
    if (window.web3 === undefined) {
      return
    }
    __insertDappDetected()
  } else {
    var oldWeb3 = window.web3
    Object.defineProperty(window, 'web3', {
      configurable: true,
      set: function (val) {
        if (!window.__disableDappDetectionInsertion)
          __insertDappDetected()
        oldWeb3 = val
      },
      get: function () {
        if (!window.__disableDappDetectionInsertion)
          __insertDappDetected()
        return oldWeb3
      }
    })
  }
})()