//--------- now check the content of the clipboard var clipboard = SpecialPowers.Cc["@mozilla.org/widget/clipboard;1"]
.getService(SpecialPowers.Ci.nsIClipboard);
// does the clipboard contain text/plain data ?
ok(clipboard.hasDataMatchingFlavors(["text/plain"], clipboard.kGlobalClipboard), "clipboard contains unicode text");
// does the clipboard contain text/html data ?
ok(clipboard.hasDataMatchingFlavors(["text/html"], clipboard.kGlobalClipboard), "clipboard contains html text");
window.addEventListener("paste", (e) => {
is(e.clipboardData.types.indexOf('text/html'), -1, "clipboardData shouldn't have text/html");
is(e.clipboardData.getData('text/plain'), "Formatted Text", "getData(text/plain) should return plain text");
SimpleTest.finish();
});
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.