mirror of
https://github.com/lubosz/overte.git
synced 2025-04-09 21:23:19 +02:00
Housekeeping.
This commit is contained in:
parent
fbaf0ea56b
commit
c121a8ef2a
3 changed files with 45 additions and 48 deletions
|
@ -21,52 +21,50 @@ import "../../../windows"
|
|||
|
||||
|
||||
Rectangle {
|
||||
id: parentBody;
|
||||
|
||||
function getWhitelistAsText() {
|
||||
var whitelist = Settings.getValue("private/settingsSafeURLS");
|
||||
var arrayWhitelist = whitelist.split(",");
|
||||
var whitelistText = arrayWhitelist.join("\n");
|
||||
return whitelistText;
|
||||
}
|
||||
|
||||
function setWhitelistAsText(whitelistText) {
|
||||
Settings.setValue("private/settingsSafeURLS", whitelistText.text);
|
||||
id: parentBody;
|
||||
|
||||
var originalSetString = whitelistText.text;
|
||||
var originalSet = originalSetString.split(' ').join('');
|
||||
function getWhitelistAsText() {
|
||||
var whitelist = Settings.getValue("private/settingsSafeURLS");
|
||||
var arrayWhitelist = whitelist.split(",").join("\n");
|
||||
return arrayWhitelist;
|
||||
}
|
||||
|
||||
var check = Settings.getValue("private/settingsSafeURLS");
|
||||
var arrayCheck = check.split(",");
|
||||
var textCheck = arrayCheck.join("\n");
|
||||
function setWhitelistAsText(whitelistText) {
|
||||
Settings.setValue("private/settingsSafeURLS", whitelistText.text);
|
||||
|
||||
if (textCheck == originalSet) {
|
||||
setWhitelistSuccess(true);
|
||||
} else {
|
||||
setWhitelistSuccess(false);
|
||||
}
|
||||
}
|
||||
|
||||
function setWhitelistSuccess(success) {
|
||||
if (success) {
|
||||
notificationText.text = "Successfully saved settings.";
|
||||
} else {
|
||||
notificationText.text = "Error! Settings not saved.";
|
||||
}
|
||||
}
|
||||
|
||||
function toggleWhitelist(enabled) {
|
||||
Settings.setValue("private/whitelistEnabled", enabled);
|
||||
console.info("Toggling Whitelist to:", enabled);
|
||||
}
|
||||
|
||||
function initCheckbox() {
|
||||
var check = Settings.getValue("private/whitelistEnabled");
|
||||
|
||||
if (check == true) {
|
||||
whitelistEnabled.toggle();
|
||||
}
|
||||
}
|
||||
var originalSetString = whitelistText.text;
|
||||
var originalSet = originalSetString.split(' ').join('');
|
||||
|
||||
var check = Settings.getValue("private/settingsSafeURLS");
|
||||
var arrayCheck = check.split(",").join("\n");
|
||||
|
||||
if (arrayCheck === originalSet) {
|
||||
setWhitelistSuccess(true);
|
||||
} else {
|
||||
setWhitelistSuccess(false);
|
||||
}
|
||||
}
|
||||
|
||||
function setWhitelistSuccess(success) {
|
||||
if (success) {
|
||||
notificationText.text = "Successfully saved settings.";
|
||||
} else {
|
||||
notificationText.text = "Error! Settings not saved.";
|
||||
}
|
||||
}
|
||||
|
||||
function toggleWhitelist(enabled) {
|
||||
Settings.setValue("private/whitelistEnabled", enabled);
|
||||
console.info("Toggling Whitelist to:", enabled);
|
||||
}
|
||||
|
||||
function initCheckbox() {
|
||||
var check = Settings.getValue("private/whitelistEnabled", false);
|
||||
|
||||
if (check) {
|
||||
whitelistEnabled.toggle();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
anchors.fill: parent
|
||||
|
@ -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/>
|
||||
|
|
|
@ -2333,7 +2333,7 @@ void ScriptEngine::entityScriptContentAvailable(const EntityItemID& entityID, co
|
|||
if (isURL) {
|
||||
setParentURL(scriptOrURL);
|
||||
}
|
||||
|
||||
|
||||
// SANITY/PERFORMANCE CHECK USING SANDBOX
|
||||
const int SANDBOX_TIMEOUT = 0.25 * MSECS_PER_SECOND;
|
||||
BaseScriptEngine sandbox;
|
||||
|
@ -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;
|
||||
|
|
|
@ -974,7 +974,6 @@ protected:
|
|||
Setting::Handle<bool> _enableExtendedJSExceptions { _SETTINGS_ENABLE_EXTENDED_EXCEPTIONS, true };
|
||||
|
||||
QWeakPointer<ScriptEngines> _scriptEngines;
|
||||
|
||||
};
|
||||
|
||||
ScriptEnginePointer scriptEngineFactory(ScriptEngine::Context context,
|
||||
|
|
Loading…
Reference in a new issue