Externally hosted Javascript is unable to access Visualforce page

It seems, you need to add few of the domains in the whitelisted settings.

As per this Allow the Required Domains :

If you control your users’ or servers’ access to the Internet through allowlists, add these domains to ensure that you receive all Salesforce content.

  • *.bluetail.salesforce.com
  • *.content.force.com
  • *.documentforce.com
  • *.force.com
  • *.forcesslreports.com
  • *.forceusercontent.com
  • *.lightning.com
  • *.salesforce.com
  • *.salesforceliveagent.com (used with Chat, Omni-Channel, and SOS)
  • *.salesforce-communities.com (necessary if you’e using Communities or Site.com) trailblazer.me
  • *.visualforce.com