analytics.js-integrations
analytics.js-integrations copied to clipboard
Force https protocol in load-script when running on file: url (e.g., Electron)
The AppCues integration (and a few others) use the loadScript
with a protocol relative url:
https://github.com/segmentio/analytics.js-integrations/blob/master/integrations/appcues/lib/index.js#L51
This sets the protocol to http
if running loading via a file:
url.
https://github.com/segmentio/load-script/blob/master/index.js#L27-L33
We are loading Segment into an Electron app, which loads pages via a file: url. However, we do not want to allow non-https external connections.
Is there a way around this? One idea would be to change the logic in loadScript
to default to https
instead of http
in the file:
url case.