Created
November 3, 2023 14:44
-
-
Save plateaukao/239297b3c2d7a502b5326032c2e3e566 to your computer and use it in GitHub Desktop.
selectLinkText
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fun selectLinkText(point: Point) { | |
evaluateJavascript( | |
""" | |
javascript:(function() { | |
var tt = w._touchTarget; | |
if(tt){ | |
var hrefAttr = tt.getAttribute("href"); | |
tt.removeAttribute("href"); | |
w._hrefAttr = hrefAttr; | |
var sel = w.getSelection(); | |
sel.removeAllRanges(); | |
} | |
})() | |
""".trimIndent() | |
) { | |
postDelayed({ simulateLongClick(point) }, 0) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment