fredpi
fredpi

Reputation: 8942

Change Safari URL with App Extension

When the icon of my Safari app extension icon is touched, I want to change the URL without showing a new view. Doing this comes down to two issues:

Upvotes: 5

Views: 930

Answers (2)

William Ku
William Ku

Reputation: 798

Actually, you might be able to change the URL at the finalize function of your ExtensionPreprocessingJS file

   // Note that the finalize function is only available in iOS.
   finalize: function(arguments) {

   // arguments contains the value the extension provides in   
   [NSExtensionContext completeRequestReturningItems:completion:].

   // In this example, the extension provides a color as a returning item.
   document.URL = arguments["newUrl"];    
}

Upvotes: 1

Zorayr
Zorayr

Reputation: 24922

It seems like what you're describing is a bookmark, and not an app extension. I would highly doubt that app extensions would allow you to interface with Safari and update the URL, this would be wrong in many regards, including privacy and security. In short, not possible (sorry).

Upvotes: 0

Related Questions