'Checks if the domain is the same, or if it\'s considered secure.'

def _analyze_domain(self, response, script_full_url, script_tag):

    url = response.get_url()
    script_domain = script_full_url.get_domain()
    if (script_domain != response.get_url().get_domain()):
        for secure_domain in self._secure_js_domains:
            if (secure_domain in script_domain):
                return
        to_highlight = script_tag.attrib.get('src')
        desc = 'The    URL:    "%s"    has    a    script    tag    with    a    source    that    points    to    a    third    party    site    ("%s").    This    practice    is    not    recommended,    the    security    of    the    current    site    is    being    delegated    to    the    external    entity.'
        desc %= (url, script_domain)
        i = Info('Cross-domain    javascript    source', desc, response.id, self.get_name())
        i.set_url(url)
        i.add_to_highlight(to_highlight)
        i[CrossDomainInfoSet.ITAG] = script_domain
        self.kb_append_uniq_group(self, 'cross_domain_js', i, group_klass=CrossDomainInfoSet)
