mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-04 06:13:09 +02:00
allow scripts on the web to refer to interface-local javascript libraries
This commit is contained in:
parent
b95c81d0ba
commit
8c278563f5
1 changed files with 7 additions and 1 deletions
|
@ -912,7 +912,13 @@ void ScriptEngine::include(const QStringList& includeFiles, QScriptValue callbac
|
||||||
// Do NOT use PreferLocalFile as its behavior is unpredictable (e.g., on defaultScriptsLocation())
|
// Do NOT use PreferLocalFile as its behavior is unpredictable (e.g., on defaultScriptsLocation())
|
||||||
const auto strippingFlags = QUrl::RemoveFilename | QUrl::RemoveQuery | QUrl::RemoveFragment;
|
const auto strippingFlags = QUrl::RemoveFilename | QUrl::RemoveQuery | QUrl::RemoveFragment;
|
||||||
for (QString file : includeFiles) {
|
for (QString file : includeFiles) {
|
||||||
QUrl thisURL { resolvePath(file) };
|
QUrl thisURL;
|
||||||
|
if (file.startsWith("/~/")) {
|
||||||
|
thisURL = expandScriptUrl(QUrl::fromLocalFile(file));
|
||||||
|
} else {
|
||||||
|
thisURL = resolvePath(file);
|
||||||
|
}
|
||||||
|
|
||||||
if (!_includedURLs.contains(thisURL)) {
|
if (!_includedURLs.contains(thisURL)) {
|
||||||
if (!currentSandboxURL.isEmpty() && (thisURL.scheme() == "file") &&
|
if (!currentSandboxURL.isEmpty() && (thisURL.scheme() == "file") &&
|
||||||
(
|
(
|
||||||
|
|
Loading…
Reference in a new issue