def download_all_JS_files(self,messageIsRequest,message):
    request_byte_array=message.getMessageInfo().getRequest()
    if messageIsRequest:
      request_http_service=message.getMessageInfo().getHttpService()
      request_byte_array=message.getMessageInfo().getRequest()
      request_object=self._helpers.analyzeRequest(request_http_service, request_byte_array)

      #Extract hostname from header
      hostname=webcommon.get_host_header_from_request(self,request_object)

      #Check if the URL is in scope. This is to eliminate stray traffic.
      if hostname and hostname[1] in urls_in_scope:
        request_url=request_object.getUrl()
        if str(request_url).endswith('.js'):
          print request_url
          os.chdir(download_path)
          os.system("wget "+str(request_url))
dataset/ETHPy150Open arvinddoraiswamy/mywebappscripts/BurpExtensions/download_all_js_files.py/BurpExtender.download_all_JS_files/original