I found $:/tags/StartupAction/Browser will only execute tiddlywi actions,
but can't execute javascript.
But I have following JS want to execute:
// we won't do copy on select on text editor, otherwise you can't select
and override text in the editor or text input
function checkIfElementIsEditor(element) {
const isEditableElement = ['INPUT',
'TEXTAREA'].includes(element.nodeName);
const isTextEditor = (element.className ||
'').toLowerCase().includes('codemirror');
return isEditableElement || isTextEditor;
}
// Copy on select, copy document selection when mouse button is up
document.addEventListener('mouseup', function onMouseUp() {
const elementsUnderMouse = document.querySelectorAll(':hover');
console.log(elementsUnderMouse);
if (!elementsUnderMouse ||
Array(elementsUnderMouse).some(checkIfElementIsEditor)) return;
document.execCommand('copy');
});
What could I do?
--
You received this message because you are subscribed to the Google Groups
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/tiddlywiki/96c33fa7-a505-4fd9-b8d8-74afdf398a96%40googlegroups.com.