Questions tagged [safari-extension]

A legacy API to extend Apple's Safari web browser. As of Safari 14/MacOS 11, a framework named Safari Web Extension implements the standard browser extension APIs. Safari App Extensions, introduced with MacOS 10.12 ("Sierra"), is aimed at integration of native applications with the browser.

Safari Extensions is the term Apple used for a legacy API to extend the browser. As of MacOS 11, Safari Web Extensions (safari-web-extension) is the official framework to implement browser extensions in JS, while Safari App Extensions (safari-app-extension) focus on the integration of native applications with the browser and their communication.

Legacy documentation can be found starting at the Safari Extensions Development Guide.

662 questions
8
votes
3 answers

How can crashes of Safari extensions on Mojave be avoided?

When I build my macOS application that has an Safari extension in it, which I run on Safari, it crashes after a couple of seconds of running (though it does show up in the extensions). It seems to be a problem of Safari trying to obtain data from…
Lukas Süsslin
  • 553
  • 1
  • 3
  • 12
8
votes
3 answers

Can a Safari Extension react on the creation of a new tab?

I am currently writing my first extension for Safari 5. I can't find a reference on what events an extension can react. I want my extension to react on these events: when a new tab is created. when a new browser window is created. when the URL…
Norwald
  • 81
  • 1
8
votes
3 answers

Python Selenium Safari, disable logging

Recently I posted this as a possible answer to the question How to use Selenium Safari Webdriver. The problem with my answer is that logging from the jar file is appearing in the terminal when I run the python script and I'd like to disable that.…
Loknar
  • 1,169
  • 2
  • 13
  • 38
8
votes
1 answer

Interprocess communication between browser extension and native application

How can an interprocess communication be estabilished between a browser extension and a native application? Is there any cross-platform (Linux and Mac OS X) and cross-browser solution (Firefox, Chrome, Safari)? The only idea that comes to my mind is…
8
votes
1 answer

How to intercept a web request

Is there something like Chromium's chrome.webRequest for Safari extensions? I went through their documentation here. The closest thing I could find was SafariBeforeNavigateEvent. This will prevent the new page load but still would send the request…
Juzer Ali
  • 4,109
  • 3
  • 35
  • 62
7
votes
0 answers

Safari extension: send message from injected script to popover

I am porting a chrome/opera extension to safari. It shows a popover with some data relative to the page. So it needs to communicate with the injected script. I figured out how to communicate between the injected script and background page and…
7
votes
0 answers

Safari extension and chrome.webRequest.onBeforeRequest.addListener

I have tried to port a Chrome extension that uses this API: chrome.webRequest.onBeforeRequest.addListener( afunction, { urls: someblockedurls}, ["blocking"]); When a URL is blocked in the system, it won't be shown at all in the…
7
votes
1 answer

Safari Extension, Fluid App

I've written a simple extension for Safari that captures clicks on the RSS button in the address bar (calls to the feed:// protocol) and redirects to Google Reader instead of Safari's feed reader. If, however, the user has a Fluid app (one that…
Rob Wilkerson
  • 40,476
  • 42
  • 137
  • 192
7
votes
4 answers

iOS9 Safari content blocker extension not invoked

I'm playing with XCode7 beta, trying to test the shiny new "Content Blocker Extension". The example class is adopting the same NSExtensionRequestHandling protocol as the (already known) Sharing extension. The essential difference from Sharing…
Pavel Zdenek
  • 7,146
  • 1
  • 23
  • 38
7
votes
0 answers

Is it possible to create Safari Extensions without Developer Certificate?

Apple's Safari program is down and I can't create a certificate. Is there anyway I can make one without a certificate?
Volatil3
  • 14,253
  • 38
  • 134
  • 263
7
votes
1 answer

How to export Safari Web Inspector timeline data?

Just like in Chrome Developer Tool, I was wondering if there is any tool/extension/plugin which would allow me to export timeline data in Safari. I tried the nightly build of webkit but it does not have that feature. Seems like this is a Chrome…
6
votes
2 answers

Copy to clipboard in a Safari extension?

In a (Mac) Safari extension, is it possible to programmatically copy some text to OS X clipboard? All the working solutions I have found requires Flash, which in this context is not possible.
Guillaume
  • 21,685
  • 6
  • 63
  • 95
6
votes
0 answers

How can I get the install state of Safari iOS extension?

I'd like to know the install state of my iOS safari extension in the associated swift app. Is there any way to get this? SFSafariExtensionManager and getStateOfSafariExtension here only seems valid on macOS safari extensions. Is there any equivalent…
tob88
  • 2,151
  • 8
  • 30
  • 33
6
votes
1 answer

How can I sign a Safari Extension for just one computer?

I wrote a Safari Extension that I'd like to have permanently enabled on my computer. It works fine, but I have to click Develop -> Allow Unsigned Extensions and enable it manually every time I open Safari for it to be available. I'm not really sure…
kneedhelp
  • 555
  • 4
  • 18
6
votes
2 answers

How to listen to "beforeNavigate" event in safari app extensions

I'm developing a safari app extension. I've to listen to "beforeNavigate" event as in old Safari JS Extensions, we could listen to these events using Safari's Windows & Tabs API. I went through the How to create Safari App Extension, but…
1 2
3
44 45