Add a user control mechanism to deny clipboard cut/copy.

This commit is contained in:
Pale Moon
2017-01-08 23:14:56 +01:00
committed by roytam1
parent b693160f4f
commit beaf9608a5
3 changed files with 22 additions and 1 deletions
+6
View File
@@ -3227,6 +3227,12 @@ nsHTMLDocument::ExecCommand(const nsAString& commandID,
// Special case for cut and copy.
// Cut/copy are allowed in non-editable documents.
if (isCutCopy) {
// Emit a security error if the user explicitly disabled cut and copy.
if (nsContentUtils::IsCutCopyRestricted() && !nsContentUtils::IsCallerChrome()) {
rv = NS_ERROR_DOM_SECURITY_ERR;
return false;
}
if (!nsContentUtils::IsCutCopyAllowed()) {
return false;
}