@cook
Thanks for looking at my code. I'm glad to know I hadn't overlooked something silly.

As it is, I am trying to make an extension to re-display or mobilize certain kinds of websites. Imagine if I went to a website full of thumbnails, and the script grabbed all of the linked full-size images. There's other websites and whatnot, but I was mostly playing around with extensions for now.

Thanks again for the help.