Skip to content
This repository was archived by the owner on Aug 1, 2024. It is now read-only.

Commit f1a89b3

Browse files
kotoshicks
authored andcommitted
Automated g4 rollback of changelist 264626714.
*** Reason for rollback *** This breaks instances in report-only Trusted-Types enforcement, where non-TrustedURL types are passed to the sinks. w3c/trusted-types#209 *** Original change description *** Make Closure Trusted Types integration not require TrustedURL values, as they will soon be removed from the Trusted Types API - w3c/trusted-types#204. goog.createTrustedTypesPolicy will attempt to create a default policy allowing any value to be converted to TrustedURL. RELNOTES: Trusted Types integrations will allow any value to be a TrustedURL via defensively creating a 'default' policy (to prepare for TrustedURL deprecation) *** ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=265699886
1 parent 1bcb6b0 commit f1a89b3

File tree

1 file changed

+0
-15
lines changed

1 file changed

+0
-15
lines changed

closure/goog/base.js

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4170,21 +4170,6 @@ goog.createTrustedTypesPolicy = function(name) {
41704170
} catch (e) {
41714171
goog.logToConsole_(e.message);
41724172
}
4173-
4174-
// TrustedTypes API will deprecate TrustedURLs in Chrome 78. To prepare for
4175-
// that, and make the Closure code emulate the post-deprecation behavior
4176-
// of the API, we attempt to create a default policy that blesses any value
4177-
// to TrustedURL. This is a best-effort attempt. If that does not succeed,
4178-
// the application fails close - TrustedURL values will simply be required
4179-
// at all relevant sinks.
4180-
if (goog.global.TrustedURL && policyFactory.getPolicyNames &&
4181-
policyFactory.getPolicyNames().indexOf('default') === -1) {
4182-
try {
4183-
policyFactory.createPolicy('default', {createURL: goog.identity_}, true);
4184-
} catch (e) {
4185-
goog.logToConsole_(e.message);
4186-
}
4187-
}
41884173
return policy;
41894174
};
41904175

0 commit comments

Comments
 (0)