开发者

How to add javascript code to safari extension?

开发者 https://www.devze.com 2023-01-12 20:50 出处:网络
I create a safari extension , but I don\'t kown how to add javascript code to safari extensi开发者_开发技巧on?A Safari extension is almost entirely Javascript. That\'s a bit of an oversimplification,

I create a safari extension , but I don't kown how to add javascript code to safari extensi开发者_开发技巧on?


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.


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

0

精彩评论

暂无评论...
验证码 换一张
取 消