Once again,
document.querySelector()[
^] returns the first matching element. If there is no matching element, it returns
null
.
Your document does not contain an
<img>
element, so
document.querySelector('img')
will return
null
.
You then attempt to set the
.src
property on the returned value, and get an error because the value is
null
.
This is exactly the same problem you had
yesterday[
^], and the fix is exactly the same: add an
<img>
tag to your document, or remove that line of script.