#517: fake out current Rocket Loader

This commit is contained in:
Cameron Kaiser
2018-08-18 14:59:52 -07:00
parent 0558c01798
commit 0bbf06ea62
2 changed files with 27 additions and 3 deletions
+11
View File
@@ -1168,6 +1168,17 @@ Element::GetDestinationInsertionPoints()
void
Element::GetAttribute(const nsAString& aName, DOMString& aReturn)
{
// Complete the illusion of issue 517 by preventing Rocket Loader from
// seeing the data-cf-nonce attribute. This doesn't seem to be used
// anywhere else in the Cloudflare stack.
if (MOZ_UNLIKELY(aName.LowerCaseEqualsASCII("data-cf-nonce"))) {
#if DEBUG
fprintf(stderr, "TenFourFox: blocked access to proscribed property data-cf-nonce.\n");
#endif
aReturn.SetNull();
return;
}
const nsAttrValue* val =
mAttrsAndChildren.GetAttr(aName,
IsHTMLElement() && IsInHTMLDocument() ?