file:// protocol block resources from "//***.com"

by Liu Tong Tong   Last Updated July 12, 2019 05:26 AM

😊Oh, I am very embarrassed to ask this question, but I am very cautious after reading the documents I have possible, I came here to ask questions, I hope to get your help!

I used the express to create a local server, and then opened a port using the http protocol to hang my html resources, but the real user environment is full of problems, such as opening a local firewall, port occupancy (although we Can be solved by the program). Because of these problems, I switched to the file protocol, so that we don't have to open the port, and these problems do not exist.

Today, I found another problem. There are some third-party sdk in my application. It loads some scripts and it sounds normal, but the address it loads does not specify an explicit network protocol, such as http or Instead of https, use "//****.com/path/to/resources". This directly led to an error that the file could not be found.

Here, I am a headache, I don't know what to do, I read all the related documents of electron, including using the register***Protocol interface, but they do not seem to have a scheme to handle multiple (file, http ) the ability to return data types.

my goal: I just want to be able to load my resources without opening the port, of course considering the above "//".

Tags : electron


Related Questions


Updated July 06, 2019 16:26 PM

Updated July 18, 2019 13:26 PM

Updated August 02, 2018 11:26 AM

Updated January 01, 2018 22:26 PM

Updated October 18, 2018 12:26 PM