Help me to run this javaScript on webview

this js code is used by an ios app called Shortcuts it allow users to run javaScript on Safari browser. I want to use this js code to run on kodular webview. I tried it but failed , any idea friends?
JS code
var result = [ ];

var elements = document.querySelectorAll(“a”);

for ( let element of elements ) {


“url”: element.href,

“text”: element.innerText




have you tried ?

component_method (18)

blocks - 2020-02-26T202708.251

component_event (9)

This is not complete js code

i did but not working …

1 Like

but shortcut app only need this code.
comletion() is a function used to run code in shortcut

thats why its incomplete where did you define this function

1 Like