I can probably get rid of some of these if(connection) things -- they might be artifacts of some files being content script and others not