Safari extension without native code

I have a simple Safari extension which contains only Javascript and no native code.

Currently I have the placeholder SafariWebExtensionHandler.swift that Xcode created when I added the extension. It's not doing anything useful, but simply deleting it doesn't seem to work.

Can I have an extension that includes no native code?

Answered by Frameworks Engineer in 829136022

You can delete the beginRequest() method, but SafariWebExtensionHandler is required. If you are not using native messaging, it will not be used.

You can delete the beginRequest() method, but SafariWebExtensionHandler is required. If you are not using native messaging, it will not be used.

You can delete the beginRequest() method, but SafariWebExtensionHandler is required.

Deleting beginRequest gives a "does not conform to protocol" error.

I have removed its body, which seems to work.

Safari extension without native code
 
 
Q