Nova-YouTube-extension icon indicating copy to clipboard operation
Nova-YouTube-extension copied to clipboard

TypeError: Failed to set the 'innerHTML' property on 'Element': This document requires 'TrustedHTML' assignment.

Open raingart opened this issue 6 months ago • 0 comments

if you get this error

TypeError: Failed to set the 'innerHTML' property on 'Element': This document requires 'TrustedHTML' assignment.

try install dev ver: https://gist.github.com/raingart/d734dd35f7090e9824df15f52c36f8a0

Please note this version is unstable. This is a snapshot of the ver that is being developed and is unfinished. Some functionality does not work.

Cause of error Google has prohibited the injection of HTML elements through the use of:

  • insertAdjacentHTML
  • innerHTML

photo_2024-08-06_13-25-23 The old version of the implementation is highlighted and the new one is below. More lines of code for the code gods!

Now this method does not work. This also applies to other scripts that I have installed. I'm not sure that others will have this error and I was not tested by Youtube. But recently I received reports of similar errors on the main YouTube page and on the Google search page.

Btw why does Nova even work on the Google search page. Because Google implements an embed version of YouTube there to display videos. To disable use the Disable embedded players support setting

For the same reason, we had to exclude the domain accounts.youtube.com - which displayed the standard login page for all Google service (the link doesn’t work now, but it was funny when you entered your password into your email and got an external script error).

raingart avatar Aug 06 '24 10:08 raingart