[tor-commits] [snowflake-webext/master] Factor out a common getDir function