| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
A small JavaScript library to switch the protocol of a given site address from HTTP to HTTPS or vice versa.
Protocol Switching: Seamlessly switch the protocol of a given site address from HTTP to HTTPS or vice versa.
Browser Compatibility: Particularly useful for sites that require HTTP to function correctly, especially as modern browsers increasingly enforce HTTPS.
Callback Execution: Execute a specified callback function once the desired protocol has been successfully loaded.
Protocol Enforcement: Ensure your site consistently uses either HTTP or HTTPS as needed
changeProtocol()
Changes the protocol of the site address.
checkProtocol()
Checks the current protocol and switches if necessary.
const sp = new SwitchHTTPProtocol({
httpToHttps: true, // Use HTTPS Protocol
callback: () => {
console.log("Protocol switched successfully.");
},
});
/* Or */
const constructorObject = {
httpToHttps: true, // Use HTTPS Protocol
callback: () => callback: () => {
console.log("Protocol switched successfully");
},
};
const sp = new SwitchHTTPProtocol(constructorObject);const sp = new SwitchHTTPProtocol({
siteAddress: "example.com",
httpToHttps: false, // use HTTP protocol
callback: () => {
console.log("Protocol switched successfully.");
},
});
/* Or */
const constructorObject = {
siteAddress: "example.com",
httpToHttps: false, // use HTTP protocol
callback: () => {
console.log("Protocol switched successfully");
},
};
const sp = new SwitchHTTPProtocol(constructorObject);| Back | FazBrowse Home | New Git URL |