Ask coding questions

← Back to all posts
Chrome Extensoin js adblock
makxspa

I made a chrome extension similar to adblock. 1 time per second I get an error: "document.getElementByClassName is not a function".
This is my code (I didn't give all the code because I don't want anyone to copy the code):
manifest.json

script.js

Voters
makxspa
Comments
hotnewtop
JustCoding123

Its called document.getElementsByClassName with an s.

makxspa

@JustCoding123 Could you please explain to me because I don't understand anything from your message.

JustCoding123

@makxspa You typed document.getElement(No s here)ByClassName wich doesn't exist. The function is called document.getElementsByClassName.

makxspa

@JustCoding123 I corrected the code but I have an error "Uncaught TypeError: document.getElementByClassNames is not a function"
script.js