Skip to content

🐛 [firebase_core_web] TrustedType violations #10311

@ChristianEdwardPadilla

Description

@ChristianEdwardPadilla

Bug report

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

Steps to reproduce

Run a Flutter Web app on a browser with TrustedType API support, or polyfill present.

Expected behavior

Script manipulation should not trigger TrustedType violations.

Example migration

Some script-manipulation code in the Flutter framework has already been migrated to satisfy the TrustedType checks. Here are two examples:

https://github.com/flutter/flutter/pull/112969/files

https://github.com/flutter/packages/blob/main/packages/google_identity_services_web/lib/src/js_loader.dart#L28-L44

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions