getDirectoryContents(): account for other targets like HTML5 as well