Places app: support for file URI scheme

This PR adds the support of URI starting by "file:/"
in the places app. (to allow to load local serverless json)
This commit is contained in:
Alezia Kurdis 2023-05-08 21:43:35 -04:00 committed by GitHub
parent 0bfdf92647
commit 74eefac999
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -502,7 +502,7 @@
"channel": channel, "channel": channel,
"action": "GO_FORWARD" "action": "GO_FORWARD"
}; };
EventBridge.emitWebEvent(JSON.stringify(message)); EventBridge.emitWebEvent(JSON.stringify(message));
} }
function pinMetaverse(metaverseIndex, pinned) { function pinMetaverse(metaverseIndex, pinned) {
@ -671,7 +671,8 @@
function teleportUsingAddressBarValue(url) { function teleportUsingAddressBarValue(url) {
var finalizedUrl = url; var finalizedUrl = url;
if (url.substr(0, 7).toLocaleLowerCase() !== "http://" && if (url.substr(0, 6).toLocaleLowerCase() !== "file:/" &&
url.substr(0, 7).toLocaleLowerCase() !== "http://" &&
url.substr(0, 8).toLocaleLowerCase() !== "https://" && url.substr(0, 8).toLocaleLowerCase() !== "https://" &&
url.substr(0, 7).toLocaleLowerCase() !== "hifi://") { url.substr(0, 7).toLocaleLowerCase() !== "hifi://") {
finalizedUrl = "hifi://" + url; finalizedUrl = "hifi://" + url;