mirror of
https://github.com/overte-org/overte.git
synced 2025-07-23 19:04:27 +02:00
Housekeeping.
This commit is contained in:
parent
fbaf0ea56b
commit
c121a8ef2a
3 changed files with 45 additions and 48 deletions
|
@ -25,9 +25,8 @@ Rectangle {
|
||||||
|
|
||||||
function getWhitelistAsText() {
|
function getWhitelistAsText() {
|
||||||
var whitelist = Settings.getValue("private/settingsSafeURLS");
|
var whitelist = Settings.getValue("private/settingsSafeURLS");
|
||||||
var arrayWhitelist = whitelist.split(",");
|
var arrayWhitelist = whitelist.split(",").join("\n");
|
||||||
var whitelistText = arrayWhitelist.join("\n");
|
return arrayWhitelist;
|
||||||
return whitelistText;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function setWhitelistAsText(whitelistText) {
|
function setWhitelistAsText(whitelistText) {
|
||||||
|
@ -37,10 +36,9 @@ Rectangle {
|
||||||
var originalSet = originalSetString.split(' ').join('');
|
var originalSet = originalSetString.split(' ').join('');
|
||||||
|
|
||||||
var check = Settings.getValue("private/settingsSafeURLS");
|
var check = Settings.getValue("private/settingsSafeURLS");
|
||||||
var arrayCheck = check.split(",");
|
var arrayCheck = check.split(",").join("\n");
|
||||||
var textCheck = arrayCheck.join("\n");
|
|
||||||
|
|
||||||
if (textCheck == originalSet) {
|
if (arrayCheck === originalSet) {
|
||||||
setWhitelistSuccess(true);
|
setWhitelistSuccess(true);
|
||||||
} else {
|
} else {
|
||||||
setWhitelistSuccess(false);
|
setWhitelistSuccess(false);
|
||||||
|
@ -61,9 +59,9 @@ Rectangle {
|
||||||
}
|
}
|
||||||
|
|
||||||
function initCheckbox() {
|
function initCheckbox() {
|
||||||
var check = Settings.getValue("private/whitelistEnabled");
|
var check = Settings.getValue("private/whitelistEnabled", false);
|
||||||
|
|
||||||
if (check == true) {
|
if (check) {
|
||||||
whitelistEnabled.toggle();
|
whitelistEnabled.toggle();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -180,7 +178,7 @@ Rectangle {
|
||||||
HifiStylesUit.RalewayRegular {
|
HifiStylesUit.RalewayRegular {
|
||||||
id: descriptionText;
|
id: descriptionText;
|
||||||
text:
|
text:
|
||||||
"The whitelist checks scripts/QML as it is loaded.<br/>
|
"The whitelist checks scripts & QML as they are loaded.<br/>
|
||||||
Therefore, if a script is cached or has no reason to load again,<br/>
|
Therefore, if a script is cached or has no reason to load again,<br/>
|
||||||
then removing it from the whitelist will not be effective until<br/>
|
then removing it from the whitelist will not be effective until<br/>
|
||||||
it is reloaded.<br/>
|
it is reloaded.<br/>
|
||||||
|
|
|
@ -2370,8 +2370,8 @@ void ScriptEngine::entityScriptContentAvailable(const EntityItemID& entityID, co
|
||||||
safeURLPrefixes += qEnvironmentVariable("EXTRA_WHITELIST").trimmed().split(QRegExp("\\s*,\\s*"), QString::SkipEmptyParts);
|
safeURLPrefixes += qEnvironmentVariable("EXTRA_WHITELIST").trimmed().split(QRegExp("\\s*,\\s*"), QString::SkipEmptyParts);
|
||||||
|
|
||||||
// ENTITY SCRIPT WHITELIST TOGGLE CHECK
|
// ENTITY SCRIPT WHITELIST TOGGLE CHECK
|
||||||
Setting::Handle<bool> _whitelistEnabled{"private/whitelistEnabled", false };
|
Setting::Handle<bool> whitelistEnabled{"private/whitelistEnabled", false };
|
||||||
bool whitelistEnabled = _whitelistEnabled.get();
|
bool whitelistEnabled = whitelistEnabled.get();
|
||||||
|
|
||||||
if (!whitelistEnabled) {
|
if (!whitelistEnabled) {
|
||||||
qCDebug(scriptengine) << "Whitelist Enabled: " << whitelistEnabled;
|
qCDebug(scriptengine) << "Whitelist Enabled: " << whitelistEnabled;
|
||||||
|
|
|
@ -974,7 +974,6 @@ protected:
|
||||||
Setting::Handle<bool> _enableExtendedJSExceptions { _SETTINGS_ENABLE_EXTENDED_EXCEPTIONS, true };
|
Setting::Handle<bool> _enableExtendedJSExceptions { _SETTINGS_ENABLE_EXTENDED_EXCEPTIONS, true };
|
||||||
|
|
||||||
QWeakPointer<ScriptEngines> _scriptEngines;
|
QWeakPointer<ScriptEngines> _scriptEngines;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
ScriptEnginePointer scriptEngineFactory(ScriptEngine::Context context,
|
ScriptEnginePointer scriptEngineFactory(ScriptEngine::Context context,
|
||||||
|
|
Loading…
Reference in a new issue