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
12
votes
4 answers

cross-browser extension development alternatives

I would like to develop a browser extension for all major browsers. From what I've read this can be quite painful, particularly for IE. Before starting with the project, I would like to know what are my basic alternatives. I can think of…
11
votes
8 answers

Convert Web Extension to Safari App Extension

I have Web Extensions which currently runs on Chrome, Firefox and Opera. Now I'm wondering is there a way to use same code to build Safari App Extension, maybe something like PhoneGap(wrap all existing JS code in Safari App Extension project) or…
11
votes
2 answers

How to open Safari Extension ToolbarItem popover programmatically

I want to programmatically trigger a 'click' event on my Safari Extension toolbarItem so that my custom popover appears after something happens on the webpage. I'm using the new Xcode extension IDE and have built my popover using interface builder.…
michael_head
  • 111
  • 3
10
votes
2 answers

CORS issue during HTTP request from background service worker in Safari web extension

Link to a repo with the Xcode project to test the issue: Test CORS Issue This extension uses Manifest v3 and I have example.com in host_permissions "host_permissions": [ "*://example.com/*" ] When I run fetch("https://example.com") in…
10
votes
1 answer

iOS Show UIAlert in Safari when using My App's Share Extension

I'm developing a simple content blocker for iOS 9+ devices. Everything seems to be working fine in terms of blocking ad's / trackers etc and I even have the ability to 'whitelist' websites directly from Safari using a Share Extension Action. My…
10
votes
0 answers

Safari-Extension: Add HTTP Headers

I've written an extension for Chrome which allows to send some authentification headers for an internal system. Now some colleagues asked me if I could provide this addon for Safari as well. My addon also includes some kind of internal adress book…
Ahatius
  • 4,777
  • 11
  • 49
  • 79
10
votes
2 answers

Safari Extension Developer Certificate - Windows

I'm trying to get started with Safari extension development, but I keep getting the "No Safari Extension Developer Certificate" error. I followed the openssl instructions here: making CSR certificates in Windows (7) I uploaded the CSR file to…
Rafał G.
  • 1,529
  • 22
  • 35
10
votes
2 answers

get extension uninstall event in safari

Is there a way for a Safari browser extension to detect its own uninstallation? I would like to send an event to Google Analytics to keep track of the uninstallment rate of my extension.
9
votes
1 answer

Create a "Safari App Extension" for macOS application created with Electron?

Since the release of "Safari App Extension" I have toyed around with creating safari app extensions for native applications using xcode. Now however, I'm attempting to create an extension for an application that was built using the Electron…
9
votes
1 answer

GitHub is painfully slow on Safari (macOS Sierra 10.12)

After update to macOS Sierra 10.12, It became impossible to use GitHub. Safari acts painfully slow on that. I've tried to clean cache with CleanMyMac 3, removed all extension (not disabled), and disabled all plugins for GitHub website (I actually…
s1ddok
  • 4,615
  • 1
  • 18
  • 31
9
votes
1 answer

content blocker works in simulator but does not work in iPhone device

i am working on content blocker and block the adult site so, this code is perfect work on simulator when i test on iPhone 6 then its no one site is block Alamofire.request(url).responseJSON { response in if let data = response.data, let…
ikbal
  • 1,114
  • 1
  • 11
  • 30
9
votes
1 answer

Safari Extension Showing Popover Different Window

I'm trying to build a Safari Extension where when a user hits Command+B it will show the popover. Using the code below it works but always shows the popover on a different window not the current window/tab. I would like it to display the popover on…
Charlie Fish
  • 18,491
  • 19
  • 86
  • 179
8
votes
1 answer

Current URL in Safari Extension

safari.application.activeBrowserWindow.activeTab.url is always undefined. Any idea why this might be?
bimbom22
  • 4,510
  • 2
  • 31
  • 46
8
votes
1 answer

How to send a message (tokens) from an iOS App to its Safari Extension?

I tried looking for a solution in posts such as this and this where people had a very similar problem: How to send a message from iOS App to a Safari Extension? I even read this article where the author was explaining how to use…
Nico Cobelo
  • 557
  • 7
  • 18
8
votes
0 answers

Is there a way to get Safari extensions to work in a standalone or fullscreen PWA?

In my experience if I add a website with a PWA manifest indicating fullscreen/standalone display mode, Safari extensions are disabled. Is there any way to get fullscreen + extensions in Safari for iOS/iPadOS?
Pieter
  • 1,751
  • 3
  • 30
  • 65
1
2
3
44 45