0

I have safari contextual menu button made with safari extension builder, Now I any webpage when i click the contextual menu button (which I created) over any link then it should show the "URL" (over which I clicked) as a alert message from my safari browser.

I cannot pass the url from the webpage to the script so that I can display it. Need to display "URL" as a alert.

I used a global html page with only script tag inside for this purpose.

<script>
    safari.application.addEventListener("command", performCommand, true);
    function performCommand(event) {
    if (event.command == "OnClickOpenWith") {
        alert("URL");
        // Need to display "URL" in the alert section
        }
    } 
</script>

You must log in to answer this question.

Browse other questions tagged .