Type checked adsafe.js until parse_query

- commented some if-cases due to slow down