input.setSelectionRange(0, 6);
ok(true, "Trying to copy masked password...");
await copyToClipboard(null);
isnot(SpecialPowers.getClipboardData("text/plain"), "abcdef", "Copying masked password shouldn't copy raw value into the clipboard");
isnot(SpecialPowers.getClipboardData("text/plain"), `${kMask}${kMask}${kMask}${kMask}${kMask}${kMask}`, "Copying masked password shouldn't copy masked value into the clipboard");
ok(true, "Trying to cut masked password...");
await cutToClipboard(null);
isnot(SpecialPowers.getClipboardData("text/plain"), "abcdef", "Cutting masked password shouldn't copy raw value into the clipboard");
isnot(SpecialPowers.getClipboardData("text/plain"), `${kMask}${kMask}${kMask}${kMask}${kMask}${kMask}`, "Cutting masked password shouldn't copy masked value into the clipboard");
is(input.value, "abcdef", "Cutting masked password shouldn't modify the value");
editor.unmask(2, 4); input.setSelectionRange(0, 6);
ok(true, "Trying to copy partially masked password...");
await copyToClipboard(null);
isnot(SpecialPowers.getClipboardData("text/plain"), "abcdef", "Copying partially masked password shouldn't copy raw value into the clipboard");
isnot(SpecialPowers.getClipboardData("text/plain"), `${kMask}${kMask}cd${kMask}${kMask}`, "Copying partially masked password shouldn't copy partially masked value into the clipboard");
isnot(SpecialPowers.getClipboardData("text/plain"), `${kMask}${kMask}${kMask}${kMask}${kMask}${kMask}`, "Copying partially masked password shouldn't copy masked value into the clipboard");
ok(true, "Trying to cut partially masked password...");
await cutToClipboard(null);
isnot(SpecialPowers.getClipboardData("text/plain"), "abcdef", "Cutting partially masked password shouldn't copy raw value into the clipboard");
isnot(SpecialPowers.getClipboardData("text/plain"), `${kMask}${kMask}cd${kMask}${kMask}`, "Cutting partially masked password shouldn't copy partially masked value into the clipboard");
isnot(SpecialPowers.getClipboardData("text/plain"), `${kMask}${kMask}${kMask}${kMask}${kMask}${kMask}`, "Cutting partially masked password shouldn't copy masked value into the clipboard");
is(input.value, "abcdef", "Cutting partially masked password shouldn't modify the value");
input.setSelectionRange(2, 4);
ok(true, "Trying to copy unmasked password...");
await copyToClipboard("cd");
is(input.value, "abcdef", "Copying unmasked password shouldn't modify the value");
input.value = "012345";
editor.unmask(2, 4); input.setSelectionRange(2, 4);
ok(true, "Trying to cut unmasked password...");
await cutToClipboard("23");
is(input.value, "0145", "Cutting unmasked password should modify the value");
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.