Surfingkeys icon indicating copy to clipboard operation
Surfingkeys copied to clipboard

Failed to operate DOM in insert mode

Open zxyqq opened this issue 2 years ago • 0 comments

Prelude

Error details

SurfingKeys: 1.12 Browser: <Microsoft Edge 110.0.1587.46 ><win 11>

Context

I want to use the following map to trigger the specified DOM item clicked. but failed while it works when execute the same code in console by pressing F12, why? var a = document.getElementsByClassName("icon aui-icon aui-icon-small aui-iconfont-editor-list-number")

imapkey('<Alt-n>', "#confluence list-number", function() {
    alert("xxx1")
    var a = document.getElementsByClassName("icon aui-icon aui-icon-small aui-iconfont-editor-list-number")
    alert(a)
    alert(a.length)
    if(a.length) {
        alert("xxx2")
        a[0].click();
    }
});

zxyqq avatar Feb 17 '23 05:02 zxyqq