E471 Trusted types violation in analytics/src/helpers.ts · Issue #7048 · firebase/firebase-js-sdk · GitHub
[go: up one dir, main page]

Skip to content

Trusted types violation in analytics/src/helpers.ts #7048

@jacobsimionato

Description

@jacobsimionato

Describe your environment

  • Operating System version: any
  • Browser version: Chrome
  • Firebase SDK version: 8.3.1
  • Firebase Product: Analytics

Describe the problem

Google Flutter web apps using Firebase plugins that rely on Firebase analytics JS are receiving browser error reports through the TrustedTypes browser APIs. Specifically, the script injection code in insertScriptTag is not adhering to the standards and is causing errors to be logged.

Steps to reproduce:

  1. Create an example app
  2. Enable trusted types enforcement, e.g. by adding:
      <meta
        http-equiv="Content-Security-Policy"
        content="require-trusted-types-for 'script'"
      />
    
  3. Load page, and look for errors in the JS console

A similar issue was reported and fixed in the FlutterFire plugin at firebase/flutterfire#10311 - it shows an example of adding a trusted types policy.

Also see internal Google issue b/265347604 for more details.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0