Housekeeping.

This commit is contained in:
Kasen IO 2020-01-23 03:06:58 -05:00
parent fbaf0ea56b
commit c121a8ef2a
3 changed files with 45 additions and 48 deletions

View file

@ -25,9 +25,8 @@ Rectangle {
function getWhitelistAsText() {
var whitelist = Settings.getValue("private/settingsSafeURLS");
var arrayWhitelist = whitelist.split(",");
var whitelistText = arrayWhitelist.join("\n");
return whitelistText;
var arrayWhitelist = whitelist.split(",").join("\n");
return arrayWhitelist;
}
function setWhitelistAsText(whitelistText) {
@ -37,10 +36,9 @@ Rectangle {
var originalSet = originalSetString.split(' ').join('');
var check = Settings.getValue("private/settingsSafeURLS");
var arrayCheck = check.split(",");
var textCheck = arrayCheck.join("\n");
var arrayCheck = check.split(",").join("\n");
if (textCheck == originalSet) {
if (arrayCheck === originalSet) {
setWhitelistSuccess(true);
} else {
setWhitelistSuccess(false);
@ -61,9 +59,9 @@ Rectangle {
}
function initCheckbox() {
var check = Settings.getValue("private/whitelistEnabled");
var check = Settings.getValue("private/whitelistEnabled", false);
if (check == true) {
if (check) {
whitelistEnabled.toggle();
}
}
@ -180,7 +178,7 @@ Rectangle {
HifiStylesUit.RalewayRegular {
id: descriptionText;
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/>
then removing it from the whitelist will not be effective until<br/>
it is reloaded.<br/>

View file

@ -2370,8 +2370,8 @@ void ScriptEngine::entityScriptContentAvailable(const EntityItemID& entityID, co
safeURLPrefixes += qEnvironmentVariable("EXTRA_WHITELIST").trimmed().split(QRegExp("\\s*,\\s*"), QString::SkipEmptyParts);
// ENTITY SCRIPT WHITELIST TOGGLE CHECK
Setting::Handle<bool> _whitelistEnabled{"private/whitelistEnabled", false };
bool whitelistEnabled = _whitelistEnabled.get();
Setting::Handle<bool> whitelistEnabled{"private/whitelistEnabled", false };
bool whitelistEnabled = whitelistEnabled.get();
if (!whitelistEnabled) {
qCDebug(scriptengine) << "Whitelist Enabled: " << whitelistEnabled;

View file

@ -974,7 +974,6 @@ protected:
Setting::Handle<bool> _enableExtendedJSExceptions { _SETTINGS_ENABLE_EXTENDED_EXCEPTIONS, true };
QWeakPointer<ScriptEngines> _scriptEngines;
};
ScriptEnginePointer scriptEngineFactory(ScriptEngine::Context context,