Sam Kington
Sam Kington

Reputation: 1200

How is injected content by a Safari extension supposed to work?

This is a bafflingly basic question that Google is unable to help. I have a Safari extension that appears to work in many ways: I've got a certificate, I've got a global page which I can inspect, I've added a contextual menu item and I have a javascript file, loaded from the global page, which receives the events fired when the contextual menu item is chosen.

But if I add an end script or a style sheet, nothing happens, even though I've set Extension Website Access Level to All. Even if I uninstall and reinstall the extension, and/or reload the active website, nothing. Calls to window.console.log() in injected javascript don't get run, neither scripts nor css files appear in the list of resources in the web inspector, either the Resources or Scripts tabs, nothing.

Any ideas as to what I could do to debug this problem further?

Upvotes: 2

Views: 2400

Answers (1)

chulster
chulster

Reputation: 2829

Sounds like maybe you didn't select your injected script under the Injected Extension Content heading of the Extension Builder. If you did, then try restarting Safari and reloading the extension.

Upvotes: 2

Related Questions