1

I create a safari extension , but I don't kown how to add javascript code to safari extension?

2 Answers 2

2

A Safari extension is almost entirely Javascript. That's a bit of an oversimplification, but what kind of extension have you created if there's no Javascript? You can write as much or as little JS as you like in any injected script or in a global HTML file. The details of where/when/how to use each of these is pretty well documented.

There's nothing particularly special about the nature of the Javascript that you can place in any of these files except that you do have access to a Safari-centric API. Otherwise, it's just the same old Javascript you'd write for the web with a few quirks of the framework itself. A lot of folks even include jQuery or other JS libraries to help, though they add more overhead than I'd recommend in most cases.

Sign up to request clarification or add additional context in comments.

Comments

1

I think you should read this first. Safari Extension Development Guide

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.