CodeNewbie Community 🌱

Kasi21
Kasi21

Posted on

Need help with Chrome extension learning project

Hi folks,

I'm trying to learn coding with a series of projects. I'm stuck on the first one and could use some help. πŸ€¦β€β™‚οΈ

I'm trying to create a Chrome extension that adds an image as the background for Twitter. I've successfully been able to do this for the Google homepage, but I can't get it to work on the Twitter page.

Could someone please help me to understand what I'm doing wrong?

The code is open in my GitHub: https://github.com/Kasi21/TwitterBackground

Thanks in advance, and looking forward to getting involved with this community!

Kas

Top comments (4)

Collapse
 
terabytetiger profile image
Tyler V. (he/him)

I played around with this a bit and eventually realized that the issue isn't with your code - it's that Twitter is blocking the image URL from being loaded!

You can tell it took a while from the "156" times the error showed up in my console πŸ˜…

Dev Console showing 156 errors of refused to load URL

Collapse
 
kasi21 profile image
Kasi21

Ah, thanks so much for looking at this Tyler! πŸ¦Έβ€β™‚οΈ

Is that something Twitter is doing on purpose? Is there an alternative way to load the image URL so that it can be used as the background?

Collapse
 
kasi21 profile image
Kasi21

Hi Tyler,

I managed to sort it out!

Thanks for your help - I wouldn't have been able to do it if you hadn't pointed me in the right direction regarding the error code! I posted in a couple of other forums, and I updated them with the answer and saying that I got it with help from the CodeNewbie Forum - so hopefully, that drives some traffic this way!

If anyone else is interested, basically, I had to load the background image locally by adapting the code from: github.com/GoogleChrome/chrome-ext...

Cheers

Thread Thread
 
terabytetiger profile image
Tyler V. (he/him)

Glad I was able to get you in the right direction!

That's a neat way to resolve the error - glad you shared it so I can have it as a resource if I ever need it! πŸ₯³